bpo-31107: Fix copyreg mangled slot names calculation.#2989
bpo-31107: Fix copyreg mangled slot names calculation.#2989serhiy-storchaka merged 3 commits intopython:masterfrom
Conversation
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. Thanks again to your contribution and we look forward to looking at it! |
Lib/copyreg.py
Outdated
| # mangled names | ||
| elif name.startswith('__') and not name.endswith('__'): | ||
| names.append('_%s%s' % (c.__name__, name)) | ||
| names.append('_%s%s' % (c.__name__.lstrip('_'), name)) |
There was a problem hiding this comment.
The name shouldn't be mangled if c.__name__.lstrip('_') is an empty string.
There was a problem hiding this comment.
Nice catch, I wasn't aware of that case.
|
Please add a NEWS entry. |
Lib/copyreg.py
Outdated
| # mangled names | ||
| elif name.startswith('__') and not name.endswith('__'): | ||
| names.append('_%s%s' % (c.__name__, name)) | ||
| names.append('_%s%s' % (c.__name__.lstrip('_'), name)) |
There was a problem hiding this comment.
Nice catch, I wasn't aware of that case.
serhiy-storchaka
left a comment
There was a problem hiding this comment.
LGTM.
Please sign the PSF contributor agreement and add your name into Misc/ACKS.
|
Thanks for the review @serhiy-storchaka. I signed the PSF contributor agreement yesterday and my GitHub is linked to my bugs.python.org account. Does it take some time for @the-knights-who-say-ni to notice? |
|
Usually it takes a one working day (as in this case). |
|
Thank you for your contribution @ShaneHarvey! Do you mind to backport these changes to 3.6 and 2.7? |
|
Sure I can backport it to those branches. |
|
GH-3003 is a backport of this pull request to the 3.6 branch. |
|
GH-3004 is a backport of this pull request to the 2.7 branch. |
https://bugs.python.org/issue31107
https://bugs.python.org/issue31107