Skip to content

gh-149879: Fix test_venv on Cygwin#150426

Open
vstinner wants to merge 1 commit into
python:mainfrom
vstinner:venv_cygwin
Open

gh-149879: Fix test_venv on Cygwin#150426
vstinner wants to merge 1 commit into
python:mainfrom
vstinner:venv_cygwin

Conversation

@vstinner
Copy link
Copy Markdown
Member

@vstinner vstinner commented May 25, 2026

venv now uses symlinks by default on Cygwin.

Fix test_zippath_from_non_installed_posix(): copy also the cygpython DLL.

venv now uses symlinks by default on Cygwin.

Fix test_zippath_from_non_installed_posix(): copy also the cygpython
DLL.
@vstinner vstinner marked this pull request as ready for review May 25, 2026 20:39
@vstinner vstinner requested review from FFY00 and vsajip as code owners May 25, 2026 20:39
@vstinner
Copy link
Copy Markdown
Member Author

@vsajip @FFY00: Are you ok with this change? It uses symlinks by default on Cygwin when using the Python API (venv module). The python -m venv command line interface already uses symlinks by default on Unix:

    if os.name == 'nt':
        use_symlinks = False
    else:
        use_symlinks = True
    group = parser.add_mutually_exclusive_group()
    group.add_argument('--symlinks', default=use_symlinks,
                       action='store_true', dest='symlinks',
                       help='Try to use symlinks rather than copies, '
                            'when symlinks are not the default for '
                            'the platform.')

@vstinner
Copy link
Copy Markdown
Member Author

venv created with --copies doesn't work on Cygwin:

vstinner@win ~/cpython
$ ./python.exe -m venv ../env --without-pip --copies

vstinner@win ~/cpython
$ cd ../

vstinner@win ~
$ env/bin/python.exe -V
C:/cygwin64/home/vstinner/env/bin/python.exe: error while loading shared libraries: cygpython3.16d.dll: cannot open shared object file: No such file or directory

venv created with symlinks just works well:

vstinner@win ~/cpython
$ ./python.exe -m venv ../env --without-pip

vstinner@win ~/cpython
$ cd ..

vstinner@win ~
$ env/bin/python.exe -V
Python 3.16.0a0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant