<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>mFabrik - mobile sites, apps, HTML5 and CMS software development &#187; pydev</title>
	<atom:link href="http://blog.mfabrik.com/category/pydev/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mfabrik.com</link>
	<description>Freedom delivered.</description>
	<lastBuildDate>Wed, 03 Aug 2011 09:47:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Eclipse plug-in for Plone/Zope/buildout based development</title>
		<link>http://blog.mfabrik.com/2010/03/29/eclipse-plug-in-for-plonezopebuildout-based-development/</link>
		<comments>http://blog.mfabrik.com/2010/03/29/eclipse-plug-in-for-plonezopebuildout-based-development/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 10:01:47 +0000</pubDate>
		<dc:creator>Mikko Ohtamaa</dc:creator>
				<category><![CDATA[buildout]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[plone]]></category>
		<category><![CDATA[pydev]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[zope]]></category>

		<guid isPermaLink="false">http://blog.mfabrik.com/?p=441</guid>
		<description><![CDATA[Few days ago Fabio announced Django plug-in for Eclipse. There also exists an effort to make Eclipse integrate smoother with Plone / Zope / Buildout world. Please see PyPi page here. It is not nearly as polished as Fabio&#8217;s work, as Fabio being main author of PyDev and started as a collection of company internal [...]]]></description>
			<content:encoded><![CDATA[<p>Few days ago Fabio announced <a href="http://pydev.blogspot.com/2010/03/django-on-pydev.html">Django plug-in for Eclipse</a>. There also exists an effort to make Eclipse integrate smoother with Plone / Zope / Buildout world.</p>
<p>Please see <a href="http://pypi.python.org/pypi/collective.eclipsescripts">PyPi page here</a>.</p>
<p>It is not nearly as polished as Fabio&#8217;s work, as Fabio being main author of PyDev and started as a collection of company internal tools. However if you mare making many buildouts, write code &gt; 5 Python modules at once and don&#8217;t want to start terminal everytime you need to run buildout, this plug-in is for you.</p>
<p>Also, it is not yet a real plug-in. It is a collection of <a href="http://code.google.com/p/jrfonseca/wiki/PythonMonkey">PythonMonkey scripts</a>. This means that to deploy the scripts you simply copy .py files them to <em>scripts</em> folder of any of your Eclipse projects. If you need to work on the codebase, you don&#8217;t need to start a separate Eclipse instance, but you can do it interactively through Eclipse console while you do other development. The script source code is well commented, so if you want to tune them for your own habits it should be easy.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mfabrik.com/2010/03/29/eclipse-plug-in-for-plonezopebuildout-based-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PyDev, Python and system default Unicode encoding problem</title>
		<link>http://blog.mfabrik.com/2010/01/24/aptana-studio-eclipse-pydev-default-unicode-encoding/</link>
		<comments>http://blog.mfabrik.com/2010/01/24/aptana-studio-eclipse-pydev-default-unicode-encoding/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 17:02:33 +0000</pubDate>
		<dc:creator>Mikko Ohtamaa</dc:creator>
				<category><![CDATA[aptana studio]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[plone]]></category>
		<category><![CDATA[pydev]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://blog.twinapex.fi/?p=415</guid>
		<description><![CDATA[Python 2 has a thing called &#8220;default encoding&#8221; to automagically encode Unicode strings when they are presented as byte strings. This is evil and has been discussed various times before. What could be even more evil? Something in your development environment messes this setting set for you, without telling you that. This way you never [...]]]></description>
			<content:encoded><![CDATA[<p>Python 2 has a thing called &#8220;default encoding&#8221; to automagically encode Unicode strings when they are presented as byte strings. <a href="http://tarekziade.wordpress.com/2008/01/08/syssetdefaultencoding-is-evil/">This is evil and has been discussed various times before</a>.</p>
<p>What could be even more evil? Something in your development environment messes this setting set for you, without telling you that. This way you never encounter Unicode problems on your development computer and when you roll out your seemingly working code to production, the world goes haywire.</p>
<p>Evil. Evil. Evil. Thousands of curses and overworking hours to fix the problems.</p>
<p>I encountered this problem. And this is the code I used to track the problem down in site.py:</p>
<pre># Trap the bastard messing with the default encoding
# using a monkey patch
old_set_default_encoding = sys.setdefaultencoding

def aargh(x):
    import pdb ; pdb.set_trace()

sys.setdefaultencoding = aargh</pre>
<div>And the result was surprising:</div>
<pre>
<div id="_mcePaste">--Return--</div>
<div id="_mcePaste">&gt; /home/moo/py24/lib/python2.4/site.py(485)aargh()-&gt;None</div>
<div id="_mcePaste">-&gt; import pdb ; pdb.set_trace()</div>
<div id="_mcePaste">(Pdb) bt</div>
<div id="_mcePaste">/home/moo/py24/lib/python2.4/site.py(613)?()</div>
<div id="_mcePaste">-&gt; main()</div>
<div id="_mcePaste">/home/moo/py24/lib/python2.4/site.py(604)main()</div>
<div id="_mcePaste">-&gt; execsitecustomize()</div>
<div id="_mcePaste">/home/moo/py24/lib/python2.4/site.py(514)execsitecustomize()</div>
<div id="_mcePaste">-&gt; import sitecustomize</div>
<div id="_mcePaste">/home/moo/Desktop/Aptana Studio 2.0/plugins/org.python.pydev_1.5.3.1260479439/PySrc/pydev_sitecustomize/sitecustomize.py(99)?()</div>
<div id="_mcePaste">-&gt; sys.setdefaultencoding(encoding) #@UndefinedVariable (it's deleted after the site.py is executed -- so, it's undefined for code-analysis)</div>
<div id="_mcePaste">&gt; /home/moo/py24/lib/python2.4/site.py(485)aargh()-&gt;None</div>
<div id="_mcePaste">-&gt; import pdb ; pdb.set_trace()</div>

--Return--&gt; /home/moo/py24/lib/python2.4/site.py(485)aargh()-&gt;None-&gt; import pdb ; pdb.set_trace()(Pdb) bt  /home/moo/py24/lib/python2.4/site.py(613)?()-&gt; main()  /home/moo/py24/lib/python2.4/site.py(604)main()-&gt; execsitecustomize()  /home/moo/py24/lib/python2.4/site.py(514)execsitecustomize()-&gt; import sitecustomize  /home/moo/Desktop/Aptana Studio 2.0/plugins/org.python.pydev_1.5.3.1260479439/PySrc/pydev_sitecustomize/sitecustomize.py(99)?()-&gt; sys.setdefaultencoding(encoding) #@UndefinedVariable (it's deleted after the site.py is executed -- so, it's undefined for code-analysis)&gt; /home/moo/py24/lib/python2.4/site.py(485)aargh()-&gt;None-&gt; import pdb ; pdb.set_trace()</pre>
<p>Looks like the culprint was PyDev (Eclipse Python plug-in).  The interfering source code is <a href="http://github.com/aptana/Pydev/blob/master/plugins/org.python.pydev/PySrc/pydev_sitecustomize/sitecustomize.py">here</a>. Looks like the reason was to co-operate with Eclipse console. However it has been done incorrectly. Instead of setting the console encoding, the encoding is set to whole Python run-time environment, messing up the target run-time where the development is being done.</p>
<p>There is a possible fix for this problem. In Eclipse Run&#8230; dialog settings you can choose <em>Console Encoding</em> on <em>Common</em> tab. There is a possible value <em>US-ASCII</em>. I am not sure what Python 2 thinks &#8220;US-ASCII&#8221; encoding name, since the default is &#8220;ascii&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mfabrik.com/2010/01/24/aptana-studio-eclipse-pydev-default-unicode-encoding/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

