[issue17850] unicode_escape encoding fails for '\\Upsilon'

2013-04-26 Thread Edward K Ream
Edward K Ream added the comment: On Fri, Apr 26, 2013 at 8:51 AM, Edward K. Ream wrote: > > If this is not a bug, why does six define six.u as > unicode(s,"unicode_escape") for *all* u constants?? > Oops. The following works:: s = r'\\Upsilon' unicode(s,"unicode_escape") My apologies

[issue17850] unicode_escape encoding fails for '\\Upsilon'

2013-04-26 Thread R. David Murray
R. David Murray added the comment: Because as Ezio demonstrated, it produces the same result as using the 'u' prefix on the same string. -- nosy: +r.david.murray ___ Python tracker

[issue17850] unicode_escape encoding fails for '\\Upsilon'

2013-04-26 Thread Edward K. Ream
Edward K. Ream added the comment: Thanks for your quick reply. If this is not a bug, why does six define six.u as unicode(s,"unicode_escape") for *all* u constants?? -- ___ Python tracker

[issue17850] unicode_escape encoding fails for '\\Upsilon'

2013-04-26 Thread Ezio Melotti
Ezio Melotti added the comment: This is not a bug, \U should be followed by 8 hex digits and it indicates a Unicode codepoint: >>> '\\u0065'.decode('unicode_escape') u'e' >>> '\\U0065'.decode('unicode_escape') u'e' >>> '\\Upsilon'.decode('unicode_escape') Traceback (most recent call last):

[issue17850] unicode_escape encoding fails for '\\Upsilon'

2013-04-26 Thread Edward K. Ream
New submission from Edward K. Ream: On both windows and Linux the following fails on Python 2.7: s = '\\Upsilon' unicode(s,"unicode_escape") UnicodeDecodeError: 'unicodeescape' codec can't decode bytes in position 0-7: end of string in escape sequence BTW, the six.py package uses this c