[New-bugs-announce] [issue39454] when \\u in byte_string , byte_string.decode('raw_unicode_escape') maybe has problem

YPf report at bugs.python.org
Sat Jan 25 10:17:41 EST 2020


New submission from YPf <yayiba1223 at 163.com>:

>>> path=r'C:\Users\Administrator\Desktop'
>>> path.encode('raw_unicode_escape')
b'C:\\Users\\Administrator\\Desktop'
>>> path.encode('raw_unicode_escape').decode('raw_unicode_escape')
Traceback (most recent call last):
  File "<pyshell#48>", line 1, in <module>
    path.encode('raw_unicode_escape').decode('raw_unicode_escape')
UnicodeDecodeError: 'rawunicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

----------
messages: 360691
nosy: yayiba1223
priority: normal
severity: normal
status: open
title: when \\u in byte_string ,byte_string.decode('raw_unicode_escape') maybe has problem
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39454>
_______________________________________


More information about the New-bugs-announce mailing list