Jython

Message12910

Author jeff.allen
Recipients FraOrolo, jeff.allen, zyasoft
Date 2019年12月27日.23:32:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1577489578.88.0.885602782636.issue2834@roundup.psfhosted.org>
In-reply-to
Content
Actually, I wrote too soon.
If I let Thread-2 overtake Thread-1, after finding Thread-1's definition, it makes it into org.python.core.imp.ensureFromList(). Here it starts looking for a package called thin.air.Foo.*, and does consult the specific class loader, although with a variety of spurious names (like "Foo.class.__doc__"). (See also #2854.)
The root of the problem I've found is that distinct sys modules continue to share a common package manager, which is a static member of PySystemState. The solution, I think, is to ensure each sys has its own package manager, and that they are synchronised properly (to cover the case where multiple threads access one PySystemState).
Meanwhile, every import works just fine: no missing attributes or reported exceptions. So I'm not at all sure I'm studying the problem Martin Ginkel observed. The original post is a pretty fair description of how 2.7.1 behaved and 2.7.2 doesn't.
I have pushed the change which adds my JUnit test. In the interests of a clean build, the failing assertions are commented out.
https://hg.python.org/jython/rev/e306270a4771
Confirmation would be appreciated that I'm reproducing the circumstances of this issue. Or a script that reproduces the actual issue.
History
Date User Action Args
2019年12月27日 23:32:58jeff.allensetmessageid: <1577489578.88.0.885602782636.issue2834@roundup.psfhosted.org>
2019年12月27日 23:32:58jeff.allensetrecipients: + jeff.allen, zyasoft, FraOrolo
2019年12月27日 23:32:58jeff.allenlinkissue2834 messages
2019年12月27日 23:32:58jeff.allencreate

Supported by Python Software Foundation,
Powered by Roundup

AltStyle によって変換されたページ (->オリジナル) /