[issue2710] error: (10035, 'The socket operation could not complete without blocking')

2009-08-04 Thread Gabriel Genellina

Gabriel Genellina  added the comment:

So this patch should fix it. But I cannot fire the bug using the posted 
example, and there are no test cases for this module yet, so I could 
not test it.

--
keywords: +patch
Added file: http://bugs.python.org/file14655/rpc.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6635] Profiler doesn't print usage (indexError instead)

2009-08-04 Thread Gabriel Genellina

Gabriel Genellina  added the comment:

The patch looks fine to me.

--
nosy: +gagenellina

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6647] warnings.catch_warnings is not thread-safe

2009-08-04 Thread Gabriel Genellina

New submission from Gabriel Genellina :

warnings.catch_warnings is a context manager supposed to save and 
restore warnings filters, and optionally record all warnings issued.

But it does so in a completely thread-unsafe way, by replacing the 
module's "showwarning" and "filters" attributes on enter, and restoring 
them on exit. If the __enter__ / __exit__ calls of two threads overlap, 
after leaving the last block the warnings state is not the same as the 
original state, as it should be.

I don't know how to fix this, other than using locks (that could block 
indefinitely) or severely restricting how catch_warnings may be used. 
At least, this issue should be documented.

--
components: Library (Lib)
files: error-warnings.py
messages: 91301
nosy: gagenellina
severity: normal
status: open
title: warnings.catch_warnings is not thread-safe
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file14654/error-warnings.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6526] importlib.import_module affects permissions of .pyc files subsequently created by import

2009-08-04 Thread Brett Cannon

Brett Cannon  added the comment:

OK, I need a double-check here, David. At this point I have narrowed it 
down to this code triggering it::

  finder = importlib._bootstrap._PyPycFileFinder('.')
  sys.path_importer_cache['.'] = finder

And I am not kidding, that assignment is required. I might be able to 
narrow the code down further in _PyPycFileFinder, but I wanted to double-
check that I have not gone insane and that these two lines do indeed 
trigger the problem.

--
assignee: brett.cannon -> r.david.murray

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2710] error: (10035, 'The socket operation could not complete without blocking')

2009-08-04 Thread Guilherme Polo

Guilherme Polo  added the comment:

> AFAIK, WSAEWOULDBLOCK means that the socket is in nonblocking mode and
> the attempted operation could wait indefinitely to complete.

Rather pessimistic way to see it :) I've always read it as "operation
cannot be completed without blocking".

> But I
> don't understand how that could happen since a previous select()
> confirmed the socket is writeable...

Richard Stevens, MSDN
(http://msdn.microsoft.com/en-us/library/ms741540(VS.85).aspx) and
possibly several other authors and places will tell it is possible to
happen. I've always seen this being handled as "try again later".

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6562] OverflowError in RLock.acquire()

2009-08-04 Thread David Roberts

David Roberts  added the comment:

Ok, so if it's a bug in (Py)Qt then I'm not going to worry about it.

I've managed to fix the issue in my case anyway, by (essentially) replacing:
image = Image.open(fname)
image.load()
tile = ImageQt(image)
with (the much more obvious way to do it):
tile = QImage(fname)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5712] tkinter - askopenfilenames returns string instead of tuple in windows 2.6.1 release

2009-08-04 Thread Guilherme Polo

Guilherme Polo  added the comment:

> With 2.6.2 on Windows, I get filenames surrounded by {}, all in a
> single unicode string.

This string surrounded by { } indicates it is supposed to be a tcl
list, which didn't get converted but should be done by tkFileDialog.

> The change may be related to the new Tk library used, not directly the
> tkFileDialog module.
>

It could be, or not. A simple solution would be to call the splitlist
function from _tkinter on that string, which tkFileDialog should be
doing indifferently of expecting objects from _tkinter or not.

> (BTW, I don't see *any* unit tests for tkinter :( )
>

There are some one a separated branch for now, but it doesn't include
tkFileDialog yet.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1633941] for line in sys.stdin: doesn't notice EOF the first time

2009-08-04 Thread Fan Decheng

Changes by Fan Decheng :


--
nosy: +r_mosaic

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5505] sys.stdin.read() doesn't return after first EOF on Windows

2009-08-04 Thread Gabriel Genellina

Gabriel Genellina  added the comment:

This is a duplicate of #1633941

--
nosy: +gagenellina

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6625] UnicodeEncodeError on pydoc's CLI

2009-08-04 Thread Gabriel Genellina

Gabriel Genellina  added the comment:

After applying your patch, are string (not unicode) docstrings still 
being handled properly?
Adding a test case (in Lib/test/test_pydoc.py) would be nice too.

--
nosy: +gagenellina

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2335] Backport set literals

2009-08-04 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

These all seem fine to me.  Was just checking in because I thought you
had previously pronounced otherwise.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2710] error: (10035, 'The socket operation could not complete without blocking')

2009-08-04 Thread Gabriel Genellina

Gabriel Genellina  added the comment:

AFAIK, WSAEWOULDBLOCK means that the socket is in nonblocking mode and 
the attempted operation could wait indefinitely to complete. But I 
don't understand how that could happen since a previous select() 
confirmed the socket is writeable...
Probably the whole code block could be replaced by a single 
self.sock.sendall(s) call.

--
nosy: +gagenellina

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6646] test_pickle fails on AIX -- 6.9999999999999994e-308 != 6.9999999999999984e-308

2009-08-04 Thread Sridhar Ratnakumar

New submission from Sridhar Ratnakumar :

test test_pickle failed -- errors occurred; run in verbose mode for 
details
test_pickletools
test test_pickletools failed -- Traceback (most recent call last):
  File "/home/apy/rrun/tmp/autotest/apy/lib/python2.6/test/
pickletester.py", line 546, in test_float
self.assertEqual(value, got)
AssertionError: 6.9994e-308 != 6.9984e-308

--
components: Tests
messages: 91292
nosy: srid
severity: normal
status: open
title: test_pickle fails on AIX -- 6.9994e-308 != 
6.9984e-308
type: behavior
versions: Python 2.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5712] tkinter - askopenfilenames returns string instead of tuple in windows 2.6.1 release

2009-08-04 Thread Gabriel Genellina

Gabriel Genellina  added the comment:

With 2.6.2 on Windows, I get filenames surrounded by {}, all in a 
single unicode string.
The change may be related to the new Tk library used, not directly the 
tkFileDialog module.

(BTW, I don't see *any* unit tests for tkinter :( )

--
nosy: +gagenellina

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6642] returning after forking a child thread doesn't call Py_Finalize

2009-08-04 Thread Reid Kleckner

Reid Kleckner  added the comment:

Here's a patch against 2.6 for one way to fix it.  I imagine it has
problems, but I wanted to throw it out there as a straw man.

This patch builds on the patch for http://bugs.python.org/issue6643
since some of the test cases will occasionally deadlock without it.

--
keywords: +patch
Added file: http://bugs.python.org/file14653/finalize-patch.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2335] Backport set literals

2009-08-04 Thread Guido van Rossum

Guido van Rossum  added the comment:

Raymond, I know you see this differently, but personally I don't see a
problem with 2.7 getting additional backports of 3.x features, as long
as they are backwards compatible. While personally I wouldn't spend
effort on this particular backport, I don't see a problem when someone
volunteers a patch. In this specific case, I am fine with accepting set
literals and set comprehensions as new syntax. I do agree that repr()
needs to be kept the same as it was under 2.6.

--
assignee: gvanrossum -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6632] Include more fullwidth chars in the decimal codec

2009-08-04 Thread Gabriel Genellina

Changes by Gabriel Genellina :


--
nosy: +gagenellina

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6634] sys.exit() called from threads other than the main one: undocumented behaviour

2009-08-04 Thread Gabriel Genellina

Gabriel Genellina  added the comment:

I agree with you; the docs should be improved, and I see no reason for 
sys.exit("msg") NOT to write to stderr inside a child thread.

--
nosy: +gagenellina

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6636] Non-existant directory in sys.path prevents further imports

2009-08-04 Thread Gabriel Genellina

Gabriel Genellina  added the comment:

Looks like an optimization for the common case when directories aren't 
created "on the fly". Your proposal would slow down all imports (a 
typical sys.path actually contains a few nonexisting directories).

Quoting PEP302:

The results of path hook checks are cached in
sys.path_importer_cache, which is a dictionary mapping path entries
to importer objects.  The cache is checked before sys.path_hooks is
scanned.  If it is necessary to force a rescan of sys.path_hooks, it
is possible to manually clear all or part of
sys.path_importer_cache.

So the problem is that some cached data is outdated. In this case, 
after creating a directory that might be listed in sys.path, you should 
clear the cached entries using either of these lines:

sys.path_importer_cache.pop("/tmp/foobar", None)
sys.path_importer_cache.clear()

and then your test code succeeds.

(I'd close the issue as 'invalid')

--
nosy: +gagenellina

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1967] Backport dictviews to 2.7

2009-08-04 Thread Alexandre Vassalotti

Alexandre Vassalotti  added the comment:

Here is a patch for 2to3 to support the translation of code using dictviews.

--
Added file: http://bugs.python.org/file14652/2to3_fixer_dictviews.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1967] Backport dictviews to 2.7

2009-08-04 Thread Alexandre Vassalotti

Alexandre Vassalotti  added the comment:

I have refreshed Thomas's patch to reflect recent updates to dictviews.
I also added the documentation for dictviews.

--
nosy: +alexandre.vassalotti
stage:  -> patch review
Added file: http://bugs.python.org/file14651/backport_dictviews.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2335] Backport set literals

2009-08-04 Thread Alexandre Vassalotti

Alexandre Vassalotti  added the comment:

I think we should keep the repr() of sets as is to avoid breaking any
code. And yes, I plan to port set comprehensions along with dict
comprehension.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5449] bug fix to prevent io.BytesIO from accepting arbitrary keyword arguments

2009-08-04 Thread Alexandre Vassalotti

Alexandre Vassalotti  added the comment:

Committed in r74316.

Thanks!

--
nosy: +alexandre.vassalotti
resolution:  -> accepted
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6641] strptime doesn't support %z format ?

2009-08-04 Thread David House

David House  added the comment:

>From the documentation from time.strptime() (which acts the same as
datetime.strptime()):

"Only the directives specified in the documentation [of time.strftime()]
are supported. Because strftime() is implemented per platform it can
sometimes offer more directives than those listed. But strptime() is
independent of any platform and thus does not necessarily support all
directives available that are not documented as supported."

So I think invalid.

--
nosy: +dmhouse

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6628] IDLE freezes after encountering a syntax error

2009-08-04 Thread Ned Deily

Ned Deily  added the comment:

Thanks, I'm now able to reproduce on both 10.4 and 10.5 with the Apple-
supplied Tcl/Tk 8.4.7 but apparently not with a newer Tcl/Tk nor with 
2.6.2.  Investigating further.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2335] Backport set literals

2009-08-04 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Guido, I thought you had decided for this to just be a 3.x feature.

Alex, if this goes forward, were you also going to change the repr() for
sets and the corresponding pprint code?  Are set comprehensions on the
radar screen also.  IMO, these all go hand in hand.

--
assignee:  -> gvanrossum
nosy: +gvanrossum, rhettinger
priority: critical -> normal

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2335] Backport set literals

2009-08-04 Thread Alexandre Vassalotti

Alexandre Vassalotti  added the comment:

Here is a patch for backporting set literals to the trunk.

--
keywords: +patch
nosy: +alexandre.vassalotti
stage:  -> patch review
Added file: http://bugs.python.org/file14650/backport_set_literal.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6623] Lib/ftplib.py netrc class parsing problem

2009-08-04 Thread Vincent Legoll

Vincent Legoll  added the comment:

If the macro_lines is not emptied upon end of parsing a macro
definition, if there's another macro definiton it will 'inherit' the
lines from the previous one, which could very well be uncool.

The use before definition should also be fixed.

Please advise if a better fix would be to completely remove the Netrc
class from ftplib, or replace it with a compatibility wrapper that use
the netrc module.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6620] Variable may be used before first being assigned to in Lib/locale.py

2009-08-04 Thread Mark Dickinson

Mark Dickinson  added the comment:

Thanks.  Committed in r74312 (trunk), r74313 (py3k).

--
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6628] IDLE freezes after encountering a syntax error

2009-08-04 Thread brian

brian  added the comment:

I have Tcl/tk 8.4.7 installed.

To reproduce the hang on my machine:
open IDLE
new window
enter the following code:
  for i in range(10)
  print(i)
run module (saved as test.py)
interpreter complains (shell is still responsive at this point)
fix the code by adding the colon after the for loop
run module again (at this point, IDLE hangs)
While the top menu bar is responsive, all options are greyed out, and
apple-Q doesn't work. Force-quit is necessary to shut IDLE down. Also,
the force-quit menu doesn't show IDLE as being unresponsive, whereas
usually there will be a red alert for an unresponsive program.

Hope this helps

--
components:  -Macintosh

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6622] [RFC] wrong variable used in Lib/poplib.py

2009-08-04 Thread Vincent Legoll

Vincent Legoll  added the comment:

Could someone ensure the attached unittest does the job, I blindly
copied from above...

I don't know how to launch an unittest with the svn 'Lib', it takes the
system one and just messing with PYTHONPATH won't work either.

--
Added file: 
http://bugs.python.org/file14649/py3k-poplib.py-use-wrong-variable-unittest.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6620] Variable may be used before first being assigned to in Lib/locale.py

2009-08-04 Thread Vincent Legoll

Vincent Legoll  added the comment:

Yes it does

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6643] joining a child that forks can deadlock in the forked child process

2009-08-04 Thread Reid Kleckner

Reid Kleckner  added the comment:

Here's a patch for 3.2 which adds the fix and a test case.  I also
verified that the problem exists in 3.1, 2.7, and 2.6 and backported the
patch to those versions, but someone should review this one before I
upload those.

--
keywords: +patch
versions: +Python 2.7, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file14648/forkdeadlock.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2698] Extension module build fails for MinGW: missing vcvarsall.bat

2009-08-04 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

ok then, I am closing it 

thanks for the feedback !

--
resolution:  -> invalid
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2698] Extension module build fails for MinGW: missing vcvarsall.bat

2009-08-04 Thread Lenard Lindstrom

Lenard Lindstrom  added the comment:

Here is the build with Python 2.6.2. It works now.

C:\pygame\bug2698>python setup.py build --compiler=mingw32 --verbose
running build
running build_ext
building 'simple' extension
creating build
creating build\temp.win32-2.6
creating build\temp.win32-2.6\Release
C:\mingw\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\python26\include
-IC:\python26\PC -c simple.c -o build\temp.win32-2.6\Release\simple.o
writing build\temp.win32-2.6\Release\simple.def
creating build\lib.win32-2.6
C:\mingw\bin\gcc.exe -mno-cygwin -shared -s
build\temp.win32-2.6\Release\simple.o
build\temp.win32-2.6\Release\simple.def -LC:\python26\libs
-LC:\python26\PCbuild -lpython26 -lmsvcr90 -o build\lib.win32-2.6\simple.pyd

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6463] IDLE with Tk-Cocoa: Edit, format menus hang

2009-08-04 Thread Ned Deily

Changes by Ned Deily :


--
assignee:  -> ronaldoussoren
components: +Macintosh
nosy: +ronaldoussoren

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6642] returning after forking a child thread doesn't call Py_Finalize

2009-08-04 Thread Reid Kleckner

Changes by Reid Kleckner :


--
versions: +Python 2.6 -Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6633] No handlers could be found for logger

2009-08-04 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc :


--
assignee:  -> vsajip
nosy: +vsajip

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6645] multiprocessing build fails on AIX - /dev/urandom (or equivalent) not found

2009-08-04 Thread Sridhar Ratnakumar

New submission from Sridhar Ratnakumar :

./Modules/ld_so_aix cc_r -qlanglvl=ansi -bI:Modules/python.exp build/
temp.aix-5.1-2.6/home/apy/rrun/build/activ
epython-DEV/build/py2_6_2-aix-powerpc-apyee26-rrun/python/Modules/
_multiprocessing/multiprocessing.o build/temp
.aix-5.1-2.6/home/apy/rrun/build/activepython-DEV/build/py2_6_2-aix-
powerpc-apyee26-rrun/python/Modules/_multip
rocessing/socket_connection.o build/temp.aix-5.1-2.6/home/apy/rrun/
build/activepython-DEV/build/py2_6_2-aix-pow
erpc-apyee26-rrun/python/Modules/_multiprocessing/semaphore.o -o build/
lib.aix-5.1-2.6/_multiprocessing.so
*** WARNING: importing extension "_multiprocessing" failed with : /dev/u
random (or equivalent) not found

--
components: Build, Extension Modules
messages: 91270
nosy: srid
severity: normal
status: open
title: multiprocessing build fails on AIX - /dev/urandom (or equivalent) not 
found
type: compile error
versions: Python 2.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6637] non-empty defaultdict .copy() fails returning empty dict

2009-08-04 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Fixed.  See r74299, r74300, r74301, and r74302.

Thanks for the bug report.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6644] cmathmodule.c: Extra comma in enum - fails on AIX

2009-08-04 Thread Mark Dickinson

Mark Dickinson  added the comment:

Thanks!  Fixed in r74303, r74304, r74305, r74306.

--
nosy: +marketdickinson
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6644] cmathmodule.c: Extra comma in enum - fails on AIX

2009-08-04 Thread Sridhar Ratnakumar

New submission from Sridhar Ratnakumar :

Please the remove extra comma in Modules/cmathmodule.c

64 :eimes enum special_types {
65 :eimes   ST_NINF,/* 0, negative infinity 
*/
66 :eimes   ST_NEG, /* 1, negative finite 
number (nonzero) */
67 :eimes   ST_NZERO,   /* 2, -0. */
68 :eimes   ST_PZERO,   /* 3, +0. */
69 :eimes   ST_POS, /* 4, positive finite 
number (nonzero) */
70 :eimes   ST_PINF,/* 5, positive infinity 
*/
71 :eimes   ST_NAN, /* 6, Not a Number */
72 :eimes };

To see why this is necessary, peruse a similar issue reported earlier: 
http://bugs.python.org/issue5889

--
components: Build, Extension Modules
messages: 91267
nosy: christian.heimes, srid
severity: normal
status: open
title: cmathmodule.c: Extra comma in enum - fails on AIX
type: compile error
versions: Python 2.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6562] OverflowError in RLock.acquire()

2009-08-04 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

This error is certainly due to a C function that sets an exception but
does not return an error value.
When running with a debug build of python, you will see "XXX undetected
error" printed to stderr.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6643] joining a child that forks can deadlock in the forked child process

2009-08-04 Thread Reid Kleckner

New submission from Reid Kleckner :

This bug is similar to the importlock deadlock, and it's really part of
a larger problem that you should release all locks before you fork. 
However, we can fix this in the threading module directly by freeing and
resetting the locks on the main thread after a fork.

I've attached a test case that inserts calls to sleep at the right
places to make the following occur:
- Main thread spawns a worker thread.
- Main thread joins worker thread.
- To join, the main thread acquires the lock on the condition variable
(worker.__block.acquire()).
== switch to worker ==
- Worker thread forks.
== switch to child process ==
- Worker thread, which is now the only thread in the process, returns.
- __bootstrap_inner calls self.__stop() to notify any other threads
waiting for it that it returned.
- __stop() tries to acquire self.__block, which has been left in an
acquired state, so the child process hangs here.
== switch to worker in parent process ==
- Worker thread calls os.waitpid(), which hangs, since the child never
returns.

So there's the deadlock.

I think I should be able to fix it just by resetting the condition
variable lock and any other locks hanging off the only thread left
standing after the fork.

--
components: Library (Lib)
files: forkjoindeadlock.py
messages: 91265
nosy: rnk
severity: normal
status: open
title: joining a child that forks can deadlock in the forked child process
versions: Python 2.6
Added file: http://bugs.python.org/file14647/forkjoindeadlock.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4691] IDLE Code Caching Windows

2009-08-04 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Yes, the -n switch was removed from the Windows installer with r72335
(issue5847)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6642] returning after forking a child thread doesn't call Py_Finalize

2009-08-04 Thread Reid Kleckner

New submission from Reid Kleckner :

I attached a test case to reproduce.

Here is what it does:
- The main thread in the parent process starts a new thread and waits
for it.
- The child thread forks.
- The child process creates a daemon thread, and returns.
- The parent process (in the thread that forked) calls os.waitpid(childpid).

What should happen is that the forked child process should terminate
because it shouldn't wait for the daemon thread, and
os.waitpid(childpid) should return after that, and then the main thread
should return from thread.join().

What happens is that because it was a child thread that forked, the C
stack starts inside of the pthread wrapper (or equivalent) instead of
main.  So when child process returns, it doesn't know that it is now the
main thread, and it doesn't execute Py_Finalize.  Furthermore, pthreads
doesn't call sys_exit_group because it thinks that it is a lone thread
returning, and it doesn't want to terminate the entire process group. 
When you look at it with 'ps f', this is what it looks like:

24325 pts/3Ss 0:01 bash
 4453 pts/3Sl 0:00  \_ ./python thread_fork_hang.py
 4459 pts/3Zl 0:07  |   \_ [python] 
 4467 pts/3R+ 0:00  \_ ps f

Here's the stack traces from the parent process:
(gdb) bt 
#0  0x77bd0991 in sem_wait () from /lib/libpthread.so.0
#1  0x00587abd in PyThread_acquire_lock (lock=0x12bb680,
waitflag=1) at ../../unladen2/Python/thread_pthread.h:349
#2  0x005b1660 in lock_PyThread_acquire_lock
(self=0x77f37150, args=)
at ../../unladen2/Modules/threadmodule.c:46
#3  0x0055b89d in _PyEval_CallFunction (stack_pointer=0x128ff20,
na=, nk=0) at ../../unladen2/Python/eval.cc:4046
#4  0x0055644c in PyEval_EvalFrame (f=0x128fd60) at
../../unladen2/Python/eval.cc:2518
#5  0x0055b225 in PyEval_EvalCodeEx (co=0x77ef9670,
globals=0x1, locals=0x2, args=0x123bbd8, argcount=1, kws=0x123bbe0,
kwcount=0, 
defs=0x77e540e8, defcount=1, closure=0x0) at
../../unladen2/Python/eval.cc:3093
#6  0x0055b7b0 in _PyEval_CallFunction (stack_pointer=0x123bbe0,
na=1, nk=0) at ../../unladen2/Python/eval.cc:4188
#7  0x0055644c in PyEval_EvalFrame (f=0x123ba40) at
../../unladen2/Python/eval.cc:2518
#8  0x0055b225 in PyEval_EvalCodeEx (co=0x77efea30,
globals=0x1, locals=0x2, args=0x12038c8, argcount=1, kws=0x12038d0,
kwcount=0, 
defs=0x77e54368, defcount=1, closure=0x0) at
../../unladen2/Python/eval.cc:3093
#9  0x0055b7b0 in _PyEval_CallFunction (stack_pointer=0x12038d0,
na=1, nk=0) at ../../unladen2/Python/eval.cc:4188
#10 0x0055644c in PyEval_EvalFrame (f=0x1203750) at
../../unladen2/Python/eval.cc:2518
#11 0x0055b225 in PyEval_EvalCodeEx (co=0x77f55d50,
globals=0x0, locals=0x0, args=0x0, argcount=0, kws=0x0, kwcount=0,
defs=0x0, 
defcount=0, closure=0x0) at ../../unladen2/Python/eval.cc:3093
#12 0x0055bc02 in PyEval_EvalCode (co=0x12bb680, globals=0x80,
locals=0x0) at ../../unladen2/Python/eval.cc:552
#13 0x0057deb1 in PyRun_FileExFlags (fp=0x1121260,
filename=0x7fffe6be "thread_fork_hang.py", start=, 
globals=0x10fa010, locals=0x10fa010, closeit=1,
flags=0x7fffe290) at ../../unladen2/Python/pythonrun.c:1359
#14 0x0057e167 in PyRun_SimpleFileExFlags (fp=0x1121260,
filename=0x7fffe6be "thread_fork_hang.py", closeit=1,
flags=0x7fffe290)
at ../../unladen2/Python/pythonrun.c:955
#15 0x004d8954 in Py_Main (argc=-134459232, argv=) at ../../unladen2/Modules/main.c:695
#16 0x76cdf1c4 in __libc_start_main () from /lib/libc.so.6
#17 0x004d7ae9 in _start ()
(gdb) thread 2
[Switching to thread 2 (Thread 0x40800950 (LWP 4458))]#0 
0x77bd234f in waitpid () from /lib/libpthread.so.0
(gdb) bt
#0  0x77bd234f in waitpid () from /lib/libpthread.so.0
#1  0x005b6adf in posix_waitpid (self=,
args=) at ../../unladen2/Modules/posixmodule.c:5797
#2  0x0055b89d in _PyEval_CallFunction (stack_pointer=0x129cff8,
na=, nk=0) at ../../unladen2/Python/eval.cc:4046
#3  0x0055644c in PyEval_EvalFrame (f=0x129ce60) at
../../unladen2/Python/eval.cc:2518
#4  0x0055b225 in PyEval_EvalCodeEx (co=0x77f558f0,
globals=0x0, locals=0x0, args=0x77f98068, argcount=0, kws=0x1239f70, 
kwcount=0, defs=0x0, defcount=0, closure=0x0) at
../../unladen2/Python/eval.cc:3093
#5  0x005d98fc in function_call (func=0x77eefc80,
arg=0x77f98050, kw=0x1286d20) at ../../unladen2/Objects/funcobject.c:524
#6  0x004dc68d in PyObject_Call (func=0x77eefc80,
arg=0x77f98050, kw=0x1286d20) at ../../unladen2/Objects/abstract.c:2487
#7  0x005549d0 in _PyEval_CallFunctionVarKw
(stack_pointer=0x129ce08, num_posargs=, num_kwargs=0, 
flags=) at ../../unladen2/Python/eval.cc:45
#8  0x00559de2 in PyEval_EvalFrame (f=0x129cc80) at
../../unladen2/Python/eval.cc:2560
#9  0x0055b225 in PyEval_EvalCodeEx (co=0x7ff

[issue4832] idle filename extension

2009-08-04 Thread Guilherme Polo

Guilherme Polo  added the comment:

> With this new patch, is it possible to create a file without extension
> on Windows?

It is tricky but, answering your question, you could enter a name
ending with a period to save without an extension.

It seems this isn't going anywhere then. The default behaviour on
Linux is to get the .py already, so this patch changes nothing there.
On Windows no extension is set by default, and with this patch it is
always .py if no extension is specified.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4765] IDLE fails to "Delete Custom Key Set" properly

2009-08-04 Thread Guilherme Polo

Changes by Guilherme Polo :


--
versions: +Python 2.6, Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4765] IDLE fails to "Delete Custom Key Set" properly

2009-08-04 Thread Guilherme Polo

Guilherme Polo  added the comment:

Interesting, this is reproducible in any version under any OS but it is
more noticeable under Windows. In the step 6 you mentioned, IDLE is busy
printing warnings that you will never see if you don't run IDLE from a
terminal. Also, when you tried restarting IDLE I believe it were
actually starting up but wasting a lot of time with this non-existing
key binding.

The problem is that when you ask to delete a custom key set, given the
steps pointed out, IDLE will first remove the custom key bindings and
then will try to remove the bindings associated with the just removed
key bindings which will generate a lot of warnings since they no longer
exist.
A simple solution is to invert some steps when "Apply" is pressed so the
bindings are removed while they still exist in the config-keys.cfg file.
But if you have a config-keys.cfg like you described below and start
IDLE, it will still take a long time to load (at least it does in a
virtual machine here).

--
keywords: +patch
versions: +Python 3.1
Added file: 
http://bugs.python.org/file14645/removekeybindingswhiletheyexist.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4832] idle filename extension

2009-08-04 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

With this new patch, is it possible to create a file without extension
on Windows?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6628] IDLE freezes after encountering a syntax error

2009-08-04 Thread Ned Deily

Ned Deily  added the comment:

I can't reproduce a hang with the python.org 3.1 IDLE on either 10.4 or 
10.5 and with the system Tcl/Tk or with a newer Active Tcl/Tk 8.4 
installed.  Do you have another version of Tcl/Tk installed in 
/Library/Frameworks?  Can you give a step-by-step procedure for 
reproducing the problem you see?

--
assignee:  -> ronaldoussoren
components: +Macintosh
nosy: +nad, ronaldoussoren

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6637] non-empty defaultdict .copy() fails returning empty dict

2009-08-04 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Thanks for the clear report.
I'll get this fixed-up.

--
assignee:  -> rhettinger
components: +Extension Modules -Library (Lib)
nosy: +rhettinger
priority:  -> high
versions: +Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3961] Arrows key do not browse in the IDLE

2009-08-04 Thread Guilherme Polo

Guilherme Polo  added the comment:

Richard, IDLE doesn't support browsing the history of the commands
entered (see issue2704), so I believe this is not related to IDLE and I
believe you meant to talk about the standard python shell.

Since you have compiled python yourself it is possible that you didn't
have the development package of readline installed (it is
libreadline5-dev on ubuntu), which would cause the problem you described
when using the standard python shell.

--
components:  -IDLE
resolution:  -> invalid
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6641] strptime doesn't support %z format ?

2009-08-04 Thread Esteban Feldman

New submission from Esteban Feldman :

When trying to use datetime.strptime %z directive got an unexpected error.

>>> from datetime import datetime
>>> 
>>> fecha = u'Sun Aug 02 19:01:25 + 2009'
>>> datetime.strptime(fecha, '%a %b %d %H:%M:%S %z %Y')
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.6/_strptime.py", line 317, in _strptime
(bad_directive, format))
ValueError: 'z' is a bad directive in format '%a %b %d %H:%M:%S %z %Y'

--
components: None
messages: 91256
nosy: Eka
severity: normal
status: open
title: strptime doesn't support %z format ?
type: behavior
versions: Python 2.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6562] OverflowError in RLock.acquire()

2009-08-04 Thread Fredrik Lundh

Fredrik Lundh  added the comment:

PIL is completely thread-agnostic, so I not sure there's anything PIL can 
do to fix this.

(and ImageQt is of course an interface to PyQt, which is an interface to 
Qt, which consists of a *lot* more than 50 lines...)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6562] OverflowError in RLock.acquire()

2009-08-04 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I don't know, but you should probably contact the author, Fredrik Lundh,
and/or post on the PIL list. Since it is probably not a bug in Python
itself, I'm closing the issue.
(please reopen if you discover a problem in Python itself)

--
nosy: +effbot
resolution:  -> invalid
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6562] OverflowError in RLock.acquire()

2009-08-04 Thread David Roberts

David Roberts  added the comment:

I think I've narrowed it down to the ImageQt class provided by PIL -
commenting out the reference to this (in the constructor of the Tile
class referenced by TileProvider.run) stops the errors.

So how do I go about determining where the problem with ImageQt lies?
(It's only ~50 lines, so there can't be too many things that could
possibly go wrong)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6637] non-empty defaultdict .copy() fails returning empty dict

2009-08-04 Thread Tom Clarke

Tom Clarke  added the comment:

NB - (discussion of significance of this bug)

Defaultdict called with no argument is anomalous & this problem can be 
avoided in such cases by using dict. However this is not possible if 
default value can change and the documentation specifically defines 
behavior when called with no parameter, so this case is allowed.

Furthermore this bug is unpleasant because when the default values are 
never used it is very counterintuitive to imagine that the an error in 
the default value function could have any effect on the output.

Possible solutions:
(1) raise error in this case, change documentation (I prefer)
(2) mend behaviour in this case

Best wishes, Tom

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com