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 serhiy.storchaka
Recipients ezio.melotti, mrabarnett, pitrou, serhiy.storchaka
Date 2014-09-08.11:07:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1410174440.93.0.911211496637.issue22362@psf.upfronthosting.co.za>
In-reply-to
Content
Currently the re module accepts octal escapes from \400 to \777, but ignore highest bit.

>>> re.search(r'\542', 'abc')
<_sre.SRE_Match object; span=(1, 2), match='b'>

This behavior looks surprising and is inconsistent with the regex module which preserve highest bit. Such escaping is not portable across different regular exception engines.

I propose to add a warning when octal escape value is larger than 0o377. Here is preliminary patch which adds UserWarning. Or may be better to emit DeprecationWarning and then replace it by ValueError in future releases?
History
Date User Action Args
2014-09-08 11:07:20serhiy.storchakasetrecipients: + serhiy.storchaka, pitrou, ezio.melotti, mrabarnett
2014-09-08 11:07:20serhiy.storchakasetmessageid: <1410174440.93.0.911211496637.issue22362@psf.upfronthosting.co.za>
2014-09-08 11:07:20serhiy.storchakalinkissue22362 messages
2014-09-08 11:07:20serhiy.storchakacreate