python3 - the hardest hello world ever ?

Helmut Jarausch jarausch at igpm.rwth-aachen.de
Wed Oct 15 06:08:28 EDT 2008


Martin v. Löwis wrote:
>> do I miss something (I do hope so) or is switching to Python3
>> really hard for Latin1-users?
> 
> Why do you want to switch? sys.stdout.encoding should already be
> iso-8859-1, if you are a Latin1-user.
> 

What defines me as latin1-user?

commenting
# sys.stdout._encoding='latin1'


I get
Traceback (most recent call last):
   File "latin1.py", line 8, in <module>

   File "/usr/local/lib/python3.0/io.py", line 1485, in write
     b = encoder.encode(s)
   File "/usr/local/lib/python3.0/encodings/ascii.py", line 22, in encode
     return codecs.ascii_encode(input, self.errors)[0]
UnicodeEncodeError: 'ascii' codec can't encode characters in position 1-2: 
ordinal not in range(128)

So my system seems to be an ASCII system?


Thanks,
Helmut

-- 
Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany



More information about the Python-list mailing list