thanks for you efforts, but up to now it still didn't work.
I'm using Windows XP Professional (32 bit).
I tried an install on two different machines with the same negative result.
I proceeded like you suggested.
- I installed for all users,
- I disabled the register extensions
When doing the same call to execute idle as you, I got the following:
Traceback (most recent call last):
File "c:\Python26\Lib\idlelib\idle.py", line 6, in <module>
File "c:\Python26\Lib\idlelib\PyShell.py", line 9, in <module>
File "c:\Python26\Lib\socket.py", line 46, in <module>
ImportError: DLL load failed: <in German: system cannot find this file>
I get a similar error message, when I do
from turtle import *
Import Error. DLL load failed ....
sys.path is exactly like yours. (So the DLLs directory is contained
in sys.path) _tkinter.pyd and _socket.pyd are present in DLLs.
I've installed Python 2.5 on both machines. On the first one I
moreover deleted all entries concerning Python (2.5) from the
PATH variable, with no positive effect.
On the other machine I have also installed Python 3000 successfully,
which even still doesn't have IDLE in it's Menu. Nevertheless there
C:\Python30> python Lib\idlelib\idle.py
brings up IDLE 3.0a1 (and I even can import and use a port of xturtle.py to
Python 3000 there).
I never experienced a similar Problem before when installing Python.
> +def stdout_redirected(new_stdout):
> + save_stdout = sys.stdout
> + sys.stdout = new_stdout
> + try:
> + yield None
> + finally:
> + sys.stdout = save_stdout
I think this test could easily be tweaked to use
test.test_support.captured_stdout rather than reinventing the wheel :)
(cc'ing python-dev for visibility since the sprints are generating a lot
of python-checkins traffic)
Nick Coghlan | ncoghlan(a)gmail.com | Brisbane, Australia
[changing to: and subject: ]
On Tue, Mar 18, 2008 at 4:09 PM, Guido van Rossum <guido(a)python.org> wrote:
> On Tue, Mar 18, 2008 at 3:58 PM, neal.norwitz
> <python-3000-checkins(a)python.org> wrote:
> > Get this test to pass (UserList/UserDict no longer exist and caused a skip).
> I think the automatic skip on ImportError is harmful.
> We should add a helper function to test_support so that you can write
> foobar = test_support.import_optional('foobar')
> and it will skip the test if foobar cannot be imported; all other
> failing imports should cause the test to *fail*.
> Any takers? This should be an easy two-part task.
This would be a great starter project for a new developer.
Let me know if you could use some help. Feel free to contact me on or off list.
Now that we're aggressively adding Py3k warnings to the trunk, I think it's
a good time to get this straightened out. The docs  say PyErr_Warn is
deprecated in favor of PyErr_WarnEx. However, I have seen both in recent
checkins. What is preferred?
I'm working on embedding Python in a multi threaded application
but found mostly old or confusing info on this. Can anyone point me to
right direction or send some working examples?
Python 2.5.1, MacOSX Leopard 10.5.1, using Pytohn/C API
The application initializes Python in a shared library, which in turn
in more libraries that may or may not use C API commands in parallel.
Generally it all works fine, but when two libraries try to access
I get seg fault or similar.
The closest I got to resolve this is based on this message:
which suggests starting a new sub interpreter for each task.
However, i still get errors like below. (Thread 0 on it's own works
According to the docs PyObject_HasAttrString should always succeeds so
understand what happens.
Also I get thread mix-up messages randomly even though I double
2 Threads accessing Python:
Thread 0 Crashed:
0 org.python.python 0x15a58bcc PyErr_Occurred + 16
1 org.python.python 0x159c642c instance_getattr + 277
2 org.python.python 0x159f789b PyObject_HasAttrString +
While Thread 4 is running a process:
0 org.python.python 0x15a43751 PyEval_EvalFrameEx + 794
1 org.python.python 0x15a49cdc PyEval_EvalCodeEx + 1819
2 org.python.python 0x159df537 function_call + 320
3 org.python.python 0x159be278 PyObject_Call + 45
4 org.python.python 0x159c5ee5 instancemethod_call +
5 org.python.python 0x159c297c
PyObject_CallMethodObjArgs + 223 (abstract.c:1860)
Thanks for any advice,
The tabs/spaces checker that is run before doing a svn ci on the python
repository spits out an error message about which files have problems.
Could someone please update this error message to say something to the
"run Tools/scripts/reindent.py on every file listed above and rerun your
tests to fix this before checking in"
On 18-Mar-08, at 6:01 PM, Benjamin Peterson wrote:
>> Couldn't you just import imap as map?
> What do you mean? Import imap as map in future_builtins.c?
> Like the Python:
> import itertools
> map = intertools.map
> type(map(lambda x: x, range(3))) == map # True
Ah, that's a much better idea :P
I'll do that.
If we have a hierarchy of classes, and we use
__getstate__/__setstate__, the wrong version
of __setstate__ gets called.
Possibly, this is a documentation problem, but here goes:
Take two classes, A and B, where B is the child of A.
Construct a B. Pickle it. Unpickle it, and you find
that the __setstate__ function for A is called with the result
produced by B.__getstate__().
This is wrong.
An example follows:
import pickle as P
def __init__(self, a):
self.a = a
def __setstate__(self, upstate):
print 'A.__setstate', upstate
self.a = upstate
def __init__(self, a, b):
self.b = b
return (A.__getstate__(self), self.b)
def __setstate(self, upstate):
# This never gets called!
print 'B.__setstate', upstate
self.b = upstate
return '<B a=%d b=%d>' % (self.a, self.b)
q = B(1,2)
r = P.loads(P.dumps(q, 0))
print 'q=', q
print 'r=', r
Now, run it:
$ python foo.py
A.__setstate (1, 2)
q= <B a=1 b=2, h=46912504218064>
r= Traceback (most recent call last):
File "foo.py", line 44, in <module>
print 'r=', r
File "foo.py", line 37, in __repr__
return '<B a=%d b=%d>' % (self.a, self.b)
AttributeError: 'B' object has no attribute 'b'