classification
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
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: brian.curtin, jason.coombs
Priority: normal Keywords: patch

Created on 2010-04-08 01:21 by jason.coombs, last changed 2010-04-08 01:51 by jason.coombs. This issue is now closed.

Files
File name Uploaded Description Edit
reproduction as test.patch jason.coombs, 2010-04-08 01:25
Messages (4)
msg102584 - (view) Author: Jason R. Coombs (jason.coombs) * (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 (jason.coombs) * (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 (jason.coombs) * (Python committer) Date: 2010-04-08 01:51
Thanks!
History
Date User Action Args
2010-04-08 01:51:05jason.coombssetmessages: + msg102588
2010-04-08 01:29:50brian.curtinsetstatus: open -> closed

nosy: + brian.curtin
messages: + msg102586

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