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.

Title: Python fails to run if launched from NTFS symlink and DLL not in PATH
Type: Stage:
Components: Tests, Windows Versions: Python 3.1, Python 3.2
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: brian.curtin, jaraco
Priority: normal Keywords: patch

Created on 2010-04-08 01:21 by jaraco, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
reproduction as test.patch jaraco, 2010-04-08 01:25
Messages (4)
msg102584 - (view) Author: Jason R. Coombs (jaraco) * (Python committer) Date: 2010-04-08 01:21
While trying to work out a failing test_platform.PlatformTest.test_architecture_via_symlink, I found a more fundamental problem.

In the build environment, python.exe depends on pythonXX.dll being in the same directory as sys.executable to load the interpreter. If Python is launched from an NTFS symlink, sys.executable may be located in a directory other than the DLL, and the interpreter fails to run (returning exit code 0xC0000135).

This may be expected behavior, but it causes test_architecture_via_symlink to fail once Python becomes aware of symlinks in Windows (sans cygwin).

It took me a while to track this down, so I wanted to be sure to document the behavior.
msg102585 - (view) Author: Jason R. Coombs (jaraco) * (Python committer) Date: 2010-04-08 01:25
This attached patch against the py3k branch adds a test that reproduces the described behavior.
msg102586 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2010-04-08 01:29
I have this fixed locally in a version of your os.symlink patch. The solution is to add the directory sys.executable is from to os.environ["Path"], then that test should pass the custom environment when the subprocess is created. I meant to update you on the patch I was almost ready to check-in -- I'll send it in private.

Overall, I don't believe there is an issue here so I'll close this.
msg102588 - (view) Author: Jason R. Coombs (jaraco) * (Python committer) Date: 2010-04-08 01:51
Date User Action Args
2022-04-11 14:56:59adminsetgithub: 52589
2010-04-08 01:51:05jaracosetmessages: + msg102588
2010-04-08 01:29:50brian.curtinsetstatus: open -> closed

nosy: + brian.curtin
messages: + msg102586

resolution: not a bug
2010-04-08 01:25:41jaracosetfiles: + reproduction as test.patch
keywords: + patch
messages: + msg102585
2010-04-08 01:21:34jaracocreate