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

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

Can't Edit
Can't Publish+Mail
Start Review
8 years, 2 months ago by keith.dart
2 years, 9 months ago
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

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


Total messages: 1
2 years, 9 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.

File Lib/uuid.py (left):

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.

File Lib/uuid.py (right):

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

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+