Skip to content

relocate broken with python 3.12.8 #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nyanloutre opened this issue Jan 9, 2025 · 1 comment · Fixed by #38
Closed

relocate broken with python 3.12.8 #37

nyanloutre opened this issue Jan 9, 2025 · 1 comment · Fixed by #38

Comments

@nyanloutre
Copy link
Contributor

nyanloutre commented Jan 9, 2025

The CVE-2024-9287 fix included in python 3.12.8 is breaking the relocate feature.

python 3.12.6 activation script:

# on Windows, a path can contain colons and backslashes and has to be converted:
if [ "${OSTYPE:-}" = "cygwin" ] || [ "${OSTYPE:-}" = "msys" ] ; then
    # transform D:\path\to\venv to /d/path/to/venv on MSYS
    # and to /cygdrive/d/path/to/venv on Cygwin
    export VIRTUAL_ENV=$(cygpath "/tmp/tmp.INbM468TTf")
else
    # use the path as-is
    export VIRTUAL_ENV="/tmp/tmp.INbM468TTf"
fi

python 3.12.8 activation script:

# on Windows, a path can contain colons and backslashes and has to be converted:
if [ "${OSTYPE:-}" = "cygwin" ] || [ "${OSTYPE:-}" = "msys" ] ; then
    # transform D:\path\to\venv to /d/path/to/venv on MSYS
    # and to /cygdrive/d/path/to/venv on Cygwin
    export VIRTUAL_ENV=$(cygpath /tmp/tmp.INbM468TTf)
else
    # use the path as-is
    export VIRTUAL_ENV=/tmp/tmp.INbM468TTf
fi

The quotes are gone and seems to break the regex.
The regex will now match $(cygpath /tmp/tmp.INbM468TTf) instead of /tmp/tmp.INbM468TTf because it does not contains quotes anymore.

The upstream patch:
python/cpython#126185

The upstream issue:
python/cpython#124651

@kevinconway
Copy link
Owner

Thanks again for the pull request! Your patch should now be available as version 0.10.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants