FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-149879: Fix test_venv on Cygwin by vstinner · Pull Request #150483 · python/cpython · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
7 changes: 7 additions & 0 deletions Lib/test/test_venv.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ def test_executable_symlinks(self):

# gh-124651: test quoted strings
@unittest.skipIf(os.name == 'nt', 'contains invalid characters on Windows')
@unittest.skipIf(sys.platform == 'cygwin', 'fail to locate cygpython DLL')
def test_special_chars_bash(self):
"""
Test that the template strings are quoted properly (bash)
Expand Down Expand Up @@ -714,6 +715,12 @@ def test_zippath_from_non_installed_posix(self):
os.mkdir(bindir)
python_exe = os.path.basename(sys.executable)
shutil.copy2(sys.executable, os.path.join(bindir, python_exe))
if sys.platform == 'cygwin':
# Copy libpython DLL
exe_path = os.path.dirname(sys.executable)
libpython_dll = sysconfig.get_config_var('DLLLIBRARY')
shutil.copy2(os.path.join(exe_path, libpython_dll),
os.path.join(bindir, libpython_dll))
libdir = os.path.join(non_installed_dir, platlibdir, self.lib[1])
os.makedirs(libdir)
landmark = os.path.join(libdir, "os.py")
Expand Down
8 changes: 8 additions & 0 deletions Lib/venv/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,14 @@ def setup_python(self, context):
if not os.path.islink(path):
os.chmod(path, 0o755)

if not self.symlinks and sys.platform == 'cygwin':
# Copy libpython DLL
libpython_dll = sysconfig.get_config_var('DLLLIBRARY')
if not os.path.exists(os.path.join(binpath, libpython_dll)):
exe_path = os.path.dirname(sys.executable)
shutil.copy(os.path.join(exe_path, libpython_dll),
os.path.join(binpath, libpython_dll))

else:
def setup_python(self, context):
"""
Expand Down
Loading

Back | FazBrowse Home | New Git URL