Author Igor.Skochinsky
Recipients Igor.Skochinsky, amaury.forgeotdarc, belopolsky, dancol, ezio.melotti, meador.inge
Date 2013-08-06.16:13:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Just had this issue when using networkx (which imports uuid). One keyword that would help visibility is R6034 (the runtime error number). A couple of reports related to this:

The proper solution is to fix ctypes, but in the meantime we can at least fix uuid. The error seems to be triggered by this snippet:

    # 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']:
            lib = ctypes.CDLL(ctypes.util.find_library(libname))
        if hasattr(lib, 'uuid_generate_random'):
            _uuid_generate_random = lib.uuid_generate_random
        if hasattr(lib, 'uuid_generate_time'):
            _uuid_generate_time = lib.uuid_generate_time

Since this code is useless on Windows, protecting it in "if not in ['nt', 'ce']" does the trick.

BTW, instead of going all way with activation context etc., a simpler solution would be to add to ctypes something like this in CDLL.__init__:

if in ['nt', 'ce'] and name == util.find_msvcrt():  # TODO: handle the extension
  self._handle = windll.kernel32.GetModuleHandleA(self._name)

i.e. use the already present runtime DLL instead of trying to load it again.
Date User Action Args
2013-08-06 16:13:42Igor.Skochinskysetrecipients: + Igor.Skochinsky, amaury.forgeotdarc, belopolsky, ezio.melotti, meador.inge, dancol
2013-08-06 16:13:42Igor.Skochinskysetmessageid: <>
2013-08-06 16:13:42Igor.Skochinskylinkissue17213 messages
2013-08-06 16:13:41Igor.Skochinskycreate