Skip to content

gh-149879: Fix test_venv on Cygwin - #150426

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

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

Conversation

@vstinner

@vstinnervstinner commented May 25, 2026

Copy link
Copy Markdown
Member

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.
@bedevere-appbedevere-appBot mentioned this pull request May 25, 2026
@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 ownersMay 25, 2026 20:39
@vstinner

Copy link
Copy Markdown
MemberAuthor

@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:

ifos.name=='nt':
use_symlinks=Falseelse:
use_symlinks=Truegroup=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
MemberAuthor

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

@vstinner

Copy link
Copy Markdown
MemberAuthor

With this change, venv cannot be used in copy mode: running the venv python programs fails to locate the libpython DLL.

I wrote a different approach, copy the libpython DLL in the venv: PR gh-150483.

@vstinner
vstinner deleted the venv_cygwin branch July 10, 2026 20:16
Sign up for freeto 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

@vstinner