New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sub threads execute in restricted mode #41703
Comments
I'm using the JEP product which allows integration It seems that since Python 2.3.5 any threads (using the The error reported is: (see http://sourceforge.net/forum/forum.php? There seems to be a similar problem with mod_python Reading through the release notes for Python 2.3.5 This might be the problem as it seems to involve the I've attached a Java file which shows the problem when
using JEP.
The error output is:
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Python24\Lib\threading.py", line 442, in
__bootstrap
File "<string>", line 5, in run
IOError: file() constructor not accessible in restricted
mode 2.4.1c1 (#63, Mar 10 2005, 10:36:41) [MSC v.1310 32 |
Logged In: YES The same problem definately does occur with mod_python, http://www.modpython.org/pipermail/mod_python/2005- |
Logged In: YES To answer the comment on bug bpo-754449 and the email I got Plus the fix only deals with the teardown code; it in no way In other words it ain't my fault to the best of my |
Logged In: YES This problem also occurs on Linux. Note however that |
Logged In: YES I've finally got access to a C compiler and it looks like The problem actually seems to relate to changes to |
Logged In: YES Here's the updated threadmodule.c for 2.4.1 |
Logged In: YES I didn't see jbelmote's comment, perhaps my updated |
Logged In: YES Can anyone tell me specifically what Python C API function |
Logged In: YES In interactive mode, Jep uses Py_NewInterpreter, This file handles java -> python: You'd be looking for pyembed_eval(). |
Logged In: YES I've attached a file (threadtest.c) that is adapted from the |
Logged In: YES This problem prevents us from upgrading to Python 2.4. |
Logged In: YES I saw the subject and thought "Hmm, should raise the priority of this so it
I don't know. It's possible it should be raised on python-dev (it seems Basically, it seems that the whole multiple interpreters facility is screwed, |
Logged In: YES It looks like with Python versions > 2.3.4 threads are off limits |
Logged In: YES I've created a patch for threadmodule.c |
Logged In: YES Hmm. threadtest.c just crashed for me with a debug build: Fatal Python error: Invalid thread state for this thread This is in the call to Py_NewInterpreter() ... (eek). |
Logged In: YES Have you tried the threadtest.c with a debug build after |
Logged In: YES (Grr, SF hates me today) Why, are you under the impression that that could make a difference here? (hint: it can't). The problem with Py_NewInterpreter was an over-zealous check in PythreadState_Swap(), which I've tweaked. A red herring. On to the real problem... I see the problem, and can now reproduce it with your test code, but isn't your patch just a reversion of the patch that was attached to bug bpo-1010677? Why won't applying it bring that patch back? |
Logged In: YES So here's my take on a fix to 1010677, relative to CVS HEAD. It's something of a hack, and I certainly wouldn't condone applying it to the (after applying your patch the test suite failed to complete, btw -- please |
Logged In: YES Good news - I've made a couple of tests and the patch seems With regards to the earlier patch:
|
Logged In: YES That's good to hear. Tim: could you glance over the attached? If you can't be http://mail.python.org/pipermail/python-dev/2005-June/054258.html If you don't have time, please at least say so... yetanothermax: thanks for the confirmation. Could you also Wrt your patch, it took me too long to work out that it was |
Logged In: YES The maybe-even-better-1010677-fix also seems to work |
Logged In: YES Fixed, in Misc/NEWS revision 1.1301 (I made a tiny tweak in addition to the latest patch yetanothermax: Thanks for the report, and the testing of |
Logged In: YES This is apparantly fixed in 2.4.2 despite the absence of an |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: