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 Samuel Warfield
Recipients Samuel Warfield, ezio.melotti, mrabarnett
Date 2018-10-26.04:36:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1540528576.04.0.788709270274.issue35072@psf.upfronthosting.co.za>
In-reply-to
Content
Bug with regex substitutions. When calling the re.sub() method directly
char(92), the double backslash charecter as the replacement, throws an
exception. Whereas compiling a regex object then calling its own .sub()
method works completely fine. I did a quick look through the bug tracker 
search for similar issues and none were reported.

# Breaks
re.sub(r'\\\\', chr(92), stringy_thingy)

vs 

# Works
parser = re.compile(r'\\\\')
parser.sub(chr(92), stringy_thingy)

# Where stringy_thingy is a string that is being substituted
History
Date User Action Args
2018-10-26 04:36:16Samuel Warfieldsetrecipients: + Samuel Warfield, ezio.melotti, mrabarnett
2018-10-26 04:36:16Samuel Warfieldsetmessageid: <1540528576.04.0.788709270274.issue35072@psf.upfronthosting.co.za>
2018-10-26 04:36:15Samuel Warfieldlinkissue35072 messages
2018-10-26 04:36:15Samuel Warfieldcreate