Title: lib2to3.pgen2.parse.ParseError is not roundtrip pickleable
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.8, Python 3.7
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Anthony Sottile, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2018-11-26 04:03 by Anthony Sottile, last changed 2020-03-16 17:50 by Anthony Sottile. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 10710 merged Anthony Sottile, 2018-11-26 04:09
Messages (3)
msg330404 - (view) Author: Anthony Sottile (Anthony Sottile) * Date: 2018-11-26 04:03
related to

encountered here:

minimal reproduction:

class TestPickleableException(unittest.TestCase):
    def test_ParseError(self):
        err = ParseError('msg', 2, None, (1, 'context'))
        err2 = pickle.loads(pickle.dumps(err))
        self.assertEqual(vars(err), vars(err2))

ERROR: test_ParseError (lib2to3.tests.test_parser.TestPickleableException)
Traceback (most recent call last):
  File "/home/asottile/workspace/cpython/Lib/lib2to3/tests/", line 628, in test_ParseError
    err2 = pickle.loads(pickle.dumps(err))
TypeError: __init__() missing 3 required positional arguments: 'type', 'value', and 'context'
msg330547 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-11-27 18:39
New changeset c57e6e2e52d5d8b4005753bed789d99ebe407fb6 by Serhiy Storchaka (Anthony Sottile) in branch 'master':
bpo-35312: Make lib2to3.pgen2.parse.ParseError round-trip pickle-able. (GH-10710)
msg332955 - (view) Author: Anthony Sottile (Anthony Sottile) * Date: 2019-01-04 01:02
Looks like this was merged and can be marked as resolved -- should this be backported to 3.7?
Date User Action Args
2020-03-16 17:50:10Anthony Sottilesetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-01-04 01:02:14Anthony Sottilesetmessages: + msg332955
2018-11-27 18:39:53serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg330547
2018-11-26 04:09:35Anthony Sottilesetkeywords: + patch
stage: patch review
pull_requests: + pull_request9960
2018-11-26 04:06:05Anthony Sottilesettitle: lib2to3.pgen2.parser.ParseError is not roundtrip pickleable -> lib2to3.pgen2.parse.ParseError is not roundtrip pickleable
2018-11-26 04:03:58Anthony Sottilecreate