Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(124288)

#11063: uuid.py module import has heavy side effects

Can't Edit
Can't Publish+Mail
Start Review
Created:
8 years ago by keith.dart
Modified:
2 years, 7 months ago
Reviewers:
aixtools
CC:
Nick Coghlan, orsenthil, keith_dartworks.biz, AntoinePitrou, haypo, christian.heimes, ned.deily, eric.araujo, Arfrever, r.david.murray, inada.naoki, skrah, nvetoshkin, lukasz.langa, knny.myer_gmail.com, nailor, keith.dart_gmail.com, berkerpeksag, hynek, Martin Panter, storchaka, Michael.Felt, aixtools_gmail.com
Visibility:
Public.

Patch Set 1 #

Patch Set 2 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Lib/test/test_uuid.py View 1 1 chunk +1 line, -0 lines 0 comments Download
Lib/uuid.py View 1 5 chunks +78 lines, -50 lines 3 comments Download

Messages

Total messages: 1
aixtools_gmail.com
2 years, 7 months ago #1
Did some research, and as far as the current ctypes.util.find_library
implementation is concerned

ctypes.util.find_library("uuid") and ctypes.util.find_library("c")

always return None - so the return value of cdll(...) is the value of
dlopen(NULL) aka the python executable.

https://bugs.python.org/review/11063/diff/7465/Lib/uuid.py
File Lib/uuid.py (left):

https://bugs.python.org/review/11063/diff/7465/Lib/uuid.py#oldcode463
Lib/uuid.py:463: def _unixdll_getnode():
reminder: the _uuid_generate() calls below do not function on AIX - better,
unsure of return value as nothing gets resolved.

https://bugs.python.org/review/11063/diff/7465/Lib/uuid.py
File Lib/uuid.py (right):

https://bugs.python.org/review/11063/diff/7465/Lib/uuid.py#newcode431
Lib/uuid.py:431: # Linux and FreeBSD, and provided by libc on Mac OS X.
FYI: I have checked, libuuid is not on AIX (by default), and uuid_generate_* are
in libc

FYI: the current implementation of find_library("c") always returns 'None' on
AIX - so it seems that verifying that find_library() is not None would be better
than just assigning "python" to _ctypes_lib

https://bugs.python.org/review/11063/diff/7465/Lib/uuid.py#newcode459
Lib/uuid.py:459: def _uuid_create():
Maybe clear to you that is is for windows only, but on first read I thought this
was for multiple platforms. Perhaps a function name, or moved elsewhere, to be
clear it is Windows only.
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+