This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients vstinner
Date 2022-01-06.15:21:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1641482482.19.0.863029352248.issue46283@roundup.psfhosted.org>
In-reply-to
Content
My commit ea251806b8dffff11b30d2182af1e589caf88acf made Unicode interned strings per interpreter to avoid accessing the same Python object from two different interpreters, to avoid race conditions on its reference count.

Problem: the change introduced the bpo-46006 regression in _PyUnicode_EqualToASCIIId() and type update_slot() functions which make the assumption that if two strings are interned and their pointers are not equal: these strings are not equal.

I proposed PR 30123 to fix these two functions, but then questions have been asked about the overall goal, running multiple Python interpreters in parallel in the same process (bpo-40512):
https://bugs.python.org/issue46006#msg408002

bpo-46006 was blocking the Python 3.11.0a4 release, Python 3.10 was affected and there were more and more affected projects:

* jep: https://github.com/ninia/jep/issues/358
* mod_wsgi: https://github.com/GrahamDumpleton/mod_wsgi/issues/729
* weechat-matrix: https://github.com/poljar/weechat-matrix/issues/293
* Fedora issue about mod_wsgi and weechat-matrix: https://bugzilla.redhat.com/show_bug.cgi?id=2030621

So I decided to just revert the change on interned strings:

* main branch: commit 35d6540c904ef07b8602ff014e520603f84b5886
* 3.10 branch: commit 72c260cf0c71eb01eb13100b751e9d5007d00b70 (with changes to keep the ABI backward compatibility)

These interned strings are preventing again to run multiple interpreters in parallel, two subinterpreters must not access the same Python object: see bpo-40533.

I suggest to write a PEP to explain the rationale, and reapply my commit ea251806b8dffff11b30d2182af1e589caf88acf with PR 30123.
History
Date User Action Args
2022-01-06 15:21:22vstinnersetrecipients: + vstinner
2022-01-06 15:21:22vstinnersetmessageid: <1641482482.19.0.863029352248.issue46283@roundup.psfhosted.org>
2022-01-06 15:21:22vstinnerlinkissue46283 messages
2022-01-06 15:21:22vstinnercreate