[issue14127] add st_*time_ns fileds to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-03-16 Thread Larry Hastings

Larry Hastings  added the comment:

Updated patch incorporating only one of Antoine's latest suggestions.  Please 
see my reply on Reitveld for r3 as to why I skipped two of your three 
suggestions.

--
Added file: http://bugs.python.org/file24884/larry.st_mtime_ns.patch.4.txt

___
Python tracker 

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



[issue10484] http.server.is_cgi fails to handle CGI URLs containing PATH_INFO

2012-03-16 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Actually no.  I revert back my previous statement. Meddling with splitpath 
breaks all the tests.

--

___
Python tracker 

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



[issue13709] Capitalization mistakes in the documentation for ctypes

2012-03-16 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset d2460ff173ff by Eli Bendersky in branch 'default':
Issue #13709: some fixes to the ctypes documentation. In addition to fixing
http://hg.python.org/cpython/rev/d2460ff173ff

--
nosy: +python-dev

___
Python tracker 

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



[issue13709] Capitalization mistakes in the documentation for ctypes

2012-03-16 Thread Eli Bendersky

Eli Bendersky  added the comment:

Fixed in 3.3

I don't think this is important enough to spend time on backporting.

--
resolution:  -> fixed
stage: needs patch -> commit review
status: open -> closed
versions: +Python 3.3

___
Python tracker 

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



[issue2486] Recode (parts of) decimal module in C

2012-03-16 Thread Mark Dickinson

Mark Dickinson  added the comment:

No, this should be closed.

--

___
Python tracker 

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



[issue14320] set.add can return boolean indicate newly added item

2012-03-16 Thread Matt Joiner

Matt Joiner  added the comment:

Is there still some value to at least exposing this in the C API, per the 
precedents I mentioned? 

The patch also contains some adjustment to the set_add_entry/set_add_key 
abstraction dance, and some future proofing of PySet_Add return values that 
have merit on their own.

--

___
Python tracker 

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



[issue14333] queue unittest errors

2012-03-16 Thread Matt Joiner

New submission from Matt Joiner :

$ python3.3 -m unittest test.test_queue

Generates errors in the unit test code of the form

AttributeError: 'BaseQueueTest' object has no attribute 'type2test'

--
components: Tests
messages: 156006
nosy: anacrolix, benjamin.peterson, rhettinger
priority: normal
severity: normal
status: open
title: queue unittest errors
type: behavior
versions: Python 3.3

___
Python tracker 

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



[issue10484] http.server.is_cgi fails to handle CGI URLs containing PATH_INFO

2012-03-16 Thread Glenn Linderman

Glenn Linderman  added the comment:

I'm not sure what tests break or why, I suppose it is the ones for the security 
patch.  I'm not sure which code you are referring to... the code in msg122259 I 
tested only cursorily, the (different) code in issue 13893 is what I'm running 
today, and so has been tested more heavily, but I haven't run the regression 
tests (haven't figured out how).

The latter code fixes the _url_collapse_path_split function, instead of working 
around it, which the code in msg122259 tries to do.

I would be highly interested if it fails any tests, and why, and would be glad 
to help analyze and fix.

--

___
Python tracker 

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



[issue2486] Recode (parts of) decimal module in C

2012-03-16 Thread Mark Dickinson

Changes by Mark Dickinson :


--
resolution:  -> 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



[issue8739] Update to smtpd.py to RFC 5321

2012-03-16 Thread Michele Orrù

Michele Orrù  added the comment:

David: yes, I did. About two weeks ago.
Probably I'll take a look to those issues :)

--

___
Python tracker 

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



[issue8739] Update to smtpd.py to RFC 5321

2012-03-16 Thread Michele Orrù

Michele Orrù  added the comment:

David, can you tag this issue as dependency for issue14261 ?

--

___
Python tracker 

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



[issue10484] http.server.is_cgi fails to handle CGI URLs containing PATH_INFO

2012-03-16 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset bab9f29c93fd by Senthil Kumaran in branch '2.7':
2.7 - Issue #10484: Fix the CGIHTTPServer's PATH_INFO handling problem
http://hg.python.org/cpython/rev/bab9f29c93fd

New changeset 88c86869ce92 by Senthil Kumaran in branch '3.2':
closes issue10484 - Fix the http.server's cgi PATH_INFO handling problem
http://hg.python.org/cpython/rev/88c86869ce92

New changeset 13c44ad094b4 by Senthil Kumaran in branch 'default':
closes issue10484 - Fix the http.server's cgi PATH_INFO handling problem
http://hg.python.org/cpython/rev/13c44ad094b4

--
nosy: +python-dev
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



[issue10484] http.server.is_cgi fails to handle CGI URLs containing PATH_INFO

2012-03-16 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

I treated this as a regression from 2.6. A cgi url with 
/cgi-bin/hello.py/hello/world would have PATH_INFO as '/hello/world' 
I saw some apache specs saying that it should be 'hello/world', but I relied on 
python2.6's behavior with had initial '/'.

Glenn, I referred to Lib/test/test_httpservers.py.

Thanks for raising this and other issues (and patches)!

--

___
Python tracker 

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



[issue10487] http.server doesn't process Status header from CGI scripts

2012-03-16 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
assignee:  -> orsenthil

___
Python tracker 

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



[issue10487] http.server doesn't process Status header from CGI scripts

2012-03-16 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
superseder:  -> Make CGIHTTPServer capable of redirects (and status other than 
200)

___
Python tracker 

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



[issue10485] http.server fails when query string contains addition '?' characters

2012-03-16 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
assignee:  -> orsenthil

___
Python tracker 

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



[issue10484] http.server.is_cgi fails to handle CGI URLs containing PATH_INFO

2012-03-16 Thread Glenn Linderman

Glenn Linderman  added the comment:

In reviewing my code in this area, I also see that in addition to fixing 
_url_collapse_path_split, I override the location that uses it, which is the 
is_cgi function.  Here is my code for the override, which actually creates a 
proper PATH_INFO string:

def is_cgi(self):
"""Test whether self.path corresponds to a CGI script.

Returns True and updates the cgi_info attribute to the tuple
(dir, rest) if self.path requires running a CGI script.
Returns False otherwise.

If any exception is raised, the caller should assume that
self.path was rejected as invalid and act accordingly.

The default implementation tests whether the normalized url
path begins with one of the strings in self.cgi_directories
(and the next character is a '/' or the end of the string).

"""

splitpath = server._url_collapse_path_split(self.path)
# more processing required due to possible PATHINFO parts
# not clear above function really does what is needed here,
# nor just how general it is!
splitpath = '/'.join( splitpath ).split('/', 2 )
head = '/' + splitpath[ 1 ]
tail = splitpath[ 2 ]
if head in self.cgi_directories:
self.cgi_info = head, tail
return True
return False

I have no idea what applications might depend on the improper handling of 
PATH_INFO that the current code is performing, so that is why I applied my fix 
for that in my overridden code, rather than in the server.py source file.

It may be that the actual fix for this issue is in the overridden code above 
(but the fix to _url_collapse_path_split also seemed necessary, there was a 
corner case that it did incorrectly, but after 16 months, I couldn't tell you 
what that corner case was, any more.

Yes, the biggest issue here was the regression from 2.6, the security fix 
seemed to break the PATH_INFO feature.

--

___
Python tracker 

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



[issue10484] http.server.is_cgi fails to handle CGI URLs containing PATH_INFO

2012-03-16 Thread Glenn Linderman

Glenn Linderman  added the comment:

Senthil, the patch you submitted breaks the encapsulation of cgi_directories -- 
this should be changeable per particular application via subclassing or 
assignment, but you've built those directories into the code.  Perhaps you 
should take a look at my code for is_cgi (which I was trying to post while you 
were posting the patches, sorry I was slow).

Perhaps there should be one more test, which actually changes the 
cgi_directories, and tests a few more things, to prove that the code does not 
hard code those directories (it shouldn't).

--
status: closed -> open

___
Python tracker 

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



[issue10484] http.server.is_cgi fails to handle CGI URLs containing PATH_INFO

2012-03-16 Thread Glenn Linderman

Glenn Linderman  added the comment:

Another issue with the patch, is that it doesn't do .. and . collapsing on the 
PATH_INFO part of the path.

It is possible for a path like

/cgi-bin/script.py/../../plain-file.html

to be passed to the server.  I guess the question is if it should serve 
plain-file.html or if it should pass "../../plain-file.html" to script.py as 
its PATH_INFO. I would think the former would be appropriate.  I would have to 
do research to determine if some standard states otherwise.

--

___
Python tracker 

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



[issue10484] http.server.is_cgi fails to handle CGI URLs containing PATH_INFO

2012-03-16 Thread Glenn Linderman

Glenn Linderman  added the comment:

I just tested what Apache does with such a path as 
/cgi-bin/script.py/../../plain-file.html, and it serves the plain-file.html.

--

___
Python tracker 

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



[issue14202] The docs of xml.dom.pulldom are almost nonexistent

2012-03-16 Thread Florian Mladitsch

Changes by Florian Mladitsch :


--
keywords: +patch
Added file: http://bugs.python.org/file24885/xml.dom.pulldom.rst.patch

___
Python tracker 

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



[issue14133] improved PEP 409 implementation

2012-03-16 Thread Nick Coghlan

Nick Coghlan  added the comment:

With the decision on whether or not to suppress the context moved out to a 
separate flag, I think we need to allow it. Requiring that the flag be False 
*and* that the context also be None gets us back to asking the question of why 
the flag doesn't work when the context is set to a different value. That 
question was part of the genesis of the Ellipsis-as-sentinel approach in the 
original 409 implementation.

I wouldn't stress too much about the formatting though. Perhaps note in the 
suppress context docs that the output can get *very* noisy if you turn it off 
when both cause and context are set, so while it does display all the exception 
information, the default output isn't going to be very easy to read.

--

___
Python tracker 

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



[issue14334] Invalid free in _PyUnicode_Ready()

2012-03-16 Thread Stefan Krah

New submission from Stefan Krah :

Hi -- I'm getting a segfault running the attached crasher.py script.
Valgrind traces it down to an Invalid free() / delete / delete[] in
_PyUnicode_Ready().

Reproduce:
==

Rev: 870c0ef7e8a2
Build: ./configure --without-pymalloc CFLAGS="-O0 -g" && make

$ ./python crasher.py 
Segmentation fault


$ valgrind --db-attach=yes --suppressions=./Misc/valgrind-python.supp ./python 
crasher.py
==3476== Memcheck, a memory error detector
==3476== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==3476== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info
==3476== Command: ./python crasher.py
==3476== 
==3476== Invalid free() / delete / delete[]
==3476==at 0x4C2748D: free (vg_replace_malloc.c:366)
==3476==by 0x44763C: _PyUnicode_Ready (unicodeobject.c:1405)
==3476==by 0x44ACF8: PyUnicode_FromFormatV (unicodeobject.c:2500)
==3476==by 0x4A1CF4: PyErr_Format (errors.c:621)
==3476==by 0x42F8FE: type_getattro (typeobject.c:2551)
==3476==by 0x43493A: wrap_binaryfunc (typeobject.c:4317)
==3476==by 0x550008: wrapper_call (descrobject.c:1067)
==3476==by 0x532C93: PyObject_Call (abstract.c:2150)
==3476==by 0x49012B: PyEval_CallObjectWithKeywords (ceval.c:3920)
==3476==by 0x54F136: wrapperdescr_call (descrobject.c:309)
==3476==by 0x532C93: PyObject_Call (abstract.c:2150)
==3476==by 0x491A1E: ext_do_call (ceval.c:4355)
==3476==  Address 0x4 is not stack'd, malloc'd or (recently) free'd
==3476==

--
components: Interpreter Core
files: crasher.py
messages: 156017
nosy: haypo, loewis, skrah
priority: high
severity: normal
stage: needs patch
status: open
title: Invalid free in _PyUnicode_Ready()
type: crash
versions: Python 3.3
Added file: http://bugs.python.org/file24886/crasher.py

___
Python tracker 

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



[issue14202] The docs of xml.dom.pulldom are almost nonexistent

2012-03-16 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 172630a3e6d8 by Eli Bendersky in branch '3.2':
Issue #14202: Greatly enhance the documentation of xml.dom.pulldom.
http://hg.python.org/cpython/rev/172630a3e6d8

New changeset 5d118a154ba3 by Eli Bendersky in branch 'default':
Issue #14202: Greatly enhance the documentation of xml.dom.pulldom.
http://hg.python.org/cpython/rev/5d118a154ba3

--
nosy: +python-dev

___
Python tracker 

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



[issue14202] The docs of xml.dom.pulldom are almost nonexistent

2012-03-16 Thread Eli Bendersky

Eli Bendersky  added the comment:

I committed the patch after some minor modifications, to 3.2 and 3.3

Florian, thanks for the contribution!

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed
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



[issue14325] Stop using the garbage collector to manage the lifetime of the getargs.c freelist

2012-03-16 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 9fc456ac20cf by Jean-Paul Calderone in branch 'default':
Issue #14325: Stop using python lists, capsules, and the garbage collector to 
deal with PyArg_Parse* cleanup.
http://hg.python.org/cpython/rev/9fc456ac20cf

--
nosy: +python-dev

___
Python tracker 

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



[issue14325] Stop using the garbage collector to manage the lifetime of the getargs.c freelist

2012-03-16 Thread Jean-Paul Calderone

Changes by Jean-Paul Calderone :


--
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



[issue11379] Remove "lightweight" from minidom description

2012-03-16 Thread Eli Bendersky

Eli Bendersky  added the comment:

Éric, what else would you like to do here?

--

___
Python tracker 

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



[issue14334] Invalid free in _PyUnicode_Ready()

2012-03-16 Thread Stefan Krah

Stefan Krah  added the comment:

3.2 also crashes. 2.7 runs fine. So it's certainly not related
to the new Unicode API.

--
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



[issue14325] Stop using the garbage collector to manage the lifetime of the getargs.c freelist

2012-03-16 Thread Eli Bendersky

Eli Bendersky  added the comment:

This is cool! Any benchmark / speedup data?

--
nosy: +eli.bendersky

___
Python tracker 

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



[issue14325] Stop using the garbage collector to manage the lifetime of the getargs.c freelist

2012-03-16 Thread Jean-Paul Calderone

Jean-Paul Calderone  added the comment:

If it's a bit faster, that'd be a nice win, but I didn't benchmark.  I'm 
primarily interested in correctness in the PyPy case (PyPy re-uses this code), 
and I think CPython benefits from the slightly simplified code as well.

If you do any benchmarks, I'd love to hear the results, though. :)

--

___
Python tracker 

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



[issue14128] _elementtree should expose types and factory functions consistently with ElementTree

2012-03-16 Thread Eli Bendersky

Eli Bendersky  added the comment:

The TreeBuilder constructor in _elemettree doesn't accept arguments, contrary 
to the documentation. Added a (currently marked as failing) test.

--

___
Python tracker 

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



[issue14334] Crash: getattr(type, '__getattribute__')(type, type)

2012-03-16 Thread Stefan Krah

Stefan Krah  added the comment:

I've traced it down to this line:

>>> getattr(type, '__getattribute__')(type, type)
Segmentation fault


Setting to 'normal', since there are apparently more of these.

--
priority: high -> normal
title: Invalid free in _PyUnicode_Ready() -> Crash: getattr(type, 
'__getattribute__')(type, type)

___
Python tracker 

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



[issue11379] Remove "lightweight" from minidom description

2012-03-16 Thread Éric Araujo

Éric Araujo  added the comment:

I’ll soon have a revised version of my patch to address your feedback.

--

___
Python tracker 

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



[issue14320] set.add can return boolean indicate newly added item

2012-03-16 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue14335] Reimplement multiprocessing's ForkingPickler using dispatch_table

2012-03-16 Thread sbt

New submission from sbt :

The attached patch reimplements ForkingPickler using the new dispatch_table 
attribute.

This allows ForkingPickler to subclass Pickler (implemented in C) instead of 
_Pickler (implemented in Python).

--
components: Library (Lib)
files: mp_forking_pickler.patch
keywords: patch
messages: 156028
nosy: sbt
priority: normal
severity: normal
status: open
title: Reimplement multiprocessing's ForkingPickler using dispatch_table
type: performance
versions: Python 3.3
Added file: http://bugs.python.org/file24887/mp_forking_pickler.patch

___
Python tracker 

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



[issue14334] Crash: getattr(type, '__getattribute__')(type, type)

2012-03-16 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

One-line crasher:
  type.__getattribute__(type, type)
Python 2.7 does not crash reliably, but is not exempt from the bug:
  type.__getattribute__(type, 1.1j)

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue14009] Clearer documentation for cElementTree

2012-03-16 Thread Éric Araujo

Éric Araujo  added the comment:

I will commit the patch, keeping the indexing in 3.3 as agreed.  I just moved 
to a new city, so today is paperwork day but in the evening or tomorrow I’ll do 
Python work :)

--
versions: +Python 3.3

___
Python tracker 

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



[issue14230] Delegating generator is not always visible to debugging tools such as inspect & pdb

2012-03-16 Thread Matt Joiner

Matt Joiner  added the comment:

This changeset has broken something. All I get is a confusing backtrace ending 
with:

  File "/home/matt/src/python-torrent/torrent/bencode.py", line 15, in encode
yield from encode(k)
AttributeError: 'list_iterator' object has no attribute 'send'

Backing out the changeset, and there is no problem. Let me know if there's some 
way to provide more information.

--
nosy: +anacrolix

___
Python tracker 

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



[issue14230] Delegating generator is not always visible to debugging tools such as inspect & pdb

2012-03-16 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

2012/3/16 Matt Joiner :
>
> Matt Joiner  added the comment:
>
> This changeset has broken something. All I get is a confusing backtrace 
> ending with:
>
>  File "/home/matt/src/python-torrent/torrent/bencode.py", line 15, in encode
>    yield from encode(k)
> AttributeError: 'list_iterator' object has no attribute 'send'
>
> Backing out the changeset, and there is no problem. Let me know if there's 
> some way to provide more information.

Try removing all the pycs.

--

___
Python tracker 

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



[issue14230] Delegating generator is not always visible to debugging tools such as inspect & pdb

2012-03-16 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Nevermind, I think I see the problem.

2012/3/16 Benjamin Peterson :
>
> Benjamin Peterson  added the comment:
>
> 2012/3/16 Matt Joiner :
>>
>> Matt Joiner  added the comment:
>>
>> This changeset has broken something. All I get is a confusing backtrace 
>> ending with:
>>
>>  File "/home/matt/src/python-torrent/torrent/bencode.py", line 15, in encode
>>    yield from encode(k)
>> AttributeError: 'list_iterator' object has no attribute 'send'
>>
>> Backing out the changeset, and there is no problem. Let me know if there's 
>> some way to provide more information.
>
> Try removing all the pycs.
>
> --
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue14230] Delegating generator is not always visible to debugging tools such as inspect & pdb

2012-03-16 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Can you possibly create a small example that fails?

--

___
Python tracker 

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



[issue12338] multiprocessing.util._eintr_retry doen't recalculate timeouts

2012-03-16 Thread sbt

sbt  added the comment:

_eintr_retry is currently unused.  The attached patch removes it.

If it is retained then we should at least add a warning that it does not 
recalculate timeouts.

--
keywords: +patch
Added file: http://bugs.python.org/file24888/mp_remove_eintr_retry.patch

___
Python tracker 

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



[issue14202] The docs of xml.dom.pulldom are almost nonexistent

2012-03-16 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks to you both, the new docs are greatly better!

Eli, why not backporting to 2.7 too?  It has the same rules and should get the 
same attention as 3.2.

BTW, when you nest class/method directives, you needn’t repeat the class name 
in the method directives:

  .. class:: DOVEventStream(stream, etc)

 .. method:: getEvent(blah)

A few nits you may want to avoid in future patches:
- The constants in the methods doc don’t use data markup
- s/ie./i.e./
- I’d say “Unicode string”, not “unicode string” (referring to the 
concept/standard, not the old class)

--

___
Python tracker 

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



[issue14334] Crash: getattr(type, '__getattribute__')(type, type)

2012-03-16 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset b7bad204b34f by Benjamin Peterson in branch '3.2':
check to make sure the attribute is a string (#14334)
http://hg.python.org/cpython/rev/b7bad204b34f

New changeset e44591015cf0 by Benjamin Peterson in branch 'default':
merge 3.2 (#14334)
http://hg.python.org/cpython/rev/e44591015cf0

--
nosy: +python-dev

___
Python tracker 

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



[issue14230] Delegating generator is not always visible to debugging tools such as inspect & pdb

2012-03-16 Thread Mark Shannon

Mark Shannon  added the comment:

The magic number has not been updated

Patch attached.

--
Added file: http://bugs.python.org/file24889/magic.patch

___
Python tracker 

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



[issue14316] Broken link in grammar.rst

2012-03-16 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for the catch!  A little detective work finds that grammar.rst started 
as a copy of PEP 306, where the link’s target is 
http://www.python.org/sf/676521 a.k.a. http://bugs.python.org/issue676521

I can fix this later if nobody does it before me.

--
nosy: +brett.cannon, eric.araujo

___
Python tracker 

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



[issue14230] Delegating generator is not always visible to debugging tools such as inspect & pdb

2012-03-16 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset c0a6569fdad6 by Benjamin Peterson in branch 'default':
in 72556ff86828, I should have updated the magic as well as the comment (#14230)
http://hg.python.org/cpython/rev/c0a6569fdad6

--

___
Python tracker 

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



[issue14319] cleanup index switching mechanism on packaging.pypi

2012-03-16 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo
versions: +3rd party, Python 3.3

___
Python tracker 

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



[issue14318] clarify "may not" in time.steady docs

2012-03-16 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +haypo

___
Python tracker 

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



[issue14275] pysetup create doesn't handle install requirements

2012-03-16 Thread Éric Araujo

Changes by Éric Araujo :


--
stage:  -> needs patch
versions: +3rd party -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



[issue14322] More test coverage for hmac

2012-03-16 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for the patch.  Could you rewrite it using self.assert* methods instead 
of asserts?

I’m not an hmac expert, so you may have to wait a bit for another core 
developer to see and commit the patch.

--
nosy: +eric.araujo
title: More test coverage for hmac.py -> More test coverage for hmac

___
Python tracker 

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



[issue14311] ConfigParser does not parse utf-8 files with BOM bytes

2012-03-16 Thread Éric Araujo

Éric Araujo  added the comment:

Could you paste the exact code that fails?  In 3.2+ there is a read_something 
method that takes an encoding argument, so that should work for example.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue14334] Crash: getattr(type, '__getattribute__')(type, type)

2012-03-16 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset d1cf6008a565 by Benjamin Peterson in branch '2.7':
check to make sure the attribute is a string (#14334)
http://hg.python.org/cpython/rev/d1cf6008a565

--

___
Python tracker 

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



[issue14330] do not use the host python for cross builds

2012-03-16 Thread Éric Araujo

Éric Araujo  added the comment:

+   case $$MAKEFLAGS in *s*) quiet=-s; esac; \
Should be quiet=-q.  make -s → setup.py -q

--
nosy: +eric.araujo

___
Python tracker 

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



[issue14334] Crash: getattr(type, '__getattribute__')(type, type)

2012-03-16 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

It doesn't crash for me anymore.

--
nosy: +benjamin.peterson
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



[issue14332] difflib.ndiff appears to ignore linejunk argument

2012-03-16 Thread Éric Araujo

Éric Araujo  added the comment:

Unfortunately Python 2.6 only gets fixes for security bugs now, not regular 
bugs.  Can you reproduce the problem with 2.7 or 3.2?

--
nosy: +eric.araujo, terry.reedy
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



[issue14317] index.simple module lacking in distutils2

2012-03-16 Thread Éric Araujo

Changes by Éric Araujo :


--
resolution: wont fix -> out of date
stage:  -> committed/rejected
versions: +3rd party -Python 2.6

___
Python tracker 

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



[issue14202] The docs of xml.dom.pulldom are almost nonexistent

2012-03-16 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 1a740ea4f2a1 by Eli Bendersky in branch '3.2':
Issue #14202: some additional doc fixes
http://hg.python.org/cpython/rev/1a740ea4f2a1

New changeset b2e27f21760e by Eli Bendersky in branch 'default':
Issue #14202: some additional doc fixes
http://hg.python.org/cpython/rev/b2e27f21760e

--

___
Python tracker 

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



[issue14202] The docs of xml.dom.pulldom are almost nonexistent

2012-03-16 Thread Eli Bendersky

Eli Bendersky  added the comment:

Éric, thanks for the comments - all fixed.

As for 2.7, it's just laziness really. Committing to both 3.2 and 3.3 is 
trivial since it's a simple merge. For 2.7 it's more complicated since it's an 
unrelated branch, and the code samples have to be fixed as well (the current 
ones use Python 3.x syntax).

So I wouldn't object for someone to backport it to 2.7, but I don't deem it 
very important. If it was a bug fix, I would bother, but for documentation... 
not really :-)

--

___
Python tracker 

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



[issue2377] Replace __import__ w/ importlib.__import__

2012-03-16 Thread Brett Cannon

Brett Cannon  added the comment:

Thanks to everyone for the reviews. I'm moving house tomorrow and I suspect 
Andrea wants me to take a little Python break so I might not get to the reviews 
before a2, but I will definitely get to them an merged by a3.

--

___
Python tracker 

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



[issue14296] Compilation error on CentOS 5.8

2012-03-16 Thread Hervé Coatanhay

Hervé Coatanhay  added the comment:

I still have the exact same error

Maybe change should be:

#if !defined(CPU_ALLOC) && defined(HAVE_SCHED_SETAFFINITY)
#undef HAVE_SCHED_SETAFFINITY
#endif

it seems CPU_ALLOC first appeared in glibc 2.7

--

___
Python tracker 

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



[issue14317] index.simple module lacking in distutils2

2012-03-16 Thread Pierre Lecointre

Pierre Lecointre  added the comment:

Un grand merci pour cette réponse !
La substitution index par pypi a fonctionné.

Bon week-end

2012/3/15 Alexis Metaireau 

>
> Alexis Metaireau  added the comment:
>
> The APIs of distutils2 have changed. the "index" module is now named
> "pypi".
>
> So, doing something like::
>
>>>> from distutils2.pypi.simple import Crawler
>
> should work.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue14334] Crash: getattr(type, '__getattribute__')(type, type)

2012-03-16 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

well, on 2.6 and 2.7 the following has weird output and crashes:

def test(obj):
try:
type(obj).__getattribute__(obj, (1,))
except AttributeError as e:
print(e)
class C:
pass
test(str)
test(C)
test(C())

--
status: closed -> open

___
Python tracker 

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



[issue14296] Compilation error on CentOS 5.8

2012-03-16 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

2012/3/16 Hervé Coatanhay :
>
> Hervé Coatanhay  added the comment:
>
> I still have the exact same error
>
> Maybe change should be:
>
> #if !defined(CPU_ALLOC) && defined(HAVE_SCHED_SETAFFINITY)
> #undef HAVE_SCHED_SETAFFINITY
> #endif

Right you are. Try now.

--

___
Python tracker 

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



[issue14296] Compilation error on CentOS 5.8

2012-03-16 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 17980cb07625 by Benjamin Peterson in branch 'default':
fix condition (#14296)
http://hg.python.org/cpython/rev/17980cb07625

--

___
Python tracker 

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



[issue14261] Cleanup in smtpd module

2012-03-16 Thread R. David Murray

Changes by R. David Murray :


--
dependencies: +Update to smtpd.py to RFC 5321
stage:  -> needs patch

___
Python tracker 

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



[issue14202] The docs of xml.dom.pulldom are almost nonexistent

2012-03-16 Thread Éric Araujo

Éric Araujo  added the comment:

I understand :)  I’ll do it.  I value doc as much as code, it’s also delivered 
faster to the users, and there are a lot of Python 2 users out there, so 
porting doc fixes to 2.7 is really worth it.

--
assignee: docs@python -> eric.araujo
status: closed -> open
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



[issue14334] Crash: getattr(type, '__getattribute__')(type, type)

2012-03-16 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 3d4d52e47431 by Benjamin Peterson in branch '2.7':
check for string attribute names in old-style classes (closes #14334)
http://hg.python.org/cpython/rev/3d4d52e47431

--
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



[issue14325] Stop using the garbage collector to manage the lifetime of the getargs.c freelist

2012-03-16 Thread Stefan Krah

Stefan Krah  added the comment:

I'm getting a leak since this revision:

./configure --without-pymalloc CFLAGS="-O0 -g" && make
valgrind --db-attach=yes --suppressions=./Misc/valgrind-python.supp 
--leak-check=full ./python leak.py

==32303== 16 bytes in 1 blocks are definitely lost in loss record 3 of 2,489
==32303==at 0x4C27878: malloc (vg_replace_malloc.c:236)
==32303==by 0x41DDB0: PyMem_Malloc (object.c:1841)
==32303==by 0x4A72BF: vgetargskeywords (getargs.c:1432)
==32303==by 0x4A6E1C: PyArg_ParseTupleAndKeywords (getargs.c:1301)
==32303==by 0x55D1C8: float_new (floatobject.c:1557)
==32303==by 0x42B643: type_call (typeobject.c:708)
==32303==by 0x532A9F: PyObject_Call (abstract.c:2150)
==32303==by 0x491483: do_call (ceval.c:4260)
==32303==by 0x490A33: call_function (ceval.c:4063)
==32303==by 0x48BD49: PyEval_EvalFrameEx (ceval.c:2662)
==32303==by 0x48EA11: PyEval_EvalCodeEx (ceval.c:3414)
==32303==by 0x482FC6: PyEval_EvalCode (ceval.c:771)

--
nosy: +skrah
status: closed -> open

___
Python tracker 

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



[issue14325] Stop using the garbage collector to manage the lifetime of the getargs.c freelist

2012-03-16 Thread Stefan Krah

Stefan Krah  added the comment:

Here's leak.py.

--
Added file: http://bugs.python.org/file24890/leak.py

___
Python tracker 

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



[issue13512] ~/.pypirc created insecurely

2012-03-16 Thread Jakub Wilk

Changes by Jakub Wilk :


--
nosy: +jwilk

___
Python tracker 

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



[issue12568] Add functions to get the width in columns of a character

2012-03-16 Thread Éric Araujo

Éric Araujo  added the comment:

eo

--
nosy: +benjamin.peterson, eric.araujo, lemburg

___
Python tracker 

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



[issue12568] Add functions to get the width in columns of a character

2012-03-16 Thread Éric Araujo

Changes by Éric Araujo :


--
Removed message: http://bugs.python.org/msg156059

___
Python tracker 

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



[issue14328] Add keyword-only parameter support to PyArg_ParseTupleAndKeywords

2012-03-16 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Shouldn't using vgetargs1 with '$' in the format string just be an error? 
vgetargs1 doesn't know anything about keyword arguments.

--

___
Python tracker 

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



[issue14332] Better explain "junk" concept in difflib doc

2012-03-16 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I reproduced the observed behavior in 3.3.0a.
However, I am rather sure it is not a bug.
In any case, linejunk is not ignored. Passing 'lambda x: 1/0' causes 
ZeroDivisionError, proving that it gets called.

The body of ndiff(linejunk,charjunk,a,b) is
return Differ(linejunk, charjunk).compare(a, b)
Differ only uses the linejunk parameter here
cruncher = SequenceMatcher(self.linejunk, a, b)

SequenceMatcher uses the first parameter, isjunk, in the internal .__chain_b 
method to segregate (not remove) items expected to be common in order to speed 
up the .find_longest_match method. Read the docstring for that method (and 
possibly the code) to see how it affects matching. The main intent of the *junk 
parameters is to speed up matching to find differences, not to mask 
differences. It does, however, affect output of the .*ratio methods.

The doc string for ndiff says "The default is None, and is recommended; as of 
Python 2.3, an adaptive notion of "noise" lines is used that does a good job on 
its own." That is a good idea.

That said, I think the doc (and docstrings) should explain the notion of "junk" 
elements and what 'ignoring' them means. In particular, I think a couple of 
sentences should be added after "The idea is to find the longest contiguous 
matching subsequence that contains no “junk” elements (the Ratcliff and 
Obershelp algorithm doesn’t address junk)." The quotes around "junk" indicate 
that it is being used with a non-standard, module specific meaning. What is it? 
And what does 'ignore' (used several times later in the doc) mean?

Tim, I think we may need your help here since 'junk' is your label for your 
concept and I am not sure I understand well enough to articulate it. (For one 
thing, given that the "common" heuristic was apparently meant to replace at 
least the linejunk version version of junk, I do not understand why 
.get_longest_match treats 'junk' and 'common' items differently, other than 
that the two concepts are apparently not the same.)

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python, eli.bendersky
stage:  -> needs patch
title: difflib.ndiff appears to ignore linejunk argument -> Better explain 
"junk" concept in difflib doc
versions: +Python 2.7, 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



[issue14309] Deprecate time.clock()

2012-03-16 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

STINNER Victor wrote:
> 
> STINNER Victor  added the comment:
> 
>> time.clock() has been in use for ages in many many scripts.
>> We don't want to carelessly break all those.
> 
> I don't want to remove the function, just mark it as deprecated to
> avoid confusion. It will only be removed from the next major Python.

Why ? There's no other single function providing the same functionality,
so it's not even a candidate for deprecation.

Similar functionality is available via several different functions,
but that's true for a lot functions in th stdlib.

--

___
Python tracker 

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



[issue10484] http.server.is_cgi fails to handle CGI URLs containing PATH_INFO

2012-03-16 Thread Glenn Linderman

Glenn Linderman  added the comment:

Senthil, from you patch, I discovered where the test_httpservers.py lives, and 
added 

'/cgi-bin/file1.py/../../a': ('/', 'a'),

to a local copy, and it worked fine against whatever version of the server and 
tests it was running against... but that was in test_url_collapse_path_split 
... I haven't figured out the full environment of the testing, or even if it 
launches an HTTP SERVER or only unittests particular functions within it, but 
it seems that that particular test is just testing the one function.  I'm not 
clear on where the tests actually test the activities of is_cgi or the creation 
of PATH_INFO, if that occurs. What time I've spent working with Python can be 
characterized as 99% application, 0.999% Python source to figure out how things 
work (or fail), .001% test environment (just now). So I'm pretty ignorant of 
the test environment, although I've spent 30+ years programming, only about 4 
has been in Python, and that not full time.

It is not clear to me, though, that the test you added:

'/cgi-bin/file1.py/PATH-INFO': ('/cgi-bin', 'file1.py/PATH-INFO'),

should be the expected results of _url_collapse_path_split... 

I would expect 

'/cgi-bin/file1.py/a/b/c/../../d': ('/cgi-bin/file1.py/a', 'd'),

but I don't think it would, with your present patch. It looks like it would 
return ('/cgi-bin', 'file1.py/a/b/c/../../d') which reintroduces the security 
problem: the '..' stuff has not been processed. I haven't applied your patch to 
actually run it, this is just from inspection, and I may have missed something.

--

___
Python tracker 

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



[issue14313] zipfile does not unpack files from archive (files extracted have zero length)

2012-03-16 Thread Glenn Linderman

Glenn Linderman  added the comment:

While Amaury's comment is no doubt true, shouldn't z.read raise an exception if 
it encounters an unsupported compression type?

--
nosy: +v+python

___
Python tracker 

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



[issue14332] Better explain "junk" concept in difflib doc

2012-03-16 Thread Weronika Patena

Weronika Patena  added the comment:

Ah, I see. True, the ndiff docstring doesn't actually explain what junk IS - I 
was just engaging in wishful thinking and assuming it did the thing I wanted.  
A better explanation would help.

--

___
Python tracker 

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



[issue14325] Stop using the garbage collector to manage the lifetime of the getargs.c freelist

2012-03-16 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset d08f0f3ab23e by Benjamin Peterson in branch 'default':
plug memory leak (closes #14325)
http://hg.python.org/cpython/rev/d08f0f3ab23e

--
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



[issue14245] float rounding examples in FAQ are outdated

2012-03-16 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

The last version in the message above looks good to me. Ready to markup and 
apply?

--
keywords: +patch
nosy: +terry.reedy
stage:  -> patch review

___
Python tracker 

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



[issue14250] for string patterns regex.flags is never equal to 0

2012-03-16 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
stage: needs patch -> patch review

___
Python tracker 

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



[issue14336] Difference between pickle implementations for function objects

2012-03-16 Thread sbt

New submission from sbt :

When pickling a function object, if it cannot be saved as a global the C 
implementation falls back to using copyreg/__reduce__/__reduce_ex__.

The comment for the changeset which added this fallback claims that it is for 
compatibility with the Python implementation.  See

   http://hg.python.org/cpython/rev/c6753db9c6af

However, the current python implementations do not have any such fallback.

This affects both 2.x and 3.x.

For example

Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on 
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pickle, cPickle, copy_reg
>>> def f():
...   pass
...
>>> _f = f
>>> del f
>>> copy_reg.pickle(type(_f), lambda obj: (str, ("FALLBACK",)))
>>> cPickle.dumps(_f)
"c__builtin__\nstr\np1\n(S'FALLBACK'\np2\ntp3\nRp4\n."
>>> pickle.dumps(_f)
Traceback (most recent call last):
  File "", line 1, in 
  File "c:\Python27\lib\pickle.py", line 1374, in dumps
Pickler(file, protocol).dump(obj)
  File "c:\Python27\lib\pickle.py", line 224, in dump
self.save(obj)
  File "c:\Python27\lib\pickle.py", line 286, in save
f(self, obj) # Call unbound method with explicit self
  File "c:\Python27\lib\pickle.py", line 748, in save_global
(obj, module, name))
pickle.PicklingError: Can't pickle : it's not found 
as __main__.f

I don't know what should be done.  I would be tempted to always fall back to 
copyreg/__reduce__/__reduce_ex__ when save_global fails (not just for function 
objects) but that might make error messages less helpful.

--
components: Library (Lib)
messages: 156069
nosy: sbt
priority: normal
severity: normal
status: open
title: Difference between pickle implementations for function objects
type: behavior
versions: Python 2.7, Python 3.3

___
Python tracker 

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



[issue14297] Custom string formatter doesn't work like builtin str.format

2012-03-16 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

We know that string.Formatter does not properly duplicate str.format.
#13598 is specifically about use of {}.
Search "string Formatter" for other related issues.

--
nosy: +terry.reedy
resolution:  -> duplicate
status: open -> closed
superseder:  -> string.Formatter doesn't support empty curly braces "{}"

___
Python tracker 

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



[issue14337] test_builtin: refleaks

2012-03-16 Thread Stefan Krah

New submission from Stefan Krah :

I don't see immediately why, but since 3877bf2e323 test_builtin and
a couple of other tests leak in refcounting mode:


hg up 8a5742b7a14d
make distclean && ./configure --with-pydebug && make
./python -m test -uall -R ::  test_builtin
[1/1] test_builtin
beginning 9 repetitions
123456789
.
1 test OK.
[154630 refs]


hg up 3877bf2e323
make distclean && ./configure --with-pydebug && make
./python -m test -uall -R :: test_builtin
[1/1] test_builtin
beginning 9 repetitions
123456789
.
test_builtin leaked [880, 880, 880, 880] references, sum=3520
1 test failed:
test_builtin
[163380 refs]

--
components: Tests
messages: 156071
nosy: benjamin.peterson, skrah
priority: normal
severity: normal
status: open
title: test_builtin: refleaks
type: resource usage
versions: Python 3.3

___
Python tracker 

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



[issue14337] test_builtin: refleaks

2012-03-16 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Yes, see 9e7f6ddc0d76 for the fix.

--
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



[issue14331] Python/import.c uses a lot of stack space due to MAXPATHLEN

2012-03-16 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

It looks like MAXPATHLEN is 4096 on our systems.  The offending code that 
caused a stack overflow segfault shows over 100 Python/import.c function calls 
in its backtrace.

--

___
Python tracker 

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



[issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO

2012-03-16 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue14306] try/except block is both efficient and expensive?

2012-03-16 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I think it would be sufficient to add ' if no exceptions are raised' to the 
first sentence. The example that follows in the entry clarifies the 
implications of "cheap to try, expensive to catch".

--
keywords: +patch
nosy: +terry.reedy

___
Python tracker 

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



[issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO

2012-03-16 Thread R. David Murray

R. David Murray  added the comment:

Thanks for the patch.

I think this is fine.

An alternate approach would be to introduce the concept of a state (like 
imaplib has), have a list of which commands are allowed in which state, and 
implement the check in the command processing function, but that may not be 
worth it at smtpd's current level of complexity.

One change I'd like to see in the patch (and test): postfix in this case 
responds:

  503 Error: send HELO/EHLO first

And I think that is more useful than the text 'Bad sequence of commands'.

--
nosy: +r.david.murray
stage:  -> patch review

___
Python tracker 

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



[issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO

2012-03-16 Thread R. David Murray

R. David Murray  added the comment:

Oh, by the way the mention of EHLO in that message depends on issue 8739 going 
in.

--

___
Python tracker 

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



[issue14337] Recent refleaks

2012-03-16 Thread Stefan Krah

Stefan Krah  added the comment:

Ah, thanks for the pointer. 9e7f6ddc0d76 is clean, but default still
leaks. Next attempt:


OK: d2460ff173ff
Leak: 3b2856d8614b


test_dict leaked [12, 12] references, sum=24
test_builtin leaked [24, 24] references, sum=48
test_unittest leaked [970, 970] references, sum=1940
test_doctest leaked [351, 351] references, sum=702
test_doctest2 leaked [50, 50] references, sum=100

--
resolution: out of date -> 
status: closed -> open
title: test_builtin: refleaks -> Recent refleaks

___
Python tracker 

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



[issue14338] urllib2 HowTo for overriding post/3xx behavior.

2012-03-16 Thread beeNuts

Changes by beeNuts :


--
type:  -> enhancement

___
Python tracker 

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



[issue14311] ConfigParser does not parse utf-8 files with BOM bytes

2012-03-16 Thread Łukasz Langa

Łukasz Langa  added the comment:

What you considered a workaround is actually what you should be using faced 
with BOM bytes. This is a broader issue in Python, not necessarily connected 
with ConfigParser or any other library. Also, this has been already reported 
here:

http://bugs.python.org/issue7519

For the UTF-8 BOM context please see:

http://bugs.python.org/issue7651

To solve the actual problem we should really do something about that last issue.

If you have any further questions, please ask. If not, I will close this issue.

--
assignee:  -> lukasz.langa

___
Python tracker 

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



[issue14338] urllib2 HowTo for overriding post/3xx behavior.

2012-03-16 Thread beeNuts

New submission from beeNuts :

Issue #14144, with the title "urllib2 HTTPRedirectHandler not forwarding POST 
data in redirect" was recently closed with these comments: 

"This could be cookbook recipe style example, if it's utility
value is high. I am closing this issue as I feel that the requirement may not 
be addressed by a change. If there is patch for HowTo, we can tackle that in 
another issue. Thank you for contribution."

The decision that documents on this issue were preferable to a patch seems like 
a fair compromise, especially considering that the RFC is decidedly ambiguous.I 
was wondering if the HowTo would be forthcoming? 
It seems to me that the value/utility would certainly be high. I'd submit it 
myself but I'm so new to Python that I don't trust my ability to do it 
correctly. It's something I would find highly useful, though.

--
assignee: docs@python
components: Documentation
messages: 156080
nosy: beerNuts, docs@python
priority: normal
severity: normal
status: open
title: urllib2 HowTo for overriding post/3xx behavior.
versions: Python 3.3

___
Python tracker 

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



[issue14245] float rounding examples in FAQ are outdated

2012-03-16 Thread Mark Dickinson

Mark Dickinson  added the comment:

Fine by me.

Language nitpick:  "approximation to" sounds a bit better to my ears than 
"approximation of"

--

___
Python tracker 

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



[issue14331] Python/import.c uses a lot of stack space due to MAXPATHLEN

2012-03-16 Thread Brett Cannon

Brett Cannon  added the comment:

Cursory glance has the patch LGTM.

--

___
Python tracker 

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



[issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO

2012-03-16 Thread Jason Killen

Jason Killen  added the comment:

On using a different approach: I weighed an approach like that and decided to 
go with what I thought was the clean/simple/easy approach.  If there were more 
commands that smptd.py accepted I would have probably gone with more like what 
you mentioned. 

Change in error text: That's fine with me.  I don't really care what it says.  
I'll make the change and generate a new patch but won't be able to get it done 
until Monday.

Given that the inclusion of EHLO in the error text depends on another patch 
should I include EHLO, and maybe have to remove it later, or leave it out now 
and maybe have to put it in later?  2 patches, maybe, and we can pick when the 
time comes?

So when patches like this get applied?  If that's covered in an FAQ someplace 
please point me to it, I'm interested in some of the details.  I poked around a 
bit but couldn't find what I was looking for.

--

___
Python tracker 

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



[issue14269] SMTPD server does not enforce client starting mail transaction with HELO or EHLO

2012-03-16 Thread R. David Murray

R. David Murray  added the comment:

When do patches get applied?  The general answer is "when someone gets around 
to it" :)

In this particular case the issue 8739 patch is waiting on the resolution of 
its dependency (logging uses smtpd in its tests, and the 8739 patch breaks the 
logging test).  The fix for that issue is a bit ugly, so I haven't decided if 
I'm ready to apply that or not yet.

For now, just leave the EHLO out.  We can then apply this patch, and update the 
8739 patch to include the addition of the EHLO.

--

___
Python tracker 

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



  1   2   >