Message299665
This line in copyreg._slotnames does not properly calculate mangled attribute names: https://github.com/python/cpython/blob/v3.6.2/Lib/copyreg.py#L131 The problem is that it does not strip leading underscores from the class name: >>> class _LeadingUnderscoreClassName(object): ... __slots__ = ("__bar",) ... >>> import copy_reg >>> copy_reg._slotnames(_LeadingUnderscoreClassName) ['__LeadingUnderscoreClassName__bar'] The result is that copy, pickle, and anything else that relies on _slotnames() do not work on classes with leading underscores and private __slots__. This bug is present in all versions of Python. | |
| Date | User | Action | Args | | 2017-08-02 18:53:14 | ShaneHarvey | set | recipients: + ShaneHarvey | | 2017-08-02 18:53:14 | ShaneHarvey | set | messageid: <1501699994.79.0.0201468057837.issue31107@psf.upfronthosting.co.za> | | 2017-08-02 18:53:14 | ShaneHarvey | link | issue31107 messages | | 2017-08-02 18:53:14 | ShaneHarvey | create | | |