Using codecs.EncodedFile() with Python 2.5

2007-01-03 Thread David Hughes
I used this function successfully with Python 2.4 to alter the encoding of a set of database records from latin-1 to utf-8, but the same program raises an exception using Python 2.5. This small example shows the problem: import codecs fo = open('test.dat', 'w') fo.write('G\xe2teaux') fo.close()

Re: Using codecs.EncodedFile() with Python 2.5

2007-01-03 Thread Peter Otten
David Hughes wrote: I used this function successfully with Python 2.4 to alter the encoding of a set of database records from latin-1 to utf-8, but the same program raises an exception using Python 2.5. This small example shows the problem: import codecs fo = open('test.dat', 'w')