This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: UnicodeEncodeError message has syntax error
Type: Stage:
Components: Unicode Versions: Python 2.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: lemburg Nosy List: doerwalter, lemburg, tlynn
Priority: low Keywords:

Created on 2004-05-07 01:31 by tlynn, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg20726 - (view) Author: Tom Lynn (tlynn) Date: 2004-05-07 01:31
It's a bit nit-picking, but shouldn't the '\ua3' in the
UnicodeEncodeError message below be '\xa3' or u'\xa3'?
 http://www.python.org/doc/current/ref/strings.html
only allows for \uxxxx and \Uxxxxxxxx format specifiers.

>>> u"\N{POUND SIGN}"
u'\xa3'
>>> _.encode("ascii")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
UnicodeEncodeError: 'ascii' codec can't encode
character '\ua3' in position 0: ordinal not in range(128)
>>> '\ua3'
'\\ua3'
>>> u'\ua3'
UnicodeDecodeError: 'unicodeescape' codec can't decode
bytes in position 0-3: end of string in escape sequence
msg20727 - (view) Author: Walter Dörwald (doerwalter) * (Python committer) Date: 2004-05-07 11:23
Logged In: YES 
user_id=89016

This has already been fixed in Python/exception.c 1.46 and 
1.44.10.1
History
Date User Action Args
2022-04-11 14:56:04adminsetgithub: 40228
2004-05-07 01:31:03tlynncreate