Whole file

celery/billiard

The author described this change as fix(co_positions): resolve issue caused by absence `co_positions` (#395). It counts as a record because the check below fails on the code as it stood at 32e51b50a and passes on 17037e55c, with nothing else changed between the two runs.

Fix saved2023-10-29
Sharing licenceBSD-3-Clause · LICENSE.txt
Change size+25 0

What the code was meant to do, written into the code itself as a save note

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

The change

5757 # don't want to hit https://bugs.python.org/issue21967
5858 self.f_restricted = False
5959
60+ if sys.version_info >= (3, 11):
61+ @property
62+ def co_positions(self):
63+ return self.f_code.co_positions
6064
65+
6166 class _Object:
6267
6368 def __init__(self, **kw):
6469 [setattr(self, k, v) for k, v in kw.items()]
6570
71+ if sys.version_info >= (3, 11):
72+ __default_co_positions__ = ((None, None, None, None),)
6673
74+ @property
75+ def co_positions(self):
76+ return getattr(
77+ self,
78+ "_co_positions",
79+ self.__default_co_positions__
80+ ).__iter__
81+
82+ @co_positions.setter
83+ def co_positions(self, value):
84+ self._co_positions = value # noqa
85+
86+
6787 class _Truncated:
6888
6989 def __init__(self):
7898 )
7999 self.tb_next = None
80100 self.tb_lasti = 0
101+
102+ if sys.version_info >= (3, 11):
103+ @property
104+ def co_positions(self):
105+ return self.tb_frame.co_positions
81106
82107
83108 class Traceback:

The check that tells the two apart

failpass·t/unit/test_einfo.py::test_object_co_positions

Check file t/unit/test_einfo.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before it32e51b50aa3e6eaec597f5587c41951376554066
Broken version dated2023-08-04
Modulebilliard.einfo
Units changed_Frame, _Object, _Truncated
Fingerprint9f1b7671c37d7352
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in celery/billiard