AWS Thinkbox Discussion Forums

uuid.py

Minor note, while going through the changes in deadline, i noticed that the uuid file in the release version might have a bug. Im not sure if it does, but it seems to.

Its not importing the os library when it already uses it:

try:
    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.
    if os.name not in ['nt', 'ce']:
        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

    # The uuid_generate_* functions are broken on MacOS X 10.5, as noted
    # in issue #8621 the function generates the same sequence of values
    # in the parent process and all children created using fork (unless
    # those children use exec as well).
    #
    # Assume that the uuid_generate functions are broken from 10.5 onward,
    # the test can be adjusted when a later version is fixed.
    import sys
    if sys.platform == 'darwin':
        import os

Interesting, seems to be a bug in python 2.6.7. I checked in python 2.7.6 (the version we’ll be shipping with 7.0) and it is indeed fixed in there.

Was this affecting you guys at all, or did you just happen to notice it?

I just noticed it, completely random.
We had our own fix (before it was in the official deadline build) for the python uuid import crash issue which was working, so when i saw the files are different, i did a quick diff.

Privacy | Site terms | Cookie preferences