Roundup Robot added the comment:
New changeset 1df7a0821c73 by Steve Dower in branch '3.5':
Issue #24634: Importing uuid should not try to load libc on Windows
https://hg.python.org/cpython/rev/1df7a0821c73
--
nosy: +python-dev
___
Python tracker
Roundup Robot added the comment:
New changeset 90e2747425ad by Steve Dower in branch '2.7':
Issue #24634: Importing uuid should not try to load libc on Windows
https://hg.python.org/cpython/rev/90e2747425ad
--
___
Python tracker
Steve Dower added the comment:
Done for 2.7, 3.5 and 3.6. Decided against touching 3.4 because it's not really
an issue with MSVC 10.0, just 9.0 and 14.0. And I used eryksun's suggested
approach.
--
resolution: - fixed
stage: - resolved
status: open - closed
New submission from Steve Dower:
Lib/uuid.py includes the following code that runs on import:
import ctypes, ctypes.util
# The uuid_generate_* routines are provided by libuuid on at least
# Linux and FreeBSD, and provided by libc on Mac OS X.
for libname in ['uuid', 'c']:
Steve Dower added the comment:
Patch is against Python 3.5, but uuid.py is identical in all versions and the
change should be applied to all four branches.
--
keywords: +patch
Added file: http://bugs.python.org/file39927/24634_1.patch
___
Python
eryksun added the comment:
This code can cause issues on Windows
What's the issue or issues here? For 2.7, Windows won't be able to find
msvcr90.dll without an activation context, but that's just an
ERROR_MOD_NOT_FOUND OS error. It should be ignored by the try/except block. For
3.4, it
eryksun added the comment:
That would break anyone else who's manually managing their own
activation context around ctypes.
Since this can't be made to work automatically, I prefer your suggestion to
continue checking for uuid.dll. You could just do something like the following:
eryksun added the comment:
Actually, it finds the DLL fine and the DLL terminates the entire
process when it fails to detect an activation context.
OK, in that case it finds msvcr90.dll via PATH. I was only thinking of the DLL
being installed in a subdirectory of the system WinSxS
Steve Dower added the comment:
For 2.7, Windows won't be able to find msvcr90.dll without an activation
context, but that's just an ERROR_MOD_NOT_FOUND OS error.
Actually, it finds the DLL fine and the DLL terminates the entire process when
it fails to detect an activation context. There's
Steve Dower added the comment:
ctypes could activate this context before calling LoadLibrary.
That would break anyone else who's manually managing their own activation
context around ctypes. At best we could expose functions to enable Python's
activation context (which I'm willing to help
10 matches
Mail list logo