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 <1375805622.66.0.310299802378.issue17213@psf.upfronthosting.co.za>
In-reply-to
Content
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:

https://projects.blender.org/tracker/index.php?func=detail&aid=27666
http://forums.boxee.tv/showthread.php?t=15425

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']:
        try:
            lib = ctypes.CDLL(ctypes.util.find_library(libname))
        except:
            continue
        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 os.name 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 os.name 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.
History
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: <1375805622.66.0.310299802378.issue17213@psf.upfronthosting.co.za>
2013-08-06 16:13:42Igor.Skochinskylinkissue17213 messages
2013-08-06 16:13:41Igor.Skochinskycreate