The regex at
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) |
is likely incorrect:
- It does not handle the common case where the generated console script is named
xxx-script.py
- Yet on the other hand, since for wheels there are no -script.py generated on Windows (only an exe), checking for pyw is actually useless IMHO
FWIW, the regex is the same as in distlib here:
https://bitbucket.org/pypa/distlib/src/6ada86eea2700f10edcd81f831139c6ae20edb74/distlib/scripts.py?at=default&fileviewer=file-view-default#scripts.py-55
The bug was found by @dstufft through pallets/click#365