pdb (Python Debugger) is a standard debugging utility for Python. If you have been using print statements to debug your Python code so far then you should definitely invest in learning this tool as it will save you time in the long run.

Even if you set your environment (e.g. export LANG=fr_FR.UTF8) to use utf-8 Python as of 2.7.1 still might not pick up this and will try to read file in ascii resulting in all too common: 'ascii' codec can't encode character u'\xa0' in position 111: ordinal not in range(128)

After lots of trial and error I found a workaround that works. First of all check if you have this problem by executing:

1
2

importsyssys.getdefaultencoding()

if it comes back with 'ascii' then read on.

Default encoding need to be changed. However this is only possible when sys module is reloaded.

Recently I had to optimize a legacy PHP cgi application, which worked fine but was too slow for its purpose. The main bottleneck was in selecting matching lines from a file containing about 15000 lines. Not finding a way to optimize PHP code I decided to change the language.
Two candidates were Python and Haskell. Knowing that Haskell is the only language out of three which compiles to machine code I expected it to be a clear winner, but I was up for a surprise...

Parameter q for this benchmark was selected to produce less than 30 entries, which is the most common case for this application. As a result lazy evaluation and early loop termination did not help the performance.

To sum up Python version is 4.5 times faster than PHP and almost 10 times faster than Haskell, which is pretty amazing.

Follow up:

As Don Stewart pointed out String type is quite slow in Haskell and a faster alternative would be to use ByteString.
So I've rewritten Haskell cgi using ByteString functions:

Guido van Rossum explains what Python developer should expect from Python 3000 in his blog article and keynote.

Python 3000 is not compatible with current Python 2. Most changes represent language clean-up and removal of deprecated features (classic classes, string exceptions). Overall language will become smaller with fewer surprises and exceptions. Guido urges developers not to change API and promises to support Python 2.6 for at least 5 years. He mentions that 2to3 tool (source-to-source) translator will help to migrate from Python 2 to Python 3000 easier.