[issue444582] Finding programs in PATH, adding shutil.which

2010-07-12 Thread Éric Araujo

Éric Araujo  added the comment:

Jan, new features don’t go in stable releases. Your patch targets 3.2 (see the 
versions field at the top of the page).

--

___
Python tracker 

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



[issue7511] msvc9compiler.py: ValueError: [u'path']

2010-07-12 Thread Stefan Krah

Stefan Krah  added the comment:

ipatrol, thanks, I forgot to change ValueError. New patch attached.

--
Added file: http://bugs.python.org/file17959/vcvars4.diff

___
Python tracker 

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



[issue8954] wininst regression: errors when building on linux

2010-07-12 Thread anatoly techtonik

anatoly techtonik  added the comment:

http://codereview.appspot.com/1774043

--

___
Python tracker 

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



[issue8954] wininst regression: errors when building on linux

2010-07-12 Thread anatoly techtonik

Changes by anatoly techtonik :


--
keywords: +patch
Added file: http://bugs.python.org/file17960/suffix.patch

___
Python tracker 

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



[issue8954] wininst regression: errors when building on linux

2010-07-12 Thread Georg Brandl

Georg Brandl  added the comment:

Did you test that patch? ISTM that it contains a syntax error:

+if not self.distribution.has_ext_modules()
+and not self.distribution.has_c_libraries():

--

___
Python tracker 

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



[issue9231] IDLE interactive interpreter crash

2010-07-12 Thread Antoine Pitrou

New submission from Antoine Pitrou :

After a few keystrokes in the interactive interpreter, I got the
following traceback:

Traceback (most recent call last):
  File "Lib/idlelib/idle.py", line 11, in 
idlelib.PyShell.main()
  File "/home/antoine/py3k/__svn__/Lib/idlelib/PyShell.py", line 1420,
in main
root.mainloop()
  File "/home/antoine/py3k/__svn__/Lib/tkinter/__init__.py", line 1009,
in mainloop
self.tk.mainloop(n)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xc0 in position 0:
invalid start byte


The keystrokes were ['d', 'i', Ctrl+Space], which briefly displayed the
completion popup before crashing.

--
components: IDLE
messages: 110077
nosy: pitrou
priority: high
severity: normal
stage: needs patch
status: open
title: IDLE interactive interpreter crash
type: crash
versions: Python 3.2

___
Python tracker 

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



[issue9231] IDLE interactive interpreter crash

2010-07-12 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +kbk

___
Python tracker 

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



[issue9227] can't import Tkinter / use IDLE after installing Python 2.7 on Mac OS X

2010-07-12 Thread Michael Foord

Michael Foord  added the comment:

I don't particularly mind what the fix is - but at the moment users can 
download and install Python from a python.org installer and then have an 
(apparently) non functioning IDLE and Tkinter.

At the very least we should advise users to install the 32bit only binary 
(which presumably works - I should try it) unless they *need* the 64 bit 
Python. (And also let them know that installing the 64 bit version means that 
Tkinter / IDLE doesn't work on Snow Leopard.)

--

___
Python tracker 

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



[issue9231] IDLE interactive interpreter crash

2010-07-12 Thread Ezio Melotti

Ezio Melotti  added the comment:

Closing as duplicate of #1028 (and #6144, #6512, #7884, #6920, #6424, #5156).

--
nosy: +ezio.melotti
resolution:  -> duplicate
stage: needs patch -> 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



[issue1028] Tkinter binding involving Control-spacebar raises unicode error

2010-07-12 Thread Ezio Melotti

Ezio Melotti  added the comment:

This has been reported in #9231 (and #6144, #6512, #7884, #6920, #6424, #5156) 
too.

--
components: +IDLE
keywords: +needs review
stage:  -> patch review
versions: +Python 3.2 -Python 3.0

___
Python tracker 

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



[issue7696] Improve Memoryview/Buffer documentation

2010-07-12 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
assignee: teoliphant -> pitrou

___
Python tracker 

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



[issue9229] memoryview of mmap object not working in 2.7

2010-07-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

True, not all modules in 2.7 have converted to support the new buffer interface 
(which memoryview() requires, as opposed to the "old" buffer interface used by 
buffer()).
Unfortunately, it's probably too late to care about this now that the 2.7 
branch is in bugfix mode.

--
nosy: +pitrou
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue9225] Replace DUP_TOPX with DUP_TOP_TWO

2010-07-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Oddly, at least with pybench, use of PREDICT(BINARY_SUBSCR) in
> DUP_TOP_TWO seems to show an always right PREDICT as slower than
> FAST_DISPATCH

The main point of computed gotos is to allow the CPU's branch predictor to 
predict opcode pairs by itself. So, yes, adding a manual PREDICT() might 
actually slow down the code (probably depending on the CPU model).

By the way, when you modify the bytecode, you have to change the magic number 
in Python/import.c.

--
nosy: +pitrou

___
Python tracker 

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



[issue8954] wininst regression: errors when building on linux

2010-07-12 Thread anatoly techtonik

anatoly techtonik  added the comment:

reuploaded correct version to rietveld.

--
Added file: http://bugs.python.org/file17961/suffix.patch

___
Python tracker 

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



[issue8954] wininst regression: errors when building on linux

2010-07-12 Thread anatoly techtonik

Changes by anatoly techtonik :


Removed file: http://bugs.python.org/file17960/suffix.patch

___
Python tracker 

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



[issue444582] Finding programs in PATH, adding shutil.which

2010-07-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Some comments on the patch:
- shouldn't getdir_id use os.path.normcase() rather than manually switch on 
`windows`?
- the patch adds lots of names at the top-level which aren't part of the public 
API ("windows", "getdir_id", "defpath", "defpath_ext"). They should probably 
start with an underscore.
- if PATH is updated after shutil is first imported, the changes won't get 
picked up. Is it desired?

--
nosy: +pitrou

___
Python tracker 

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



[issue9230] pdb.Pdb.checkline() throws AttributeError if called before starting a debug session

2010-07-12 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +r.david.murray

___
Python tracker 

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



[issue444582] Finding programs in PATH, adding shutil.which

2010-07-12 Thread Jan Killian

Jan Killian  added the comment:

@ Éric and Antoine: Thanks for the useful hints!

* PATH and PATHEXT are now evaluated when needed, not only on module init. The 
rationale is, that the lib user may change them, eg. to include a directory 
with additional commands.

* the only helper module-level variables left are _windows and _getwinpathext() 

* updated doctest

* updated versionadded in docs to 3.2

--
Added file: http://bugs.python.org/file17962/shutil_which_82778.patch

___
Python tracker 

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



[issue444582] Finding programs in PATH, adding shutil.which

2010-07-12 Thread Jan Killian

Changes by Jan Killian :


Added file: http://bugs.python.org/file17963/which.py

___
Python tracker 

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



[issue6478] time.tzset does not reset _strptime's locale time cache

2010-07-12 Thread Mihai Ibanescu

Mihai Ibanescu  added the comment:

Proposed patch attached.

--
keywords: +patch
Added file: http://bugs.python.org/file17964/_strptime.py.patch

___
Python tracker 

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



[issue8098] PyImport_ImportModuleNoBlock() may solve problems but causes others.

2010-07-12 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +belopolsky, brett.cannon
versions: +Python 3.2 -Python 2.6

___
Python tracker 

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



[issue6478] time.tzset does not reset _strptime's locale time cache

2010-07-12 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
assignee:  -> belopolsky

___
Python tracker 

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



[issue8098] PyImport_ImportModuleNoBlock() may solve problems but causes others.

2010-07-12 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue8114] python 2.6.4 installation is not working for the single user mode in vista.

2010-07-12 Thread Mark Lawrence

Mark Lawrence  added the comment:

Python cannot be installed on Vista in single user mode, this is a limitation 
of Vista.

--
nosy: +BreamoreBoy
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



[issue2009] Grammar change to prevent shift/reduce problem with varargslist

2010-07-12 Thread Mark Dickinson

Mark Dickinson  added the comment:

Applied in r82837.  I'll open a separate issue for the trailing commas.

--
resolution:  -> accepted
stage: patch review -> 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



[issue8138] wsgiref.simple_server.SimpleServer claims to be multithreaded

2010-07-12 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy: +pje

___
Python tracker 

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



[issue9232] Allow trailing comma in any function argument list.

2010-07-12 Thread Mark Dickinson

New submission from Mark Dickinson :

Python's current grammar allows a trailing comma after the argument list in:

def f(a, b,):
pass

but not in

def f(*, a, b,):
pass

I propose allowing trailing commas in both situations.

See python-dev discussion starting at

http://mail.python.org/pipermail/python-dev/2010-July/101636.html

--
components: Interpreter Core
messages: 110089
nosy: mark.dickinson
priority: normal
severity: normal
stage: needs patch
status: open
title: Allow trailing comma in any function argument list.
type: feature request
versions: Python 3.2

___
Python tracker 

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



[issue1610654] cgi.py multipart/form-data

2010-07-12 Thread Mark Lawrence

Mark Lawrence  added the comment:

Chui Tey does this issue still apply?  If yes, could you please provide a patch 
according to the guidelines here.
python.org/dev/patches

--
nosy: +BreamoreBoy

___
Python tracker 

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



[issue1616125] Cached globals+builtins lookup optimization

2010-07-12 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy: +rhettinger

___
Python tracker 

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



[issue6478] time.tzset does not reset _strptime's locale time cache

2010-07-12 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

Thank you for the bug report and a patch.

This does look like a bug and proposed patch seems to be the simplest way to 
fix it.  It is unfortunate that the entire TimeRE cache needs to be 
recalculated when only 'Z' entry is invalidated by TZ change.  Please consider 
separating lang and TZ change checks and not reinitialize TimeRE cache object 
if only TZ changes, just replace the 'Z' entry. 

 The patch also needs unit tests.  It should be straightforward to convert 
ttime.py into a test case.  Please add a test case for both test_time and 
test_datetime.  Note that in 3.2 datetime.strptime() will process '%Z' when 
'%z' is also present.  For example,


>>> datetime.strptime('Fri Jul 25 13:26:29 EDT -0500 2008', '%a %b %d %H:%M:%S 
>>> %Z %z %Y')
datetime.datetime(2008, 7, 25, 13, 26, 29, 
tzinfo=datetime.timezone(datetime.timedelta(-1, 68400), 'EDT'))


Please make sure to restore environment variables in test cleanup.

Also a nit on the implementation: cls is unused in _get_timezone(cls), so it 
would be more appropriate to make it staticmethod instead of classmethod.  And 
tzset should probably be called inside _get_timezone.

--
stage: needs patch -> unit test needed

___
Python tracker 

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



[issue6643] Throw away more radioactive locks that could be held across a fork in threading.py

2010-07-12 Thread Reid Kleckner

Reid Kleckner  added the comment:

I completely agree, but the cat is out of the bag on this one.  I don't see how 
we could get rid of fork until Py4K, and even then I'm sure there will be 
people who don't want to see it go, and I'd rather not spend my time arguing 
this point.

The only application of fork that doesn't use exec that I've heard of is 
pre-forked Python servers.  But those don't seem like they would be very 
useful, since with refcounting the copy-on-write behavior doesn't get you very 
many wins.

The problem that this bandaid solves for me is that test_threading.py already 
tests thread+fork behaviors, and can fail non-deterministically.

This problem was exacerbated while I was working on making the compilation 
thread.

I don't think we can un-support fork and threads in the near future either, 
because subprocess.py uses fork, and libraries can use fork behind the user's 
back.

--

___
Python tracker 

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



[issue8098] PyImport_ImportModuleNoBlock() may solve problems but causes others.

2010-07-12 Thread Nick Coghlan

Nick Coghlan  added the comment:

Interesting. Your example code doesn't run afoul of any of the "don't do this" 
flags relating to import that I put into the threading docs, so it seems like a 
fair complaint to me.

As Christian pointed out on c.l.p, the idea with this API is to turn deadlocks 
triggered due to violations of the first rule noted in 
http://docs.python.org/library/threading.html#importing-in-threaded-code into 
exceptions instead. This is *much* friendlier than the old behaviour.

However, as your example shows, there are cases involving the main module where 
the new approach will throw an exception but a deadlock would not have occurred 
if it had just waited for the import lock to be released.

Note the difference in behaviour if the invocation style is changed to hold the 
import lock when the module is executed:

$ ./python -c "import noblock"
acquire
strptime
exit
Unhandled exception in thread started by 
Error in sys.excepthook:

Original exception was:

(The bizarre exception noise at the end is due to the violation of rule 2 at 
the page linked above - since the example code used thread rather than 
threading, we tried to release an import lock that didn't exist any more. If 
the code had used threading instead it would have worked fine and printed 
"released" as expected)

My instinct says that allowing *_NoBlock() to block(!) when invoked from the 
main Python thread will "do the right thing", but I'm going to want to ponder 
that for a while. Inadvertently recreating the deadlocks that this whole 
mechanism is designed to eliminate would be dumb.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue6290] cPickle can misread data type

2010-07-12 Thread Mark Dickinson

Mark Dickinson  added the comment:

I think this can be closed.  It should no longer be a problem in Python 2.7 or 
Python 3.x, and there's a workaround (use protocol 1 or 2) for Python 2.6.

In theory, it *could* still be fixed for Python 2.6.6, but changing the pickle 
output in a bugfix release seems like it might be dangerous.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue8098] PyImport_ImportModuleNoBlock() may solve problems but causes others.

2010-07-12 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

Composed before reading Nick's comment:

"""
This issue is broader in scope than just the time module example that is given, 
so I am not taking this over.  With respect to datetime and time modules, there 
are several related issues I am working on which aim to reduce or eliminate the 
use of PyImport_ImportModuleNoBlock(): issue 9012 aims to eliminate the need to 
import time module from datetime; issue 7989 while not directly related, may 
lead to python dependencies being imported from python rather than C code. 
"""

--

___
Python tracker 

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



[issue8098] PyImport_ImportModuleNoBlock() may solve problems but causes others.

2010-07-12 Thread Nick Coghlan

Nick Coghlan  added the comment:

I'm curious - do the mod_wsgi problems go away if you arrange for the main 
module to run with the import lock held? Or do they turn into deadlocks?

--

___
Python tracker 

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



[issue6290] cPickle can misread data type

2010-07-12 Thread Mark Dickinson

Mark Dickinson  added the comment:

However, here's a patch.  I haven't tested it on Windows.

--
keywords: +patch
Added file: http://bugs.python.org/file17965/issue6290.patch

___
Python tracker 

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



[issue7761] telnetlib Telnet.interact fails on Windows but not Linux

2010-07-12 Thread Jack Diederich

Jack Diederich  added the comment:

Can you check this on 3.1.2 or 3.2?  There were a few bugfixes of the bytes 
handling in that timeframe.

--
assignee:  -> jackdied
nosy: +jackdied
priority: high -> normal

___
Python tracker 

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



[issue9233] json.load failure when C optimizations aren't built

2010-07-12 Thread Fred L. Drake, Jr.

New submission from Fred L. Drake, Jr. :

The json decoder doesn't pass tests when the C optimizations in the _json 
module aren't available.  The actual test failures appear fairly superficial, 
but aren't the limit of the problems.

Empty objects are converted to empty lists instead of empty dictionaries when 
_json isn't available; test attached.

Issue 5723 notes that the pure-Python implementation isn't tested; fixing that 
might have avoided these problems.

Test failures from Python 2.6.5:

==
ERROR: test_c_encode_basestring_ascii 
(json.tests.test_encode_basestring_ascii.TestEncodeBaseStringAscii)
--
Traceback (most recent call last):
  File 
"/home/fdrake/src/Python-2.6.5/Lib/json/tests/test_encode_basestring_ascii.py", 
line 29, in test_c_encode_basestring_ascii
self._test_encode_basestring_ascii(json.encoder.c_encode_basestring_ascii)
  File 
"/home/fdrake/src/Python-2.6.5/Lib/json/tests/test_encode_basestring_ascii.py", 
line 32, in _test_encode_basestring_ascii
fname = encode_basestring_ascii.__name__
AttributeError: 'NoneType' object has no attribute '__name__'

==
ERROR: test_c_scanstring (json.tests.test_scanstring.TestScanString)
--
Traceback (most recent call last):
  File "/home/fdrake/src/Python-2.6.5/Lib/json/tests/test_scanstring.py", line 
13, in test_c_scanstring
self._test_scanstring(json.decoder.c_scanstring)
  File "/home/fdrake/src/Python-2.6.5/Lib/json/tests/test_scanstring.py", line 
17, in _test_scanstring
scanstring('"z\\ud834\\udd20x"', 1, None, True),
TypeError: 'NoneType' object is not callable

==
FAIL: test_encode_basestring_ascii (json.tests.test_speedups.TestSpeedups)
--
Traceback (most recent call last):
  File "/home/fdrake/src/Python-2.6.5/Lib/json/tests/test_speedups.py", line 
13, in test_encode_basestring_ascii
self.assertEquals(encoder.encode_basestring_ascii.__module__, "_json")
AssertionError: 'json.encoder' != '_json'

==
FAIL: test_scanstring (json.tests.test_speedups.TestSpeedups)
--
Traceback (most recent call last):
  File "/home/fdrake/src/Python-2.6.5/Lib/json/tests/test_speedups.py", line 9, 
in test_scanstring
self.assertEquals(decoder.scanstring.__module__, "_json")
AssertionError: 'json.decoder' != '_json'


Test failures from 2.7:

==
ERROR: test_c_scanstring (json.tests.test_scanstring.TestScanString)
--
Traceback (most recent call last):
  File "/home/fdrake/src/Python-2.7/Lib/json/tests/test_scanstring.py", line 
13, in test_c_scanstring
self._test_scanstring(json.decoder.c_scanstring)
  File "/home/fdrake/src/Python-2.7/Lib/json/tests/test_scanstring.py", line 
17, in _test_scanstring
scanstring('"z\\ud834\\udd20x"', 1, None, True),
TypeError: 'NoneType' object is not callable

==
FAIL: test_encode_basestring_ascii (json.tests.test_speedups.TestSpeedups)
--
Traceback (most recent call last):
  File "/home/fdrake/src/Python-2.7/Lib/json/tests/test_speedups.py", line 12, 
in test_encode_basestring_ascii
self.assertEquals(encoder.encode_basestring_ascii.__module__, "_json")
AssertionError: 'json.encoder' != '_json'

==
FAIL: test_scanstring (json.tests.test_speedups.TestSpeedups)
--
Traceback (most recent call last):
  File "/home/fdrake/src/Python-2.7/Lib/json/tests/test_speedups.py", line 8, 
in test_scanstring
self.assertEquals(decoder.scanstring.__module__, "_json")
AssertionError: 'json.decoder' != '_json'

--
components: Library (Lib)
files: test-empty-json-object.diff
keywords: patch
messages: 110099
nosy: fdrake
priority: normal
severity: normal
status: open
title: json.load failure when C optimizations aren't built
type: behavior
versions: Python 2.6, Python 2.7
Added file: http://bugs.python.org/file17966/test-empty-json-object.diff

___
Python tracker 

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



[issue7761] telnetlib Telnet.interact fails on Windows but not Linux

2010-07-12 Thread Mark Lawrence

Mark Lawrence  added the comment:

I get the same error on Windows for 3.1.2 as the OP did for 3.1.1.

--

___
Python tracker 

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



[issue5723] Incomplete json tests

2010-07-12 Thread Fred L. Drake, Jr.

Fred L. Drake, Jr.  added the comment:

This lack of tests is an issue for Python 2.6 as well.

Issue 9233 might have been avoided were the pure-Python implementation tested.

--
nosy: +fdrake
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



[issue9233] json.load failure when C optimizations aren't built

2010-07-12 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +bob.ippolito, ezio.melotti
stage:  -> needs patch

___
Python tracker 

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



[issue5723] Incomplete json tests

2010-07-12 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue1076790] test test_codecs failed

2010-07-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Amaury's suggestion sounds good to me.

--
nosy: +pitrou
status: pending -> closed
superseder:  -> remove --with-wctype-functions configure option

___
Python tracker 

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



[issue7761] telnetlib Telnet.interact fails on Windows but not Linux

2010-07-12 Thread Stefan Krah

Stefan Krah  added the comment:

3.2 is affected as well.

--

___
Python tracker 

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



[issue9079] Make gettimeofday available in time module

2010-07-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Instead of being defined in _time.h, perhaps the new API function should be 
provided by core Python? It would probably help in certain threading primitives.

--
nosy: +pitrou

___
Python tracker 

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



[issue8844] Condition.wait() doesn't raise KeyboardInterrupt

2010-07-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Actually, there is a problem in Lock.acquire and RLock.acquire. If a signal 
occurs and signal handling returns successfully, acquiring the lock will be 
retried without decrementing the timeout first. Therefore, we may end up 
waiting longer than the user wanted.

I'm not sure how to tackle that: either we accept that an incoming signal will 
make the wait longer, or we fix it by properly decrementing the timeout (which 
will complicate things a bit, especially for cross-platform time querying - but 
see issue9079 which might help us).

--

___
Python tracker 

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



[issue4932] Little improvement on urlparse module, urlparse function.

2010-07-12 Thread Mark Lawrence

Mark Lawrence  added the comment:

Andres, do you wish to provide more patches or can we close this issue?

--
nosy: +BreamoreBoy

___
Python tracker 

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



[issue5321] I/O error during one-liner gives no (!) diagnostic (and fails to return OS error status)

2010-07-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I agree that errors while flushing stdout shouldn't be silenced but instead 
reported (on stderr, obviously :-)). It is especially important when scripts 
are used for data processing.
I'd like to have Guido's opinion, though.

--
nosy: +gvanrossum

___
Python tracker 

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



[issue849662] reading shelves is really slow

2010-07-12 Thread Mark Lawrence

Mark Lawrence  added the comment:

Raymond - can we close this ticket?

--
nosy: +BreamoreBoy

___
Python tracker 

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



[issue8954] wininst regression: errors when building on linux

2010-07-12 Thread Mark Hammond

Mark Hammond  added the comment:

With the caveat that I haven't tested it (I'm currently traveling), the patch 
looks good to me.

--

___
Python tracker 

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



[issue8844] Condition.wait() doesn't raise KeyboardInterrupt

2010-07-12 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

Accepting that the timeout is not perfect in the face of signals as a caveat is 
fine (document the possibility) and can be improved later.

--

___
Python tracker 

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



[issue9233] json.load failure when C optimizations aren't built

2010-07-12 Thread Fred L. Drake, Jr.

Fred L. Drake, Jr.  added the comment:

The attached test only fails for Python 2.7; removing Python 2.6 from this 
issue.

--

___
Python tracker 

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



[issue9079] Make gettimeofday available in time module

2010-07-12 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

On Mon, Jul 12, 2010 at 12:07 PM, Antoine Pitrou  wrote:
..
> Instead of being defined in _time.h, perhaps the new API function should be 
> provided by core Python?

This is an interesting idea, but proposed Py_gettimeofday inherits
float_time logic of falling back on ftime and then plain time in case
gettimeofday is not available.  I am not sure this behavior is always
beneficial.  I notice that Python/ceval_gil.h has a comment /* We
assume all modern POSIX systems have gettimeofday() */, which means it
handles windows completely differently and using   Py_gettimeofday
instead of GETTIMEOFDAY in gil code may not be appropriate.

--

___
Python tracker 

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



[issue9079] Make gettimeofday available in time module

2010-07-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> > Instead of being defined in _time.h, perhaps the new API function should be 
> > provided by core Python?
> 
> This is an interesting idea, but proposed Py_gettimeofday inherits
> float_time logic of falling back on ftime and then plain time in case
> gettimeofday is not available.  I am not sure this behavior is always
> beneficial.

I would say this is fine as long as it's "documented". The whole point
of this API is precisely to avoid having to code the various fallbacks
and conversions by yourself. People wanting full control over the code
path can just write their own routine.

>   I notice that Python/ceval_gil.h has a comment /* We
> assume all modern POSIX systems have gettimeofday() */, which means it
> handles windows completely differently and using   Py_gettimeofday
> instead of GETTIMEOFDAY in gil code may not be appropriate.

Indeed, the GIL code would probably still use its own code paths.
However, other less sensitive code could rely on the new API. For
example, it is not critical for lock timeouts to benefit from the full
gettimeofday() precision.

--

___
Python tracker 

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



[issue9079] Make gettimeofday available in time module

2010-07-12 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

On Mon, Jul 12, 2010 at 1:06 PM, Antoine Pitrou  wrote:
..
> Indeed, the GIL code would probably still use its own code paths.
> However, other less sensitive code could rely on the new API. For
> example, it is not critical for lock timeouts to benefit from the full
> gettimeofday() precision.

That may be true, but I would rather proceed in small steps.  First
expose it in _time.h so that it is shared by time and datetime
modulesand then if specific uses are found inside core python, move it
to a more appropriate header.   Lock timeouts are not a good use case
for gettimeofday because POSIX APIs use nonoseconds instead of
microseconds.

--

___
Python tracker 

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



[issue9207] multiprocessing occasionally spits out exception during shutdown (_handle_workers)

2010-07-12 Thread Greg Brockman

Greg Brockman  added the comment:

With pool.py:272 commented out, running about 50k iterations, I saw 4 
tracebacks giving an exception on pool.py:152.  So this seems to imply the race 
does exist (i.e. that the thread is in _maintain_pool rather than time.sleep 
when shutdown begins).  It looks like the _maintain_pool run takes O(10^-4)s, 
so it's not surprising the error is so rare.

That being said, the patch I submitted in issue 9205 should handle this case as 
well.

--

___
Python tracker 

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



[issue9207] multiprocessing occasionally spits out exception during shutdown (_handle_workers)

2010-07-12 Thread Jesse Noller

Jesse Noller  added the comment:

Thank you for doing that footwork Greg, it means a lot to me. I'm leaning 
towards the patch to swallow the errors - I just wanted to ponder it just a 
tiny bit longer before I pull the trigger.

--

___
Python tracker 

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



[issue9132] Documentation for comparing dictionaries is out of date

2010-07-12 Thread Eli Bendersky

Eli Bendersky  added the comment:

I agree with Terry's proposal. Here's a patch file for 
Doc/reference/expressions.rst that implements the change.

--
Added file: http://bugs.python.org/file17967/issue9132.2.patch

___
Python tracker 

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



[issue8975] Bug in cookiejar

2010-07-12 Thread John J Lee

John J Lee  added the comment:

This is a duplicate of issue3924

--
nosy: +jjlee

___
Python tracker 

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



[issue2277] MozillaCookieJar does not support Firefox3 cookie files

2010-07-12 Thread John J Lee

John J Lee  added the comment:

There is code in PyPI project mechanize that implements this feature.  That 
code is marked experimental though, due to lack of testing.

--
nosy: +jjlee

___
Python tracker 

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



[issue9222] IDLE: Fix open/saveas 'Files of type' choices

2010-07-12 Thread Eli Bendersky

Eli Bendersky  added the comment:

Attaching a patch file for Lib/idlelib/IOBinding.py, diffed against the latest 
SVN trunk.

--
keywords: +patch
nosy: +eli.bendersky
Added file: http://bugs.python.org/file17968/issue9122.1.patch

___
Python tracker 

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



[issue2190] MozillaCookieJar ignore HttpOnly cookies

2010-07-12 Thread John J Lee

John J Lee  added the comment:

Is deprecation really necessary?  lynx still uses that format.  lynx doesn't 
write the header that MozillaCookieJar insists on being present, but a trivial 
subclass can read cookies files written by lynx.

--

___
Python tracker 

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



[issue9232] Allow trailing comma in any function argument list.

2010-07-12 Thread Mark Dickinson

Mark Dickinson  added the comment:

Here's a patch.  I've checked with PEP 306, but besides changing Grammar, 
test_grammar.py and the parser module (which there's a separate issue open 
for), I don't think any other changes are required.

--
keywords: +patch
Added file: http://bugs.python.org/file17969/trailing_commas.patch

___
Python tracker 

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



[issue6026] test_(zipfile|zipimport|gzip|distutils|sqlite) fail if zlib is not available

2010-07-12 Thread Andrew Farrell

Andrew Farrell  added the comment:

In the midst of installing from 
http://www.python.org/ftp/python/2.7/Python-2.7.tgz
I get this same error on test_distutils when I run make test.

this is on debian lenny, amd64

distutils_test output:
=
afarrell:~/Python-2.7$ ./python Lib/test/regrtest.py -v test_distutils== 
CPython 2.7 (r27:82500, Jul 12 2010, 13:29:51) [GCC 4.3.2]
==   Linux-2.6.26-2-amd64-x86_64-with-debian-5.0.5 little-endian
==   /home/afarrell/Python-2.7/build/test_python_26242
test_distutils
test_byte_compile (distutils.tests.test_install_lib.InstallLibTestCase) ... ok
test_dont_write_bytecode (distutils.tests.test_install_lib.InstallLibTestCase) 
... ok
test_finalize_options (distutils.tests.test_install_lib.InstallLibTestCase) ... 
ok
test_get_inputs (distutils.tests.test_install_lib.InstallLibTestCase) ... ok
test_get_outputs (distutils.tests.test_install_lib.InstallLibTestCase) ... ok
test_clean (distutils.tests.test_config_cmd.ConfigTestCase) ... ok
test_dump_file (distutils.tests.test_config_cmd.ConfigTestCase) ... ok
test_finalize_options (distutils.tests.test_config_cmd.ConfigTestCase) ... ok
test_search_cpp (distutils.tests.test_config_cmd.ConfigTestCase) ... ok
test_check_all (distutils.tests.test_check.CheckTestCase) ... ok
test_check_document (distutils.tests.test_check.CheckTestCase) ... ok
test_check_metadata (distutils.tests.test_check.CheckTestCase) ... ok
test_check_restructuredtext (distutils.tests.test_check.CheckTestCase) ... ok
test_newer (distutils.tests.test_dep_util.DepUtilTestCase) ... ok
test_newer_group (distutils.tests.test_dep_util.DepUtilTestCase) ... ok
test_newer_pairwise (distutils.tests.test_dep_util.DepUtilTestCase) ... ok
test_runtime_libdir_option 
(distutils.tests.test_unixccompiler.UnixCCompilerTestCase) ... ok
VersionPredicate (distutils.versionpredicate)
Doctest: distutils.versionpredicate.VersionPredicate ... ok
split_provision (distutils.versionpredicate)
Doctest: distutils.versionpredicate.split_provision ... ok
test_server_empty_registration 
(distutils.tests.test_config.PyPIRCCommandTestCase) ... ok
test_server_registration (distutils.tests.test_config.PyPIRCCommandTestCase) 
... ok
test_debug_print (distutils.tests.test_filelist.FileListTestCase) ... ok
test_glob_to_re (distutils.tests.test_filelist.FileListTestCase) ... ok
test_process_template_line (distutils.tests.test_filelist.FileListTestCase) ... 
ok
test_default_settings 
(distutils.tests.test_install_scripts.InstallScriptsTestCase) ... ok
test_installation (distutils.tests.test_install_scripts.InstallScriptsTestCase) 
... ok
test_finalize_options (distutils.tests.test_build.BuildTestCase) ... ok
test_check_archive_formats 
(distutils.tests.test_archive_util.ArchiveUtilTestCase) ... ok
test_compress_deprecated 
(distutils.tests.test_archive_util.ArchiveUtilTestCase) ... skipped 'The 
compress program is required'
test_make_archive (distutils.tests.test_archive_util.ArchiveUtilTestCase) ... ok
test_make_archive_cwd (distutils.tests.test_archive_util.ArchiveUtilTestCase) 
... ok
test_make_archive_owner_group 
(distutils.tests.test_archive_util.ArchiveUtilTestCase) ... skipped 'Requires 
zlib'
test_make_tarball (distutils.tests.test_archive_util.ArchiveUtilTestCase) ... 
skipped 'requires zlib'
test_make_zipfile (distutils.tests.test_archive_util.ArchiveUtilTestCase) ... 
skipped 'Requires zlib'
test_tarfile_root_owner (distutils.tests.test_archive_util.ArchiveUtilTestCase) 
... skipped 'Requires zlib'
test_tarfile_vs_tar (distutils.tests.test_archive_util.ArchiveUtilTestCase) ... 
skipped 'Requires zlib'
test_formats (distutils.tests.test_bdist.BuildTestCase) ... ok
test_build_ext (distutils.tests.test_build_ext.BuildExtTestCase) ... skipped 
'xxmodule.c not found'
test_build_ext_inplace (distutils.tests.test_build_ext.BuildExtTestCase) ... ok
test_build_ext_path_cross_platform 
(distutils.tests.test_build_ext.BuildExtTestCase) ... ok
test_build_ext_path_with_os_sep 
(distutils.tests.test_build_ext.BuildExtTestCase) ... ok
test_check_extensions_list (distutils.tests.test_build_ext.BuildExtTestCase) 
... ok
test_compiler_option (distutils.tests.test_build_ext.BuildExtTestCase) ... ok
test_ext_fullpath (distutils.tests.test_build_ext.BuildExtTestCase) ... ok
test_finalize_options (distutils.tests.test_build_ext.BuildExtTestCase) ... ok
test_get_outputs (distutils.tests.test_build_ext.BuildExtTestCase) ... ok
test_get_source_files (distutils.tests.test_build_ext.BuildExtTestCase) ... ok
test_setuptools_compat (distutils.tests.test_build_ext.BuildExtTestCase) ... 
skipped 'No module named setuptools_build_ext'
test_solaris_enable_shared (distutils.tests.test_build_ext.BuildExtTestCase) 
... ok
test_no_optimize_flag (distutils.tests.test_bdist_rpm.BuildRpmTestCase) ... ok
test_quiet (distutils.tests.test_bdist_rpm.BuildRpmTestCase) ... ok
test_finalize_options (distutils.tests.test_upload.uploadTestCase) ... ok
test_saved_password (distutils.tests.te

[issue9216] FIPS support for hashlib

2010-07-12 Thread Dave Malcolm

Dave Malcolm  added the comment:

Attached is a patch against the py3k branch which implements this.

I've checked that it builds against openssl-0.9.8o.tar.gz, 
openssl-1.0.0a.tar.gz, and against Fedora 12 and 13's heavily-patched 
openssl-1.0.0. The bulk of my testing has been against Fedora's openssl.

I've added selftests to try to verify the new API.  I try to detect if the 
OpenSSL enforces FIPS, via trying to run "openssl md5" as a subprocess, and 
seeing if I can trigger an error.

With FIPS enforcement off, all tests pass when built against 0.9.8o and 1.0.0a 
and F13's 1.0.0, other than those for FIPS enforcement itself, which skip.

With FIPS enforcement on, all tests pass when built against F13's openssl.  (I 
haven't yet figured out how to get the fips selftest to pass for the other 
builds, it's testing checksums against the wrong libcrypto for some reason; see 
caveat below):
$ ./python Lib/test/test_hashlib.py
$ OPENSSL_FORCE_FIPS_MODE=1 ./python Lib/test/test_hashlib.py

For all of the various contexts stored in _hashopenssl.c, we now store two: one 
with the override flag, one without.  This required some reworking of the 
various preprocessor magic in that file, so I've gathered everything related to 
an algorithm into a structure, and moved most of the logic into functions, 
rather than macros.  I'm assuming that these will get inlined under 
optimization, and that the bulk of the time that you're trying to optimize out 
are the EVP lookups and initializations, rather than function call overhead.

How's this looking?

Do I need to add a dummy "usedforsecurity" arg to all of the non-openssl 
message digest implementations within the tree?


Unfortunately, if fips mode is on, and the fips selftest fails for the openssl 
library, every hash use will fail, both with and without the flag:
  ValueError: error:2D07D06A:FIPS routines:EVP_DigestInit_ex:fips selftest 
failed
and this leads to a crippled hashlib module.  It's not clear to me if there's a 
good way to handle this.  (Having said that, a site that has the technical 
expertise to opt-in to FIPS mode is hopefully able to diagnose this, and fix 
their openssl library)

--
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file17970/py3k-hashlib-fips-issue9216.patch

___
Python tracker 

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



[issue9079] Make gettimeofday available in time module

2010-07-12 Thread Mark Dickinson

Mark Dickinson  added the comment:

Assigning back to Alexander;  sorry I haven't had time to look at this.

--

___
Python tracker 

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



[issue9215] test_float crashes with assertion failure on Ubuntu buildbot.

2010-07-12 Thread Mark Dickinson

Mark Dickinson  added the comment:

And I see that test_float is passing again.  Thanks, Matthias!

--

___
Python tracker 

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



[issue849662] reading shelves is really slow

2010-07-12 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue9132] Documentation for comparing dictionaries is out of date

2010-07-12 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Looks good to me. Thanks Eli.

--
stage: needs patch -> commit review

___
Python tracker 

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



[issue9222] IDLE: Fix open/saveas 'Files of type' choices

2010-07-12 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
stage:  -> commit review

___
Python tracker 

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



[issue6026] test_(zipfile|zipimport|gzip|distutils|sqlite) fail if zlib is not available

2010-07-12 Thread Ezio Melotti

Ezio Melotti  added the comment:

Thanks for the report, fixed in r82839 (py3k), r82840 (release27-maint), and 
r82841 (release31-maint).

--

___
Python tracker 

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



[issue9205] Parent process hanging in multiprocessing if children terminate unexpectedly

2010-07-12 Thread Ask Solem

Ask Solem  added the comment:

termination.patch, in the result handler you've added:

   while cache and thread._state != TERMINATE and not failed

why are you terminating the second pass after finding a failed process?

Unpickleable errors and other errors occurring in the worker body are not 
exceptional cases, at least not now that the pool is supervised by 
_handle_workers. I think the result should be set also in this case, so the 
user can inspect the exception after the fact.

I have some other suggestions too, so I will review this patch tomorrow.

For shutdown.patch, I thought this only happened in the worker handler, but 
you've enabled this for the result handler too? I don't care about the worker 
handler, but with the result handler I'm worried that I don't know what 
ignoring these exceptions actually means. For example, is there a possibility 
that we may lose results at shutdown?

--
nosy: +asksol

___
Python tracker 

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



[issue9234] argparse: aliases for positional arguments (subparsers)

2010-07-12 Thread Adrian Sampson

New submission from Adrian Sampson :

The argparse module supports "subparsers," which allow CLI tools to support 
invocation of subcommands (much like the svn or hg programs). For these 
subcommands, it is often useful to allow multiple names for the same command. 
For instance, in Mercurial, "hg blame" does the same thing as "hg annotate".

You should be able to create subparsers with command aliases, like this:
>>> subparsers.add_parser("annotate", aliases=('ann', 'blame'))

The help message for the program should display the aliases alongisde the 
command names.

I'm attaching an example script that adds an Action to the library to 
accomplish this. This isn't a patch, but if this approach seems right to other 
people, I'll turn it into a patch.

Here's this bug on argparse's old tracker:
http://code.google.com/p/argparse/issues/detail?id=23

--
components: Library (Lib)
files: aliases.py
messages: 110130
nosy: asampson
priority: normal
severity: normal
status: open
title: argparse: aliases for positional arguments (subparsers)
type: feature request
versions: Python 2.7
Added file: http://bugs.python.org/file17971/aliases.py

___
Python tracker 

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



[issue7696] Improve Memoryview/Buffer documentation

2010-07-12 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Craig, thanks for pointing it out. I've committed a patch to fix the doc. It 
should probably appear online soon.

--

___
Python tracker 

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



[issue6026] test_(zipfile|zipimport|gzip|distutils|sqlite) fail if zlib is not available

2010-07-12 Thread Andrew Farrell

Andrew Farrell  added the comment:

The attempt to install setuptools indicates that zlib may actually be required 
it seems.
I download setuptools-0.6c11-py2.7.egg from 
http://pypi.python.org/pypi/setuptools
and, as instructed at http://pypi.python.org/pypi/setuptools#id4
and run  `sh setuptools-0.6c11-py2.7.egg`
however get the following exception:
Traceback (most recent call last):
  File "", line 1, in 
zipimport.ZipImportError: can't decompress data; zlib not available
dlafarrell:/localhome/afarrell$ sh setuptools-0.6c11-py2.7.egg 
Traceback (most recent call last):
  File "", line 1, in 
zipimport.ZipImportError: can't decompress data; zlib not available

Given that this is an import error, I infer that
this may just be a problem with the egg; no import may be needed.
If thats the case then the egg should change to reflect that.

--

___
Python tracker 

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



[issue3461] smtplib does not fully support IPv6 in EHLO

2010-07-12 Thread Derek Morr

Derek Morr  added the comment:

I'm not sure how to best write a unit test for this. The patch should only be 
invoked if the client doesn't have a name-served hostname and has IPv6 enabled. 
Also, there are several IPv4-isms in the smtplib tests.

--

___
Python tracker 

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



[issue8975] Bug in cookiejar

2010-07-12 Thread Éric Araujo

Changes by Éric Araujo :


--
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> closed
superseder:  -> cookielib chokes on non-integer cookie version, should ignore 
it instead
type: crash -> behavior

___
Python tracker 

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



[issue9079] Make gettimeofday available in time module

2010-07-12 Thread Mark Dickinson

Changes by Mark Dickinson :


--
assignee: mark.dickinson -> belopolsky

___
Python tracker 

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



[issue9235] missing "import sys" in Tools/gdb/libpython.py

2010-07-12 Thread Yaroslav Halchenko

New submission from Yaroslav Halchenko :

as you can see from below, sys. is used, but never imported (besides a 
docstring)


$> git describe
upstream/0.5.0.dev-875-gf06319e

$> grep -5 'sys' /home/yoh/proj/misc/python/Tools/gdb/libpython.py

"""
During development, I've been manually invoking the code in this way:
(gdb) python

import sys
sys.path.append('/home/david/coding/python-gdb')
import libpython
end

then reloading it after each edit like this:
(gdb) python reload(libpython)
--

def print_summary(self):
if self.is_evalframeex():
pyop = self.get_pyop()
if pyop:
sys.stdout.write('#%i %s\n' % (self.get_index(), 
pyop.get_truncated_repr(MAX_OUTPUT_LEN)))
sys.stdout.write(pyop.current_line())
else:
sys.stdout.write('#%i (unable to read python frame 
information)\n' % self.get_index())
else:
sys.stdout.write('#%i\n' % self.get_index())

class PyList(gdb.Command):
'''List the current Python source code, if any

Use
--
for i, line in enumerate(all_lines[start-1:end]):
linestr = str(i+start)
# Highlight current line:
if i + start == lineno:
linestr = '>' + linestr
sys.stdout.write('%4s%s' % (linestr, line))


# ...and register the command:
PyList()

--
components: Demos and Tools
messages: 110134
nosy: Yaroslav.Halchenko
priority: normal
severity: normal
status: open
title: missing "import sys" in Tools/gdb/libpython.py
versions: Python 2.7

___
Python tracker 

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



[issue9235] missing "import sys" in Tools/gdb/libpython.py

2010-07-12 Thread Yaroslav Halchenko

Yaroslav Halchenko  added the comment:

sorry -- git describe was by mistake in there... report is based on SVN 
revision 82502

--

___
Python tracker 

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



[issue9205] Parent process hanging in multiprocessing if children terminate unexpectedly

2010-07-12 Thread Greg Brockman

Greg Brockman  added the comment:

Thanks much for taking a look at this!

> why are you terminating the second pass after finding a failed 
> process?
Unfortunately, if you've lost a worker, you are no longer guaranteed that cache 
will eventually be empty.  In particular, you may have lost a task, which could 
result in an ApplyResult waiting forever for a _set call.

More generally, my chief assumption that went into this is that the unexpected 
death of a worker process is unrecoverable.  It would be nice to have a better 
workaround than just aborting everything, but I couldn't see a way to do that.

> Unpickleable errors and other errors occurring in the worker body are
> not exceptional cases, at least not now that the pool is supervised
> by _handle_workers.
I could be wrong, but that's not what my experiments were indicating.  In 
particular, if an unpickleable error occurs, then a task has been lost, which 
means that the relevant map, apply, etc. will wait forever for completion of 
the lost task.

> I think the result should be set also in this case, so the user can
> inspect the exception after the fact.
That does sound useful.  Although, how can you determine the job (and the value 
of i) if it's an unpickleable error?  It would be nice to be able to retrieve 
job/i without having to unpickle the rest.

> For shutdown.patch, I thought this only happened in the worker 
> handler, but you've enabled this for the result handler too? I don't 
> care about the worker handler, but with the result handler I'm 
> worried that I don't know what ignoring these exceptions actually 
> means.
You have a good point.  I didn't think about the patch very hard.  I've only 
seen these exceptions from the worker handler, but AFAICT there's no guarantee 
that bad luck with the scheduler wouldn't result in the same problem in the 
result handler.  One option would be to narrow the breadth of the exceptions 
caught by _make_shutdown_safe (do we need to catch anything but TypeErrors?).  
Another option would be to enable only for the worker handler.  I don't have a 
particularly great sense of what the Right Thing to do here is.

--

___
Python tracker 

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



[issue3461] smtplib does not fully support IPv6 in EHLO

2010-07-12 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

You might want to take a look at Lib/test/test_ftplib.py which contains IPv6 
tests including the necessary logic to decide whether or not running them.

--

___
Python tracker 

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



[issue6026] test_(zipfile|zipimport|gzip|distutils|sqlite) fail if zlib is not available

2010-07-12 Thread Andrew Farrell

Andrew Farrell  added the comment:

No dice. unless I'm mistaken, this needs to be included in the distribution.

My current best solution looks like finding the source to
zlib, putting it in my path to install setuptools.
then installing zlib properly

traceback for your pleasure:


Traceback (most recent call last):
  File "setup.py", line 94, in 
scripts = scripts,
  File "/usr/local/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
  File "/usr/local/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
  File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
  File "/localhome/afarrell/setuptools-0.6c11/setuptools/command/install.py", 
line 76, in run
self.do_egg_install()
  File "/localhome/afarrell/setuptools-0.6c11/setuptools/command/install.py", 
line 96, in do_egg_install
self.run_command('bdist_egg')
  File "/usr/local/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
  File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
  File "/localhome/afarrell/setuptools-0.6c11/setuptools/command/bdist_egg.py", 
line 236, in run
dry_run=self.dry_run, mode=self.gen_header())
  File "/localhome/afarrell/setuptools-0.6c11/setuptools/command/bdist_egg.py", 
line 527, in make_zipfile
z = zipfile.ZipFile(zip_filename, mode, compression=compression)
  File "/usr/local/lib/python2.7/zipfile.py", line 651, in __init__
"Compression requires the (missing) zlib module"
RuntimeError: Compression requires the (missing) zlib module

--

___
Python tracker 

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



[issue9205] Parent process hanging in multiprocessing if children terminate unexpectedly

2010-07-12 Thread Jesse Noller

Jesse Noller  added the comment:

Greg - I asked Ask to take a look - his celery package is a huge consumer of 
multiprocessing, and so I tend to run things past him as well. 

That said - to both of you - the fundamental problem the shutdown patch is 
trying to scratch is located in issue 9207 - greg's termination patch just 
exposes the problem in 9207 a lot more.

Focusing specifically on the shutdown patch; our issue is that during 
interpreter shutdown, sys.modules is iterated, and entries are set to None - 
for threads which "live on" well into that cycle can end up losing imported 
functions/modules/etc. The multiple daemon threads in the Pool code are 
exposing this as code which executed imported functions (such as the debug() 
statement in handle_workers) which will fire after the pool has exited and the 
interpreter is shut down.

We can work around the shutdown issue (really, bug 9207) by ignoring the 
exception such as shutdown.patch does, or passing in references/adding 
references to the functions those methods need. Or (as Brett suggested) 
converting them to class methods and adding references to the class. Or passing 
them in via the signature like this _handle_workers(arg, _debug=debug), etc.

--

___
Python tracker 

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



[issue9236] Invalid reads in fastsearch.h

2010-07-12 Thread Stefan Krah

New submission from Stefan Krah :

In test_bytes Valgrind finds two reads with negative array indices.


test_bytes
==7341== Invalid read of size 1
==7341==at 0x4EDA24: fastsearch (fastsearch.h:143)
==7341==by 0x4F170E: bytearray_find_internal (find.h:42)
==7341==by 0x4F17BD: bytearray_rindex (bytearrayobject.c:1267)
==7341==by 0x49DDA0: PyEval_EvalFrameEx (ceval.c:4322)
==7341==by 0x49FD2A: PyEval_EvalCodeEx (ceval.c:3252)
==7341==by 0x49D741: PyEval_EvalFrameEx (ceval.c:4108)
==7341==by 0x49E155: PyEval_EvalFrameEx (ceval.c:4098)
==7341==by 0x49FD2A: PyEval_EvalCodeEx (ceval.c:3252)
==7341==by 0x4FE1BE: function_call (funcobject.c:526)
==7341==by 0x41AE8C: PyObject_Call (abstract.c:2522)
==7341==by 0x49B9AB: PyEval_EvalFrameEx (ceval.c:4325)
==7341==by 0x49FD2A: PyEval_EvalCodeEx (ceval.c:3252)
==7341==  Address 0xcfd37df is 1 bytes before a block of size 6 alloc'd
==7341==at 0x4C2412C: malloc (vg_replace_malloc.c:195)
==7341==by 0x4C241A6: realloc (vg_replace_malloc.c:476)
==7341==by 0x4EF441: PyByteArray_Resize (bytearrayobject.c:259)
==7341==by 0x4F0F8A: bytearray_iconcat (bytearrayobject.c:340)
==7341==by 0x4F113E: bytearray_init (bytearrayobject.c:810)
==7341==by 0x468531: type_call (typeobject.c:723)
==7341==by 0x41AE8C: PyObject_Call (abstract.c:2522)
==7341==by 0x499129: PyEval_EvalFrameEx (ceval.c:4230)
==7341==by 0x49E155: PyEval_EvalFrameEx (ceval.c:4098)
==7341==by 0x49FD2A: PyEval_EvalCodeEx (ceval.c:3252)
==7341==by 0x4FE1BE: function_call (funcobject.c:526)
==7341==by 0x41AE8C: PyObject_Call (abstract.c:2522)
==7341== 
==7341== 
==7341==  Attach to debugger ? --- [Return/N/n/Y/y/C/c]  y
==7341== starting debugger with cmd: /usr/bin/gdb -nw /proc/7507/fd/1014 7507
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu"...
Attaching to program: /proc/7507/fd/1014, process 7507
fastsearch (s=0xcfd37e0 "world", n=0, p=0xa0170b4 "worm", m=4, maxcount=, mode=2) at Objects/stringlib/fastsearch.h:143
143 if (!STRINGLIB_BLOOM(mask, s[i-1]))
(gdb) p i
$1 = 0




==7341== 
==7341== Debugger has detached.  Valgrind regains control.  We continue.
==7341== Invalid read of size 1
==7341==at 0x4ED9B0: fastsearch (fastsearch.h:149)
==7341==by 0x4F0938: bytearray_rsplit (split.h:311)
==7341==by 0x49E6C1: PyEval_EvalFrameEx (ceval.c:4012)
==7341==by 0x49E155: PyEval_EvalFrameEx (ceval.c:4098)
==7341==by 0x49FD2A: PyEval_EvalCodeEx (ceval.c:3252)
==7341==by 0x4FE1BE: function_call (funcobject.c:526)
==7341==by 0x41AE8C: PyObject_Call (abstract.c:2522)
==7341==by 0x49B9AB: PyEval_EvalFrameEx (ceval.c:4325)
==7341==by 0x49FD2A: PyEval_EvalCodeEx (ceval.c:3252)
==7341==by 0x4FE1BE: function_call (funcobject.c:526)
==7341==by 0x41AE8C: PyObject_Call (abstract.c:2522)
==7341==by 0x42237E: instancemethod_call (classobject.c:2578)
==7341==  Address 0xf7c508f is 1 bytes before a block of size 12 alloc'd
==7341==at 0x4C2412C: malloc (vg_replace_malloc.c:195)
==7341==by 0x4C241A6: realloc (vg_replace_malloc.c:476)
==7341==by 0x4EF441: PyByteArray_Resize (bytearrayobject.c:259)
==7341==by 0x4F0F8A: bytearray_iconcat (bytearrayobject.c:340)
==7341==by 0x4F113E: bytearray_init (bytearrayobject.c:810)
==7341==by 0x468531: type_call (typeobject.c:723)
==7341==by 0x41AE8C: PyObject_Call (abstract.c:2522)
==7341==by 0x499129: PyEval_EvalFrameEx (ceval.c:4230)
==7341==by 0x49E155: PyEval_EvalFrameEx (ceval.c:4098)
==7341==by 0x49FD2A: PyEval_EvalCodeEx (ceval.c:3252)
==7341==by 0x4FE1BE: function_call (funcobject.c:526)
==7341==by 0x41AE8C: PyObject_Call (abstract.c:2522)
==7341== 
==7341== 
==7341==  Attach to debugger ? --- [Return/N/n/Y/y/C/c]  y
==7341== starting debugger with cmd: /usr/bin/gdb -nw /proc/7534/fd/1014 7534
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu"...
Attaching to program: /proc/7534/fd/1014, process 7534
fastsearch (s=0xf7c5090 "mississippi", n=0, p=0x9eba16c "ss", m=2, maxcount=-1, 
mode=2) at Objects/stringlib/fastsearch.h:149
149 if (!STRINGLIB_BLOOM(mask, s[i-1]))
(gdb) p i
$1 = 0

--
components: Interpreter Core
messages: 110140
nosy: skrah
priority: normal
severity: normal
status: open
title: Invalid reads in fastsearch.h
t

[issue9235] missing "import sys" in Tools/gdb/libpython.py

2010-07-12 Thread Dave Malcolm

Changes by Dave Malcolm :


--
nosy: +dmalcolm

___
Python tracker 

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



[issue6026] test_(zipfile|zipimport|gzip|distutils|sqlite) fail if zlib is not available

2010-07-12 Thread Andrew Farrell

Andrew Farrell  added the comment:

Apologies. Error on my part.

For those that run into the same problem:
Though zlib is installed on an earlier version of python,
you need to have (ob debian) the package zlib1g-dev installed
when you build python.

--

___
Python tracker 

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



[issue9205] Parent process hanging in multiprocessing if children terminate unexpectedly

2010-07-12 Thread Ask Solem

Ask Solem  added the comment:

> Unfortunately, if you've lost a worker, you are no
> longer guaranteed that cache will eventually be empty.
> In particular, you may have lost a task, which could
> result in an ApplyResult waiting forever for a _set call.

> More generally, my chief assumption that went into this
> is that the unexpected death of a worker process is
> unrecoverable. It would be nice to have a better workaround
> than just aborting everything, but I couldn't see a way
> to do that.

It would be a problem if the process simply disappeared,
But in this case you have the ability to put a result on the queue,
so it doesn't have to wait forever.

For processes disappearing (if that can at all happen), we could solve
that by storing the jobs a process has accepted (started working on),
so if a worker process is lost, we can mark them as failed too.

> I could be wrong, but that's not what my experiments
> were indicating. In particular, if an unpickleable error occurs,
> then a task has been lost, which means that the relevant map,
> apply, etc. will wait forever for completion of the lost task.

It's lost now, but not if we handle the error...
For a single map operation this behavior may make sense, but what about
someone running the pool as s long-running service for users to submit map 
operations to? Errors in this context are expected to happen, even unpickleable 
errors.

I guess that the worker handler works as a supervisor is a side effect,
as it was made for the maxtasksperchild feature, but for me it's a welcome one. 
With the supervisor in place, multiprocessing.pool is already fairly stable to 
be used for this use case, and there's not much to be done to make it solid 
(Celery is already running for months without issue, unless there's a pickling 
error...)

> That does sound useful. Although, how can you determine the
> job (and the value of i) if it's an unpickleable error?
> It would be nice to be able to retrieve job/i without having
> to unpickle the rest.

I was already working on this issue last week actually, and I managed
to do that in a way that works well enough (at least for me):
http://github.com/ask/celery/commit/eaa4d5ddc06b000576a21264f11e6004b418bda1#diff-1

--

___
Python tracker 

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



[issue9232] Allow trailing comma in any function argument list.

2010-07-12 Thread Nick Coghlan

Nick Coghlan  added the comment:

I take it the AST generation just throws the extra comma away? You're sure this 
doesn't upset any of the node counts in that stage of the compiler?

--
nosy: +ncoghlan

___
Python tracker 

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



[issue9236] Invalid reads in fastsearch.h

2010-07-12 Thread Stefan Krah

Changes by Stefan Krah :


--
nosy: +flox

___
Python tracker 

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



[issue9193] Versioned .so files

2010-07-12 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

Actually, the changes to distutils are not strictly necessary for PEP 3149 
implementation (what the PEP-in-progress will be numbered).  Once PEP 384 is 
implemented, it might be useful, but OTOH there might be a better way to 
support that.

In any case, here's a new patch that just provides the configure switch.

--
Added file: http://bugs.python.org/file17972/2010-07-12.txt

___
Python tracker 

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



[issue9237] Add sys.call_tracing to on-line sys module documentation

2010-07-12 Thread rocky bernstein

New submission from rocky bernstein :

sys.call_tracing doesn't appear in Python documents and I think it should. For 
a start, one could use the docstring from sysmodule.c:

 call_tracing(func, args) -> object

 Call func(*args), while tracing is enabled.  The tracing state is saved, and 
restored afterwards.  This is intended to be called from a
debugger from a checkpoint, to recursively debug some other code.

Thanks.

--
assignee: d...@python
components: Documentation
messages: 110145
nosy: d...@python, rocky
priority: normal
severity: normal
status: open
title: Add sys.call_tracing  to on-line sys module documentation
type: feature request
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3

___
Python tracker 

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



[issue3196] Option in pydoc to show docs from private methods

2010-07-12 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

This option would be more useful if it became an optional argument to the 
help() function.  For someone working at the python command line prompt, having 
to switch to pydoc to see private method documentation may be inconvenient.  It 
is more natural to write

>>> help(foo, show_private=True)

--
stage:  -> needs patch
versions: +Python 3.2 -Python 2.7

___
Python tracker 

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



[issue9238] zipfile incorrectly documented as not supporting archive comments

2010-07-12 Thread Ryan Kelly

New submission from Ryan Kelly :

The zipfile module is prominently documented as "This module does not currently 
handle...ZIP files which have appended comments".  But as far as I can tell, it 
handles them fine - there's even a "comment" property on the ZipFile object 
that you can set to modify the comment.

I attach a simple doc patch that removes the apparently out-of-date information.

--
assignee: d...@python
components: Documentation
files: zipfile_comment_doc.patch
keywords: patch
messages: 110147
nosy: d...@python, rfk
priority: normal
severity: normal
status: open
title: zipfile incorrectly documented as not supporting archive comments
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file17973/zipfile_comment_doc.patch

___
Python tracker 

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



[issue3290] python-config --cflags includes irrelevant flags

2010-07-12 Thread Joe Neeman

Joe Neeman  added the comment:

It's still an issue in Python 2.6.5 as packaged by openSUSE 11.2.

--
nosy: +Joe.Neeman

___
Python tracker 

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



[issue9239] zipfile: truncating comment can corrupt the zipfile

2010-07-12 Thread Ryan Kelly

New submission from Ryan Kelly :

If you open a ZipFile in append mode and modify the comment to be shorter than 
what was originally there, the file will become corrupted.  Truncated data from 
the original comment is left "dangling" at the end of the zipfile.

A much more trivial bug discovered while writing tests for this: setting the 
"comment" attribute doesn't mark the zipfile as modified, so the change won't 
be written out unless you also modify one of the archive files.

The attached patch fixes (and adds tests for) these issues.

--
components: Library (Lib)
files: zipfile_appendmode_comment.patch
keywords: patch
messages: 110149
nosy: rfk
priority: normal
severity: normal
status: open
title: zipfile: truncating comment can corrupt the zipfile
type: performance
versions: Python 3.2
Added file: http://bugs.python.org/file17974/zipfile_appendmode_comment.patch

___
Python tracker 

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



[issue9240] different behaviour with for loop... interpreted vs scripted

2010-07-12 Thread Diego Jacobi

New submission from Diego Jacobi :

Hi.
I am not a python expert and i was trying to reduce this next code:

data = []
i = 0
for j in range(packetlen+1):
print i, self.channels_in[ channels[i] ]
data.append( self.channels_in[ channels[i] ].pop() )
i += 1
if i >= len(channels):
i=0

into something like this:

data = []
for j in range(packetlen+1), i in channels:
print j, i
data.append( self.channels_in[ i ].pop() )

which is much more readable and short.
But i didnt know if this sintax is really supported (also i didnt found 
examples on internet), so i just tried.

I runned the script and it didnt complains with errors, BUT i found that the 
behavior is not what i expected.

I expected j to take value of range() and i to take the values of channels 
until range() gets empty.

well, the actual behavior is that j takes the value of the complete range() as 
in
j = range(..)

and the for loop iterates as in 
for i in channels:


ALSO i tested this un the python command line and it produces different 
behaviours:

the same sintax writen as:

for j in range(1,5), i in range(120,500,12):
   print j, i

produces 

Traceback (most recent call last):
  File "", line 1, in 
NameError: name 'i' is not defined


Thats all. I guess that if it produces different results, then there is an 
error happening here.


If there is a pythonic way to do this:
for j in range(packetlen+1), i in channels:

please tell me.

Cheers.
Diego

--
messages: 110150
nosy: jacobidiego
priority: normal
severity: normal
status: open
title: different behaviour with for loop... interpreted vs scripted
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



[issue5950] Make zipimport work with zipfile containing comments

2010-07-12 Thread Ryan Kelly

Ryan Kelly  added the comment:

I can't imagine anyone depending on this lack-of-feature, but there's no 
arguing with the technicality of it.  One more small incentive to make the jump 
to Python 3 then.

Anyway, I've revisited the patch to clean up the logic and control flow, and 
added another test to ensure that it works even when the EOCD record crosses a 
chunk boundary.  Also checked that it works on win32, which fortunately it did 
without modification.

--
Added file: http://bugs.python.org/file17975/zipimport_with_comments.patch

___
Python tracker 

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



[issue5950] Make zipimport work with zipfile containing comments

2010-07-12 Thread Ryan Kelly

Changes by Ryan Kelly :


Removed file: http://bugs.python.org/file17944/zipimport_with_comments.patch

___
Python tracker 

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



[issue9205] Parent process hanging in multiprocessing if children terminate unexpectedly

2010-07-12 Thread Greg Brockman

Greg Brockman  added the comment:

> For processes disappearing (if that can at all happen), we could solve
> that by storing the jobs a process has accepted (started working on),
> so if a worker process is lost, we can mark them as failed too.
Sure, this would be reasonable behavior.  I had considered it but decided it as 
a larger change than I wanted to make without consulting the devs.

> I was already working on this issue last week actually, and I managed
> to do that in a way that works well enough (at least for me):
If I'm reading this right, you catch the exception upon pickling the result (at 
which point you have the job/i information already; totally reasonable).  I'm 
worried about the case of unpickling the task failing.  (Namely, the "task = 
get()" line of the "worker" method.)  Try running the following:
"""
#!/usr/bin/env python
import multiprocessing
p = multiprocessing.Pool(1)
def foo(x):
  pass
p.apply(foo, [1])
"""
And if "task = get()" fails, then the worker doesn't know what the relevant 
job/i values are.

Anyway, so I guess the question that is forming in my mind is, what sorts of 
errors do we want to handle, and how do we want to handle them?  My answer is 
I'd like to handle all possible errors with some behavior that is not "hang 
forever".  This includes handling children processes dying by signals or 
os._exit, raising unpickling errors, etc.

I believe my patch provides this functionality.  By adding the extra mechanism 
that you've written/proposed, we can improve the error handling in specific 
recoverable cases (which probably constitute the vast majority of real-world 
cases).

--

___
Python tracker 

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



  1   2   >