Message175411
'AB\xff'.encode('ascii') raises a UnicodeDecodeError because the byte string 'AB\xff' is decoded from the default encoding (sys.getdefaultencoding(), which is 'ASCII' in most cases), before the .encode() method is called.
This is not a Python bug, but it is surprising. You should try Python 3 which does not have implicit conversion from/to bytes/unicode. |
|
Date |
User |
Action |
Args |
2012-11-11 23:57:40 | vstinner | set | recipients:
+ vstinner, ezio.melotti, Wojtek.Szymilowski |
2012-11-11 23:57:40 | vstinner | set | messageid: <1352678260.94.0.804740030943.issue16456@psf.upfronthosting.co.za> |
2012-11-11 23:57:40 | vstinner | link | issue16456 messages |
2012-11-11 23:57:40 | vstinner | create | |
|