Message317013
Firstly, I wrote something like this:
patn = r"\bROW\s*\((\d+|\*)\)(.|\s)*?\)"
newlines = re.sub(patn, "\nYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY\n", newlines)
but if the file(or string) ended without the expected ")" the code deadlock there, no progress, no exception, and no exit.
Then I changed it to :
patn = r"\bROW\s*\((\d+|\*)\)(.|\s)*?(\)|$)"
newlines = re.sub(patn, "\nYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY\n", newlines) to enforce the rule of end of file. then everything ok.
I felt this is a but, coz RE should not die, it should exit if can't match.
it is Py3.5 on ubuntu. Thanks! |
|
Date |
User |
Action |
Args |
2018-05-18 08:06:05 | mamamiaibm | set | recipients:
+ mamamiaibm |
2018-05-18 08:06:05 | mamamiaibm | set | messageid: <1526630765.64.0.682650639539.issue33566@psf.upfronthosting.co.za> |
2018-05-18 08:06:05 | mamamiaibm | link | issue33566 messages |
2018-05-18 08:06:05 | mamamiaibm | create | |
|