This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients Ian Norton, eryksun, miss-islington, mitchhentges, n_rosenstein, paul.moore, steve.dower, tim.golden, vinay.sajip, zach.ware
Date 2021-12-11.03:21:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1639192885.21.0.319526541302.issue43749@roundup.psfhosted.org>
In-reply-to
Content
The code to copy a file could be rewritten to use a regex match. For example:

            # Copy src to dst. If src is a base executable, copy a launcher.
            dirname, filename = os.path.split(src)
            m = re.match(r'(pythonw?)[0-9._]*((?:_d)?(?:\.exe|\.pdb))$',
                    filename.lower())
            if m is not None:
                src = os.path.join(os.path.dirname(__file__),
                        'scripts', 'nt', m.group(1) + m.group(2))
                # If the base environment is a Python source build, use
                # the launcher in the build directory instead of
                # "Lib/venv/scripts/nt".
                if sysconfig.is_python_build(True) or not os.path.isfile(src):
                    basename = ('venvlauncher' if m.group(1) == 'python' else
                                'venvwlauncher')
                    src = os.path.join(dirname, basename + m.group(2))
History
Date User Action Args
2021-12-11 03:21:25eryksunsetrecipients: + eryksun, paul.moore, vinay.sajip, tim.golden, zach.ware, steve.dower, miss-islington, n_rosenstein, Ian Norton, mitchhentges
2021-12-11 03:21:25eryksunsetmessageid: <1639192885.21.0.319526541302.issue43749@roundup.psfhosted.org>
2021-12-11 03:21:25eryksunlinkissue43749 messages
2021-12-11 03:21:25eryksuncreate