[issue41605] t = re.sub(".*", "*", src) has different ouput

2020-08-21 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka resolution: -> not a bug stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue41605] t = re.sub(".*", "*", src) has different ouput

2020-08-21 Thread Thomas Grainger
Thomas Grainger added the comment: seems like a dupe? https://bugs.python.org/issue32308 -- keywords: +patch message_count: 3.0 -> 4.0 nosy: +graingert nosy_count: 5.0 -> 6.0 pull_requests: +21050 stage: -> patch review pull_request: https://github.com/python/cpython/pull/4846

[issue41605] t = re.sub(".*", "*", src) has different ouput

2020-08-21 Thread Ronald Oussoren
Ronald Oussoren added the comment: in 3.6 t == '*', in 3.7 and later it is '**'. To be honest I don't like the 3.7 behaviour, it is very surprising even if it is technically correct (the first '*' is from a match from the entire string, the second one is from an empty match at the end of

[issue41605] t = re.sub(".*", "*", src) has different ouput

2020-08-21 Thread Eric V. Smith
Eric V. Smith added the comment: I'm suspicious that this differs per-OS. Please provide exact Python version information for each OS you list in your initial report. I suspect what you're seeing is related to this change: Changed in version 3.7: Empty matches for the pattern are replaced

[issue41605] t = re.sub(".*", "*", src) has different ouput

2020-08-20 Thread soyoo
New submission from soyoo : import re src = "123" # can be anything t = re.sub(".*", "*", src) """ The output of 't' is different in python2 and python3; When python version is python3, it's depend on OS version. When python version is python2, it seem always output single '*'. When python