This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author cindykrafft
Recipients cindykrafft
Date 2015-01-28.06:02:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1422424947.14.0.409463431872.issue23336@psf.upfronthosting.co.za>
In-reply-to
Content
The tp_name field in thread.LockType is set as "thread.lock". This is incorrect and conflicts with the value set in dummy_thread.

Python 2.7.6 (default, Sep  9 2014, 15:04:36) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import thread
>>> import dummy_thread
>>> thread.LockType.__name__
'lock'
>>> dummy_thread.LockType.__name__
'LockType'

Code which depends on the ability to look up a class based on module and name (see the following code taken from pickle.py) breaks due to this behavior, so my preferred fix would be to change tp_name to a value consistent with dummy_thread.

try:
    __import__(module)
    mod = sys.modules[module]
    klass = getattr(mod, name)
except (ImportError, KeyError, AttributeError):
    raise PicklingError(
        "Can't pickle %r: it's not found as %s.%s" %
         (obj, module, name))

Happy to submit a patch if someone could confirm.
History
Date User Action Args
2015-01-28 06:02:27cindykrafftsetrecipients: + cindykrafft
2015-01-28 06:02:27cindykrafftsetmessageid: <1422424947.14.0.409463431872.issue23336@psf.upfronthosting.co.za>
2015-01-28 06:02:27cindykrafftlinkissue23336 messages
2015-01-28 06:02:26cindykrafftcreate