[New-bugs-announce] [issue15307] Patch for --symlink support in pyvenv with framework python
Ronald Oussoren
report at bugs.python.org
Mon Jul 9 17:13:41 CEST 2012
New submission from Ronald Oussoren <ronaldoussoren at mac.com>:
The attached patch ensures that "python3.3 -mvenv --symlinks myenv" works with framework builds.
There are two functional changes:
1) don't call 'realpath' in pythonw.c because realpath resolves
symlinks and that breaks the '--symlinks' options because the
python command is a symlink with that option (and resolving that
gives the path to the python executable in the framework)
2) Look for the __PYVENV_LAUNCHER__ environment variable in
Modules/getpath.c and use that in preference on the already
calculated value of argv0_path. That code is only active for
framework builds
I'm not happy with the following line in this patch:
+ wcsncpy(argv0_path, (wchar_t*)pyvenv_launcher, MAXPATHLEN);
That mirrors a similar cast of the result of NSLibraryNameForModule earlier in Modules/getpath.c, but in both cases the input stream is a narrow character string ("char", not "wchar_t") and wcsncpy expects a "wchar_t". The the cast seems to paper over a real problem here.
Shouldn't both lines use "_Py_char2wchar" to convert the char* buffer to a wchar_t* one?
----------
assignee: ronaldoussoren
components: Library (Lib), Macintosh
files: venv-symlinks.txt
keywords: needs review, patch
messages: 165087
nosy: ronaldoussoren
priority: normal
severity: normal
status: open
title: Patch for --symlink support in pyvenv with framework python
versions: Python 3.3
Added file: http://bugs.python.org/file26332/venv-symlinks.txt
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15307>
_______________________________________
More information about the New-bugs-announce
mailing list