classification
Title: lib2to3.pgen2.parse.ParseError is not roundtrip pickleable
Type: Stage: patch review
Components: Library (Lib) Versions: Python 3.8, Python 3.7
process
Status: open Resolution:
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 2019-01-04 01:02 by Anthony Sottile.

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 https://bugs.python.org/issue35311

encountered here: https://gitlab.com/pycqa/flake8/issues/473

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/test_parser.py", 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)
https://github.com/python/cpython/commit/c57e6e2e52d5d8b4005753bed789d99ebe407fb6
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?
History
Date User Action Args
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