celery / billiard

Multiprocessing Pool Extensions
Other
419 stars 252 forks source link

fix(co_positions): resolve issue caused by absence `co_positions` #395

Closed moaddib666 closed 1 year ago

moaddib666 commented 1 year ago

Attribute on billiard _Object class in the billiard/einfo.py;

Python 3.11 introduced a new attribute co_positions for code objects, inspired by PEP-0657. This has led to compatibility issues with the billiard library, specifically the _Object class in billiard/einfo.py, which lacks the co_positions attribute. This affects the error handling and logging mechanisms, resulting in AttributeError exceptions.

Resolves https://github.com/celery/billiard/issues/386

moaddib666 commented 1 year ago

Hi, thx for fast response, will check what can be done regarding this tomorrow. I've checked that no unit test existing for this specific file so I skipped creation of the new one, so basically we need to cover all scenarios for different python versions.

moaddib666 commented 1 year ago

My fault after applying linters black and isort were added extra lines to the test cases that shifted expected exception posited, now fixed.

~/PycharmProjects/billiard $ tox -v -e 3.11-unit -- -v

============================================================ 27 passed, 53 skipped, 1 warning in 3.35s =============================================================
3.11-unit: exit 0 (3.65 seconds) /Users/moaddib/PycharmProjects/billiard> py.test -xv pid=33060
.pkg: _exit> python /Users/moaddib/PycharmProjects/billiard/.tox/.tox/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
.pkg: exit None (0.00 seconds) /Users/moaddib/PycharmProjects/billiard> python /Users/moaddib/PycharmProjects/billiard/.tox/.tox/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__ pid=33054
  3.11-unit: OK (5.45=setup[1.80]+cmd[3.65] seconds)
  congratulations :) (5.52 seconds)