breezy fails to build on Python 3.10: issue with Py_REFCNT()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Breezy |
Fix Released
|
High
|
Victor Stinner | ||
Fedora |
Confirmed
|
Undecided
|
Bug Description
On Python 3.10, Py_REFCNT() macro can no longer be used as an l-value, whereas breezy/
Py_REFCNT(self) -= 1;
and
Py_REFCNT(self) = 2;
The new Py_SET_REFCNT() function must be used instead. For backward compatibility, this macro can be used to define Py_SET_REFCNT() on Python 3.8 and older.
#if PY_VERSION_HEX < 0x030900A4
# define Py_SET_REFCNT(obj, refcnt) ((Py_REFCNT(obj) = (refcnt)), (void)0)
#endif
Then replace:
Py_REFCNT(self) -= 1;
with:
Py_
And replace:
Py_REFCNT(self) = 2;
with:
Py_
Copy of What's New in Python 3.10:
"""
Since Py_REFCNT() is changed to the inline static function, Py_REFCNT(obj) = new_refcnt must be replaced with Py_SET_REFCNT(obj, new_refcnt): see Py_SET_REFCNT() (available since Python 3.9). For backward compatibility, this macro can be used:
#if PY_VERSION_HEX < 0x030900A4
# define Py_SET_REFCNT(obj, refcnt) ((Py_REFCNT(obj) = (refcnt)), (void)0)
#endif
"""
Python issue where the Py_REFCNT() macro has been changed:
https:/
Downstream Fedora issue for breezy on Python 3.10:
https:/
Changed in brz: | |
status: | New → Fix Committed |
importance: | Undecided → High |
assignee: | nobody → Victor Stinner (vstinner) |
milestone: | none → 3.1.1 |
Changed in fedora: | |
importance: | Unknown → Undecided |
status: | Unknown → Confirmed |
Changed in brz: | |
status: | Fix Committed → Fix Released |
I attach a fix as a patch.
I failed to create a brz branch.
The "bzr push lp:~vstinner/brz/brz" command fails with:
<email address hidden>: Permission denied (publickey).
ConnectionReset reading response for b'BzrDir.open_2.1', retrying
<email address hidden>: Permission denied (publickey).
"ssh -v <email address hidden>" fails with:
debug1: Offering public key: /home/vstinner/ .ssh/id_ rsa RSA SHA256: 2Ikqg/9eDjHfxOb h+4wk6E4u5Jhgua HpFG/V04e0yIo agent
debug1: send_pubkey_test: no mutual signature algorithm
I tested 2 different RSA keys (registered in my Launchpad account).