[issue33566] re.findall() dead locked whent the expected ending char not occur until end of string

2018-07-28 Thread Tim Peters
Tim Peters added the comment: Closing as not-a-bug - not enough info to reproduce, but the regexp looked prone to exponential-time backtracking to both MRAB and me, and there's been no response to requests for more info. -- components: +Regular Expressions nosy: +ezio.melotti

[issue33566] re.findall() dead locked whent the expected ending char not occur until end of string

2018-05-18 Thread Tim Peters
Tim Peters added the comment: Min, you need to give a complete example other people can actually run for themselves. Offhand, this part of the regexp (.|\s)* all by itself _can_ cause exponential-time behavior. You can run this for yourself: >>> import re >>> p =

[issue33566] re.findall() dead locked whent the expected ending char not occur until end of string

2018-05-18 Thread Matthew Barnett
Matthew Barnett added the comment: You don't give the value of 'newlines', but the problem is probably catastrophic backtracking, not deadlock. -- nosy: +mrabarnett ___ Python tracker

[issue33566] re.findall() dead locked whent the expected ending char not occur until end of string

2018-05-18 Thread Min
Min added the comment: Sorry again, the sample code offered is issue of re.sub(), not findall() :o))) -- ___ Python tracker ___

[issue33566] re.findall() dead locked whent the expected ending char not occur until end of string

2018-05-18 Thread Min
Min added the comment: Sorry, forgot I have upgraded to 3.6.2, not 3.5 -- versions: +Python 3.6 -Python 3.5 ___ Python tracker

[issue33566] re.findall() dead locked whent the expected ending char not occur until end of string

2018-05-18 Thread Min
New submission from Min : Firstly, I wrote something like this: patn = r"\bROW\s*\((\d+|\*)\)(.|\s)*?\)" newlines = re.sub(patn, "\nY\n", newlines) but if the file(or string) ended without the expected ")" the code deadlock there, no