Title: `_pickle.PicklingError` on 3.14.0a1+ where it didn't before due to the start method change from fork to forkserver · Issue #125714 · python/cpython · GitHub
Open Graph Title: `_pickle.PicklingError` on 3.14.0a1+ where it didn't before due to the start method change from fork to forkserver · Issue #125714 · python/cpython
X Title: `_pickle.PicklingError` on 3.14.0a1+ where it didn't before due to the start method change from fork to forkserver · Issue #125714 · python/cpython
Description: Bug report Bug description: Code dating back to Python 2 had to do super(OwnClassName, self) instead of super(). Modules designed to be reloadable could not use the super(OwnClassName, self) syntax in their non-constructor method, as Own...
Open Graph Description: Bug report Bug description: Code dating back to Python 2 had to do super(OwnClassName, self) instead of super(). Modules designed to be reloadable could not use the super(OwnClassName, self) syntax...
X Description: Bug report Bug description: Code dating back to Python 2 had to do super(OwnClassName, self) instead of super(). Modules designed to be reloadable could not use the super(OwnClassName, self) syntax...
Opengraph URL: https://github.com/python/cpython/issues/125714
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`_pickle.PicklingError` on 3.14.0a1+ where it didn't before due to the start method change from fork to forkserver","articleBody":"# Bug report\n\n### Bug description:\n\nCode dating back to Python 2 had to do `super(OwnClassName, self)` instead of `super()`. Modules designed to be reloadable could not use the `super(OwnClassName, self)` syntax in their non-constructor method, as `OwnClassName` was re-binded to the class of the new module, rather than the class that had the name when the object was constructed (which differs when the object was constructed before a reload). Therefore, such modules defined classes like this:\n\n```python\nclass Subclass(Superclass):\n def __init__(self):\n self.__parent = super(Subclass, self)\n\n def method1(self, arg):\n self.__parent.method1(arg + 2)\n```\n\nPython 3.14.0a1+ breaks existing code using this trick on subclasses of `multiprocessing.Process`.\n\nFor example:\n\n```python\nimport multiprocessing\n\nclass MyProcess(multiprocessing.Process):\n def __init__(self, target=None, args=(), kwargs={}):\n self.__parent = super(MyProcess, self)\n self.__parent.__init__(target=target, args=args, kwargs=kwargs)\n\n def run(self):\n self.__parent.run()\n \nif __name__ == \"__main__\":\n p = MyProcess()\n p.start()\n```\n\nworked fine on previous versions, but now errors with:\n\n```\nTraceback (most recent call last):\n File \"/home/dev-irc/Limnoria/repro.py\", line 12, in \u003cmodule\u003e\n p.start()\n ~~~~~~~^^\n File \"/home/dev-irc/.local-py-git/lib/python3.14/multiprocessing/process.py\", line 121, in start\n self._popen = self._Popen(self)\n ~~~~~~~~~~~^^^^^^\n File \"/home/dev-irc/.local-py-git/lib/python3.14/multiprocessing/context.py\", line 224, in _Popen\n return _default_context.get_context().Process._Popen(process_obj)\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^\n File \"/home/dev-irc/.local-py-git/lib/python3.14/multiprocessing/context.py\", line 300, in _Popen\n return Popen(process_obj)\n File \"/home/dev-irc/.local-py-git/lib/python3.14/multiprocessing/popen_forkserver.py\", line 35, in __init__\n super().__init__(process_obj)\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^\n File \"/home/dev-irc/.local-py-git/lib/python3.14/multiprocessing/popen_fork.py\", line 20, in __init__\n self._launch(process_obj)\n ~~~~~~~~~~~~^^^^^^^^^^^^^\n File \"/home/dev-irc/.local-py-git/lib/python3.14/multiprocessing/popen_forkserver.py\", line 47, in _launch\n reduction.dump(process_obj, buf)\n ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^\n File \"/home/dev-irc/.local-py-git/lib/python3.14/multiprocessing/reduction.py\", line 60, in dump\n ForkingPickler(file, protocol).dump(obj)\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^\n_pickle.PicklingError: first argument to __newobj__() must be \u003cclass 'super'\u003e, not \u003cclass '__main__.MyProcess'\u003e\nwhen serializing super object\nwhen serializing dict item '_MyProcess__parent'\nwhen serializing MyProcess state\nwhen serializing MyProcess object\n```\n\nFull version string: `Python 3.14.0a1+ (heads/main:c8fd4b12e3d, Oct 18 2024, 22:51:39) [GCC 12.2.0] on linux`\n\n### CPython versions tested on:\n\n3.14, CPython main branch\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-125750\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/progval","@type":"Person","name":"progval"},"datePublished":"2024-10-18T21:20:28.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":11},"url":"https://github.com/125714/cpython/issues/125714"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3723ade3-7fd7-dd0f-58f4-ef382a8aa8cf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 85F0:38750A:A107E:E263A:6A532AB5 |
| html-safe-nonce | bb9e16a650fa8281c326034aa5c4f5536819cdfd5055b4a40c38918031e89162 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NUYwOjM4NzUwQTpBMTA3RTpFMjYzQTo2QTUzMkFCNSIsInZpc2l0b3JfaWQiOiI3MTkwNjI2ODk1NzYzMDI0NTY1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f2e899b52fb359a6c3b86513a3e5a41a09d05f2198000dad201077632ff52634 |
| hovercard-subject-tag | issue:2598405041 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/125714/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c682fb46fa8799d3bc018cf4130a5957ccac53a86ad1c4ad1a5188dfb9c48f0b/python/cpython/issues/125714 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c682fb46fa8799d3bc018cf4130a5957ccac53a86ad1c4ad1a5188dfb9c48f0b/python/cpython/issues/125714 |
| og:image:alt | Bug report Bug description: Code dating back to Python 2 had to do super(OwnClassName, self) instead of super(). Modules designed to be reloadable could not use the super(OwnClassName, self) syntax... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | progval |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width