[issue10328] re.sub[n] doesn't seem to handle /Z replacements correctly in all cases

2019-04-27 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue10328] re.sub[n] doesn't seem to handle /Z replacements correctly in all cases

2019-04-27 Thread Mark Lawrence
Change by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue10328] re.sub[n] doesn't seem to handle /Z replacements correctly in all cases

2019-04-27 Thread Ma Lin
Ma Lin added the comment: This bug was fixed in Python 3.7, see issue32308. Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] on win32 >>> re.compile('(?m)(?P[ >>> \t]+\r*$)|(?P(?<=[^\n])\Z)').subn(lambda m:next('<'+k+'>' >>> for k,v in

[issue10328] re.sub[n] doesn't seem to handle /Z replacements correctly in all cases

2014-09-30 Thread Mark Lawrence
Mark Lawrence added the comment: @Serhiy can you take a look at this as I recall you've been doing some regex work? -- nosy: +BreamoreBoy, serhiy.storchaka versions: +Python 3.4, Python 3.5 -Python 3.1 ___ Python tracker rep...@bugs.python.org

[issue10328] re.sub[n] doesn't seem to handle /Z replacements correctly in all cases

2010-11-05 Thread Alexander Schmolck
New submission from Alexander Schmolck a.schmolck+...@gmail.com: In certain cases a zero-width /Z match that should be replaced isn't. An example might help: re.compile('(?m)(?Ptrailing_ws[ \t]+\r*$)|(?Pno_final_newline(?=[^\n])\Z)').subn(lambda m:next(''+k+'' for k,v in

[issue10328] re.sub[n] doesn't seem to handle /Z replacements correctly in all cases

2010-11-05 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: +mrabarnett ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10328 ___ ___

[issue10328] re.sub[n] doesn't seem to handle /Z replacements correctly in all cases

2010-11-05 Thread Matthew Barnett
Matthew Barnett pyt...@mrabarnett.plus.com added the comment: It's a bug caused by trying to avoid getting stuck when a zero-width match is found. Basically the fix is to advance one character after a zero-width match, but that doesn't always give the correct result. There are a number of

[issue10328] re.sub[n] doesn't seem to handle /Z replacements correctly in all cases

2010-11-05 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: -- versions: +Python 2.7 -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10328 ___ ___