[ python-Bugs-949605 ] UnicodeEncodeError message has syntax error

SourceForge.net noreply at sourceforge.net
Thu May 6 21:33:52 EDT 2004


Bugs item #949605, was opened at 2004-05-07 01:31
Message generated for change (Settings changed) made by tlynn
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=949605&group_id=5470

Category: Unicode
Group: Python 2.3
Status: Open
Resolution: None
>Priority: 2
Submitted By: Tom Lynn (tlynn)
Assigned to: M.-A. Lemburg (lemburg)
Summary: UnicodeEncodeError message has syntax error

Initial Comment:
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


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=949605&group_id=5470



More information about the Python-bugs-list mailing list