Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'code' object has no attribute 'co_endlinetable' with python 3.11 #514

Closed
Pierre-Sassoulas opened this issue Jun 18, 2022 · 8 comments
Milestone

Comments

@Pierre-Sassoulas
Copy link

Hello, thank you for your work on dill :)

We had a crash when trying to upgrade to python 3.11, with the following stacktrace:

 Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/runner/work/pylint/pylint/pylint/__main__.py", line 10, in <module>
    pylint.run_pylint()
    ^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/pylint/pylint/pylint/__init__.py", line 25, in run_pylint
    PylintRun(argv or sys.argv[1:])
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/pylint/pylint/pylint/lint/run.py", line 204, in __init__
    linter.check(args)
    ^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/pylint/pylint/pylint/lint/pylinter.py", line 654, in check
    check_parallel(
    ^^^^^^^^^^^^^^^
  File "/home/runner/work/pylint/pylint/pylint/lint/parallel.py", line 141, in check_parallel
    jobs, initializer=initializer, initargs=[dill.dumps(linter)]
                                             ^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/pylint/pylint/venv/lib/python3.11/site-packages/dill/_dill.py", line 364, in dumps
    dump(obj, file, protocol, byref, fmode, recurse, **kwds)#, strictio)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/pylint/pylint/venv/lib/python3.11/site-packages/dill/_dill.py", line 336, in dump
    Pickler(file, protocol, **_kwds).dump(obj)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/pylint/pylint/venv/lib/python3.11/site-packages/dill/_dill.py", line 620, in dump
    StockPickler.dump(self, obj)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0-beta.3/x64/lib/python3.11/pickle.py", line 487, in dump
    self.save(obj)
    ^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0-beta.3/x64/lib/python3.11/pickle.py", line 603, in save
    self.save_reduce(obj=obj, *rv)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0-beta.3/x64/lib/python3.11/pickle.py", line 717, in save_reduce
    save(state)
    ^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0-beta.3/x64/lib/python3.11/pickle.py", line 560, in save
    f(self, obj)  # Call unbound method with explicit self
    ^^^^^^^^^^^^
  File "/home/runner/work/pylint/pylint/venv/lib/python3.11/site-packages/dill/_dill.py", line 1251, in save_module_dict
    StockPickler.save_dict(pickler, obj)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0-beta.3/x64/lib/python3.11/pickle.py", line 972, in save_dict
    self._batch_setitems(obj.items())
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0-beta.3/x64/lib/python3.11/pickle.py", line 998, in _batch_setitems
    save(v)
    ^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0-beta.3/x64/lib/python3.11/pickle.py", line 603, in save
    self.save_reduce(obj=obj, *rv)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0-beta.3/x64/lib/python3.11/pickle.py", line 717, in save_reduce
    save(state)
    ^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0-beta.3/x64/lib/python3.11/pickle.py", line 560, in save
    f(self, obj)  # Call unbound method with explicit self
    ^^^^^^^^^^^^
  File "/home/runner/work/pylint/pylint/venv/lib/python3.11/site-packages/dill/_dill.py", line 1251, in save_module_dict
    StockPickler.save_dict(pickler, obj)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0-beta.3/x64/lib/python3.11/pickle.py", line 972, in save_dict
    self._batch_setitems(obj.items())
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0-beta.3/x64/lib/python3.11/pickle.py", line 998, in _batch_setitems
    save(v)
    ^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0-beta.3/x64/lib/python3.11/pickle.py", line 560, in save
    f(self, obj)  # Call unbound method with explicit self
    ^^^^^^^^^^^^
  File "/home/runner/work/pylint/pylint/venv/lib/python3.11/site-packages/dill/_dill.py", line 1251, in save_module_dict
    StockPickler.save_dict(pickler, obj)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0-beta.3/x64/lib/python3.11/pickle.py", line 972, in save_dict
    self._batch_setitems(obj.items())
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0-beta.3/x64/lib/python3.11/pickle.py", line 998, in _batch_setitems
    save(v)
    ^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0-beta.3/x64/lib/python3.11/pickle.py", line 560, in save
    f(self, obj)  # Call unbound method with explicit self
    ^^^^^^^^^^^^
  File "/home/runner/work/pylint/pylint/venv/lib/python3.11/site-packages/dill/_dill.py", line 1251, in save_module_dict
    StockPickler.save_dict(pickler, obj)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0-beta.3/x64/lib/python3.11/pickle.py", line 972, in save_dict
    self._batch_setitems(obj.items())
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0-beta.3/x64/lib/python3.11/pickle.py", line 1003, in _batch_setitems
    save(v)
    ^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0-beta.3/x64/lib/python3.11/pickle.py", line 560, in save
    f(self, obj)  # Call unbound method with explicit self
    ^^^^^^^^^^^^
  File "/home/runner/work/pylint/pylint/venv/lib/python3.11/site-packages/dill/_dill.py", line 1963, in save_function
    _save_with_postproc(pickler, (_create_function, (
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/pylint/pylint/venv/lib/python3.11/site-packages/dill/_dill.py", line 1140, in _save_with_postproc
    pickler.save_reduce(*reduction, obj=obj)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0-beta.3/x64/lib/python3.11/pickle.py", line 692, in save_reduce
    save(args)
    ^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0-beta.3/x64/lib/python3.11/pickle.py", line 560, in save
    f(self, obj)  # Call unbound method with explicit self
    ^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0-beta.3/x64/lib/python3.11/pickle.py", line 902, in save_tuple
    save(element)
    ^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0-beta.3/x64/lib/python3.11/pickle.py", line 560, in save
    f(self, obj)  # Call unbound method with explicit self
    ^^^^^^^^^^^^
  File "/home/runner/work/pylint/pylint/venv/lib/python3.11/site-packages/dill/_dill.py", line 1187, in save_code
    obj.co_firstlineno, obj.co_lnotab, obj.co_endlinetable,
                                       ^^^^^^^^^^^^^^^^^^^
AttributeError: 'code' object has no attribute 'co_endlinetable'. Did you mean: 'co_linetable'?

See https://github.com/PyCQA/pylint/runs/6950183172?check_suite_focus=true#step:7:3716 and pylint-dev/pylint#6551 for the context.

@mmckerns mmckerns added this to the dill-0.3.6 milestone Jun 18, 2022
@mmckerns
Copy link
Member

This should be resolved in master. Please reopen if this is not a duplicate of #480. FYI, a new release should be coming in about a week.

@Pierre-Sassoulas
Copy link
Author

Amazing, sorry for the noise !

@mmckerns
Copy link
Member

No worries, thanks for reporting.

@NiklasRosenstein
Copy link

Hey @mmckerns it doesn't seem that release has been created yet, is that right?

@mmckerns
Copy link
Member

mmckerns commented Aug 14, 2022

@NiklasRosenstein: that's correct. We have not cut the release yet. The blockers is #527, which either requires some surgical rollback or we finish the PR. My intent was to make a patch release a month ago, however we decided to include new development as well... some of which is now causing a delay. We will also likely include #475 if it gets finished before #527 as they are closely related.

@juergenzimmermann
Copy link

@mmckerns Can you give a coarse estimation when you might cut a new release?

@Pierre-Sassoulas
Copy link
Author

@juergenzimmermann if you need a temporary solution we made an unofficial release of 0.3.6 to unblock pylint so you could use https://pypi.org/project/dill-pylint

@mmckerns
Copy link
Member

@juergenzimmermann: I still have the above noted issue with #475 / #527, but plan to sort it out this week and cut a release.

flo-renaud added a commit to flo-renaud/freeipa that referenced this issue Oct 13, 2022
Force dill version to dill-pylint 0.3.6.dev0 to
woraround dill issue with python 3.11
uqfoundation/dill#514

This is a temporary workaround until dill 0.3.6 is released.

Signed-off-by: Florence Blanc-Renaud <[email protected]>
flo-renaud added a commit to flo-renaud/freeipa that referenced this issue Oct 13, 2022
Force dill version to dill-pylint 0.3.6.dev0 to
woraround dill issue with python 3.11
uqfoundation/dill#514

This is a temporary workaround until dill 0.3.6 is released.

Signed-off-by: Florence Blanc-Renaud <[email protected]>
flo-renaud added a commit to flo-renaud/freeipa that referenced this issue Oct 13, 2022
Force dill version to dill-pylint 0.3.6.dev0 to
woraround dill issue with python 3.11
uqfoundation/dill#514

This is a temporary workaround until dill 0.3.6 is released.

Signed-off-by: Florence Blanc-Renaud <[email protected]>
flo-renaud added a commit to flo-renaud/freeipa that referenced this issue Oct 13, 2022
Force dill version to dill-pylint 0.3.6.dev0 to
woraround dill issue with python 3.11
uqfoundation/dill#514

This is a temporary workaround until dill 0.3.6 is released.

Signed-off-by: Florence Blanc-Renaud <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants