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.

Author ned.deily
Recipients ned.deily
Date 2011-09-14.22:51:36
SpamBayes Score 3.0181337e-07
Marked as misclassified No
Message-id <1316040696.89.0.548775164505.issue12983@psf.upfronthosting.co.za>
In-reply-to
Content
In behavior carried over from Python 2 string literals, Python 3 byte string literals raise a less helpful ValueError exception when an invalid hex escape code is given:

    >>> x = b'\x0'
    ValueError: invalid \x escape

A string literal raises a SyntaxError and a full traceback including line number:

    >>> x = '\x0'
      File "<stdin>", line 1
    SyntaxError: (unicode error) 'unicodeescape' codec can't decode
     bytes in position 0-2: end of string in escape sequence
History
Date User Action Args
2011-09-14 22:51:36ned.deilysetrecipients: + ned.deily
2011-09-14 22:51:36ned.deilysetmessageid: <1316040696.89.0.548775164505.issue12983@psf.upfronthosting.co.za>
2011-09-14 22:51:36ned.deilylinkissue12983 messages
2011-09-14 22:51:36ned.deilycreate