[issue10284] Exception raised when decoding NNTP newsgroup descriptions
Julien ÉLIE
report at bugs.python.org
Mon Nov 1 21:50:12 CET 2010
Julien ÉLIE <julien at trigofacile.com> added the comment:
Traceback (most recent call last):
File "nntplib-test.py", line 10, in <module>
print(s.descriptions('*'))
File "C:\Program Files\Python32\lib\encodings\cp850.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 3285-3287: character maps to <undefined>
The code was previously working fine with Python 3.1.
Looking more in details:
(resp, descs) = s.descriptions('*')
clefs = list(descs.keys())
clefs.sort()
for clef in clefs:
print(clef), print(b[clef])
Traceback (most recent call last):
File "nntplib-test.py", line 14, in <module>
print(clef), print(b[clef])
File "C:\Program Files\Python32\lib\encodings\cp850.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u0152' in position 0: character maps to <undefined>
That is another error. It corresponds to a description containing « Œ », yet in UTF-8.
So you mean the issue comes from the MS-DOS console I am using.
Well, that seems right.
No problem in the Python IDLE!
Maybe this issue should be closed then?
(Yet, something changed because print() worked fine with the previous version...)
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10284>
_______________________________________
More information about the Python-bugs-list
mailing list