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 CiaranWelsh
Recipients CiaranWelsh, docs@python
Date 2021-09-20.12:27:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1632140847.01.0.509914617617.issue45248@roundup.psfhosted.org>
In-reply-to
Content
The example on https://docs.python.org/3/library/copyreg.html does not work: 

```
        import copyreg, copy, pickle
        class C:
            def __init__(self, a):
                self.a = a
    
        def pickle_c(c):
            print("pickling a C instance...")
            return C, (c.a,)
    
        copyreg.pickle(C, pickle_c)
        c = C(1)
        d = copy.copy(c)
    
>       p = pickle.dumps(c)
E       AttributeError: Can't pickle local object 'RoadRunnerPickleTests.test_ex.<locals>.C'

picklable_swig_tests.py:133: AttributeError
```
History
Date User Action Args
2021-09-20 12:27:27CiaranWelshsetrecipients: + CiaranWelsh, docs@python
2021-09-20 12:27:27CiaranWelshsetmessageid: <1632140847.01.0.509914617617.issue45248@roundup.psfhosted.org>
2021-09-20 12:27:26CiaranWelshlinkissue45248 messages
2021-09-20 12:27:26CiaranWelshcreate