[issue5811] io.BufferedReader.peek(): Documentation differs from Implementation

2009-06-12 Thread Lucas Prado Melo
Lucas Prado Melo added the comment: There's a problem with my patch... When the size of the data we want to peek is too big ( > buffer_len - start ) the cursor will move, thus there isn't a case where the peek function would work properly (except when we want to peek() just 1 byte). Couldn't we

[issue5811] io.BufferedReader.peek(): Documentation differs from Implementation

2009-06-12 Thread Lucas Prado Melo
Lucas Prado Melo added the comment: Oops I overlooked I minor flaw. A second version. -- Added file: http://bugs.python.org/file14282/peek2.diff ___ Python tracker ___ __

[issue5811] io.BufferedReader.peek(): Documentation differs from Implementation

2009-06-12 Thread Lucas Prado Melo
Lucas Prado Melo added the comment: Hey guys, I did a patch about this one. I didn't do many tests but I guess it is ok (it works like I think it should). What do you think? -- keywords: +patch nosy: +conf Added file: http://bugs.python.org/file14281/peek.diff _

[issue5811] io.BufferedReader.peek(): Documentation differs from Implementation

2009-06-12 Thread Benjamin Peterson
Benjamin Peterson added the comment: I think the argument should be used as a upper bound; I will look at this tomorrow. -- ___ Python tracker ___ ___

[issue5811] io.BufferedReader.peek(): Documentation differs from Implementation

2009-06-12 Thread Nick Coghlan
Nick Coghlan added the comment: Assigned to Benjamin for assessment - this should be considered for rc2 since it's still broken in 3.1: >>> f = open('setup.py', 'rb') >>> len(f.peek(10)) 4096 >>> len(f.peek(1)) 4096 >>> len(f.peek(4095)) 4096 >>> len(f.peek(10095)) 4096 Brought up on python-d

[issue6210] Exception Chaining missing method for suppressing context

2009-06-12 Thread Nick Coghlan
Nick Coghlan added the comment: The current behaviour also doesn't match the spec in PEP 3134, which states the __context__ attribute will only be set by the VM if it hasn't already been set. This is not currently the case, as setting __context__ does not keep the VM from setting it (I also tri

[issue1191964] asynchronous Subprocess

2009-06-12 Thread James Eric Pruitt
James Eric Pruitt added the comment: Hello, I am working on this patch and some additional features for my Google Summer of Code project (subdev.blogspot.com) and will eventually attempt to get the code committed to Python 3.1 or 3.2 and Python 2.7. I will have the unit tests completed shortly a

[issue6208] path separator output ignores shell's path separator: / instead of \

2009-06-12 Thread Nick Coghlan
Nick Coghlan added the comment: I'm not sure Python *can* change its behaviour in this case. How would it know which shell (cmd or msys/cygwin) it was launched from? Also, even if it could figure that out, how would it know whether a particular filename "stringification" with os.path.join() was

[issue6273] Add client side certificate support to httplib

2009-06-12 Thread Jesse Noller
Jesse Noller added the comment: I'm going to close this until I come up with a more complete patch, and target it for 2.7. No reason to keep this in the tracker as-is -- resolution: -> invalid status: open -> closed ___ Python tracker

[issue5641] Local variables not freed when Exception raises in function called from cycle

2009-06-12 Thread Nikolaus Rath
Nikolaus Rath added the comment: I just spend several days figuring out a problem that was caused by this behaviour and in the process I really tried to read everything that relates to destruction of objects and exception handling in Python. Georg, could you give me a pointer where exactly thes

[issue6273] Add client side certificate support to httplib

2009-06-12 Thread Jesse Noller
Jesse Noller added the comment: On Jun 12, 2009, at 5:00 PM, Martin v. Löwis wrote: > > Martin v. Löwis added the comment: > >> The attached patch adds client-side cert support to httplib, as >> well as >> validation. Rather than just commit this, I would like to have >> additional >> r

[issue6275] let unittest.assertRaises() return the exception object caught

2009-06-12 Thread Georg Brandl
Changes by Georg Brandl : -- assignee: -> michael.foord nosy: +michael.foord ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue6275] let unittest.assertRaises() return the exception object caught

2009-06-12 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson : It can be useful, after a unittest.assertRaises() or assertRaisesRegexp() to be able to take a closer look at the exception that was raised. To this end, I propose returning the caught exception from these methods. Additionally, the context manager i

[issue3871] cross and native build of python for mingw32 with distutils

2009-06-12 Thread Roumen Petrov
Changes by Roumen Petrov : Added file: http://bugs.python.org/file14279/python-trunk-20090612-MINGW.patch ___ Python tracker <http://bugs.python.org/issue3871> ___ ___

[issue6127] Unexpected universal newline behavior (newline duplication) in Windows

2009-06-12 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: Patch backported in r73399. Thanks! -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___

[issue6273] Add client side certificate support to httplib

2009-06-12 Thread Martin v . Löwis
Martin v. Löwis added the comment: > The attached patch adds client-side cert support to httplib, as well as > validation. Rather than just commit this, I would like to have additional > review. I wouldn't call the feature "client-side cert support" - client certificates are already supported

[issue6274] subprocess.Popen() may leak file descriptors

2009-06-12 Thread Facundo Batista
New submission from Facundo Batista : If something bad happens between a os.pipe() call is called, and the returned file descriptors are closed, those file descriptors are never closed. In a long lived process this is a problem. Patch (against trunk) to solve this is attached. -- assig

[issue6215] Backport the IO lib to trunk

2009-06-12 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: Could simply merge the changes in r71185 to the PC/ and PCbuild/ directories? -- ___ Python tracker ___ __

[issue6215] Backport the IO lib to trunk

2009-06-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: Someone will probably have to fix the Windows build files, by the way (I can't do it myself). -- status: pending -> open ___ Python tracker ___

[issue6215] Backport the IO lib to trunk

2009-06-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: Done in r73394. -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> pending ___ Python tracker ___ __

[issue3754] minimal cross-compilation support for configure

2009-06-12 Thread Roumen Petrov
Changes by Roumen Petrov : Added file: http://bugs.python.org/file14277/python-trunk-20090612-CROSS.patch ___ Python tracker <http://bugs.python.org/issue3754> ___ ___

[issue5102] urllib2.py timeouts do not propagate across redirects for 2.6.1 (and 3.x?)

2009-06-12 Thread Senthil
Senthil added the comment: Looks reasonable to me. I shall test it and commit the patch. Shall try for tests too. -- assignee: -> orsenthil ___ Python tracker ___ __

[issue5102] urllib2.py timeouts do not propagate across redirects for 2.6.1 (and 3.x?)

2009-06-12 Thread Jeff McNeil
Jeff McNeil added the comment: I ran into this problem this afternoon as well. The same issue appears to exist within the Basic & Digest Auth retry code (though it's much less likely to surface). I wound up making the suggested fixes to my local install so I'm attaching the tiny patch in hopes

[issue6095] os.curdir as the default argument for os.listdir

2009-06-12 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- versions: +Python 3.2 -Python 3.1 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue5596] memory leaks in 3.1

2009-06-12 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: These tests are leaking on my build of r73393: test_docxmlrpc leaked [0, 0, 85, 0, 0, -85, 0, 0, 0, 0] references, sum=0 test_popen leaked [0, 23, -23, 0, 23, 0, -23, 23, -23, 23] references, sum=23 test_urllib leaked [4, 4, 4, 4, 6, 0, 0, 0, 2, 0] refere

[issue6258] distributions built with bdist_msi on 64-bit Windows fail to install correctly

2009-06-12 Thread Jason R. Coombs
Jason R. Coombs added the comment: That's great. Thanks Martin! What about Python 2.6? If the fix is hard to port back to 2.6, perhaps bdist_msi should raise an Unsupported error in 64-bit Python. Let me know if I can help any further. -- ___ Pyt

[issue6135] subprocess seems to use local 8-bit encoding and gives no choice

2009-06-12 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: I propose to add two parameters (encoding, error) to the subprocess.Popen function. - python 2.x could build and return codecs.StreamReader objects - python 3.x would just pass these parameters to io.TextIOWrapper I'll try to come with a patch. -

[issue6258] distributions built with bdist_msi on 64-bit Windows fail to install correctly

2009-06-12 Thread Martin v . Löwis
Martin v. Löwis added the comment: For 2.7 and 3.1, this is now fixed with r73390 and r73391. The trick is to set the Win64 bit in RegLocator also. -- ___ Python tracker ___

[issue6215] Backport the IO lib to trunk

2009-06-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: Updated patch for recent py3k changes. I will commit soon if nobody objects. -- Added file: http://bugs.python.org/file14275/iobackport3.patch ___ Python tracker __

[issue6208] path separator output ignores shell's path separator: / instead of \

2009-06-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: Rupert, your original posts mislabels slash '/' and backslach '\' as the opposite. I have no idea what change you are requesting. Please post a minimal (line or two) code example with actual output and desired output. I do not know if changing os.sep changes

[issue6273] Add client side certificate support to httplib

2009-06-12 Thread Jesse Noller
Jesse Noller added the comment: And yes, I need to finish the doc patch. -- ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue6273] Add client side certificate support to httplib

2009-06-12 Thread Jesse Noller
New submission from Jesse Noller : The attached patch adds client-side cert support to httplib, as well as validation. Rather than just commit this, I would like to have additional review. Also, ideally this could be added to 2.6 maint (it seems like a pretty big hole) as well as 2.7/3.0. The

[issue4180] warnings.simplefilter("always") does not make warnings always show up

2009-06-12 Thread Brett Cannon
Brett Cannon added the comment: I am still on sabbatical so no code review from me. But from the standpoint of making warn_explicit be overloadable, I'm on the fence. I don't mind it happening, but it will be just one more thing we have to support. Since it's Benjamin's code he can make the c

[issue4490] xml/sax/expatreader.py raises AttributeError when run

2009-06-12 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: I found XMLGenerator in xml.sax.saxutils. Attached patch changes expatreader to use that instead. Though I have no idea what the point of this stanza is. I suppose it's to exercise the code, in lieu of some unit tests. It might be better to just delete

[issue4180] warnings.simplefilter("always") does not make warnings always show up

2009-06-12 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: So how about it? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue4182] warnings.warn shows the wrong filename and line number for stacklevel of 0

2009-06-12 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: Perhaps the C implementation should interpret the stacklevel parameter differently so that it is compatible with the Python implementation. The stacklevel value is, after all, a very important part of the interface of warnings.warn, as it is the only way t

[issue6247] should we include argparse

2009-06-12 Thread Steven Bethard
Steven Bethard added the comment: Yeah, the % formatting is an artifact of argparse being around before str.format was available. If argparse became part of the standard library, it might be reasonable to change to str.format formatting instead as part of the move. It would mean that folks woul

[issue2376] Set up "supported"-only buildbot waterfall view

2009-06-12 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: This was done long ago, it seems. -- status: open -> closed ___ Python tracker ___ ___ Python-b

[issue6237] Build errors when using LDFLAGS="-Wl,--no-undefined"

2009-06-12 Thread Funda Wang
Funda Wang added the comment: Regarding python binary target, the actual command when linking is: gcc -pthread -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -lstdc++ - Xlinker -export-dynamic -o python \ Modules/python.o \ -LL. -lpython2.6 -lpthread -ldl -lutil -lm The linking order is wro

[issue6195] Serious regression in doctest in Py3.1rc1

2009-06-12 Thread R. David Murray
R. David Murray added the comment: Fixed in r73389. I am wondering if the monkeypatching of linecache that doctest does could be done away with, but I'm not sure whether it might get used somehow in debug mode (since the comment refers to that). On the other hand, if it does get used, the same

[issue6247] should we include argparse

2009-06-12 Thread Eric Smith
Eric Smith added the comment: It's unfortunate (at least to me, but I know I have a skewed view of this) that the help string in add_argument uses %-formatting when formatting the result. I'd much rather it use str.format(). I see a couple of options: - leave it as-is and live with %-formatting

[issue6237] Build errors when using LDFLAGS="-Wl,--no-undefined"

2009-06-12 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: I can't reproduce it, even after adding "-Wl,--as-needed". Did you activate --enable-shared? I suppose it would do no harm to add the libraries "-lm" to _ctypes_test and audioop, and "-ldl" to _ctypes and dl modules, even if they are not needed in the sta

[issue6260] os.utime should allow None values for ATIME or MTIME

2009-06-12 Thread James
James added the comment: very well, this is a good point. i'm guessing nobody would every accept a patch for upstream utime? (in c) thanks for your comment. -- ___ Python tracker ___

[issue6233] ElementTree (py3k) doesn't properly encode characters that can't be represented in the specified encoding

2009-06-12 Thread Neil Muller
Neil Muller added the comment: > This doesn't give the expected answer for the test above Which is obviously due to not comparing apples with apples, as I should be using a byte-string in the py3k example. >>> import xml.etree.ElementTree as ET >>> e = ET.XML(b"t\xe3t") >>> ET.tostring(e, 'asc

[issue6195] Serious regression in doctest in Py3.1rc1

2009-06-12 Thread R. David Murray
Changes by R. David Murray : Removed file: http://bugs.python.org/file14204/issue6195.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue6254] tarfile unnecessarily requires seekable files

2009-06-12 Thread Lars Gustäbel
Lars Gustäbel added the comment: It is no documentation bug either: tarfile.open() is prominently featured right on the top of the first page of the tarfile module online documentation. tarfile.Tarfile() follows right after it with a short notice that tarfile.open() should better be used instead

[issue6195] Serious regression in doctest in Py3.1rc1

2009-06-12 Thread R. David Murray
Changes by R. David Murray : Removed file: http://bugs.python.org/file14188/doctest-test.diff ___ Python tracker ___ ___ Python-bugs-list maili

[issue6195] Serious regression in doctest in Py3.1rc1

2009-06-12 Thread R. David Murray
R. David Murray added the comment: The problem turned out to be a cut and paste error in my patch. I'm uploading the corrected patch, which passes all tests. -- Added file: http://bugs.python.org/file14272/issue6195.patch ___ Python tracker

[issue6272] Upgrading xml.etree to ElementTree 1.3

2009-06-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: Too late for 3.1 -- nosy: +rhettinger versions: +Python 3.2 -Python 3.1 ___ Python tracker ___ __

[issue6260] os.utime should allow None values for ATIME or MTIME

2009-06-12 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Functions of the os module that expose POSIX functions should have the same interface as the system function; and they should not call other system function. Here, 'None' is accepted for the second argument only because the POSIX utime() function accepts a

[issue6272] Upgrading xml.etree to ElementTree 1.3

2009-06-12 Thread Senthil
Senthil added the comment: Oh wait. I read at effbot.org that ElementTree 1.3 is Alpha Release. Is this the reason for not including it? If it's still unstable, then please ignore this. -- ___ Python tracker __

[issue6272] Upgrading xml.etree to ElementTree 1.3

2009-06-12 Thread Senthil
New submission from Senthil : The current ElementTree package shipped with Python is ElementTree 1.2.6. ElementTree 1.3 has certain good features in handing XPaths which would be a nice addition to the default xml.etree. I don't know why ElementTree 1.2.6 was chosen initially. I don't find any r

[issue6271] mmap: don't close file description if fd=-1

2009-06-12 Thread STINNER Victor
Changes by STINNER Victor : Added file: http://bugs.python.org/file14271/mmap_close.patch ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue6271] mmap: don't close file description if fd=-1

2009-06-12 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file14269/mmap_close.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue6271] mmap: don't close file description if fd=-1

2009-06-12 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file14270/warn.py ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue6271] mmap: don't close file description if fd=-1

2009-06-12 Thread STINNER Victor
Changes by STINNER Victor : Added file: http://bugs.python.org/file14270/warn.py ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue6271] mmap: don't close file description if fd=-1

2009-06-12 Thread STINNER Victor
Changes by STINNER Victor : -- keywords: +patch Added file: http://bugs.python.org/file14269/mmap_close.patch ___ Python tracker ___ __

[issue6271] mmap: don't close file description if fd=-1

2009-06-12 Thread STINNER Victor
New submission from STINNER Victor : Hi, Valgrind just told me that Python calls close(-1) on my_mmap_object.close() for memory mappings. That's because a memory mapping has no (related) file descriptor. Using attached warn.py, you can see the warning using strace: $ strace -e close python warn