[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.py 2>&1|grep -A1 12345
close(12345)= -1 EBADF (Bad file descriptor)
close(4294967295)   = -1 EBADF (Bad file descriptor)
close(12345)= -1 EBADF (Bad file descriptor)

where close(4294967295) means close(-1).

Attached patch fixes this warning.

--
components: Extension Modules
files: warn.py
messages: 89269
nosy: haypo
severity: normal
status: open
title: mmap: don't close file description if fd=-1
versions: Python 2.7, Python 3.1
Added file: http://bugs.python.org/file14268/warn.py

___
Python tracker 

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



[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 

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



[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
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 request for the upgrade.

So opening this one.

--
assignee: effbot
components: Library (Lib), XML
messages: 89270
nosy: effbot, orsenthil
priority: normal
severity: normal
status: open
title: Upgrading xml.etree to ElementTree 1.3
type: feature request
versions: Python 2.7, Python 3.1

___
Python tracker 

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



[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 

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



[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 NULL pointer.

Your need is certainly valid; but such a behavior does not belong to the
os module, which has to remain low-level.

--
nosy: +amaury.forgeotdarc
resolution:  -> rejected
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



[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 

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



[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 

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



[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 mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

--

___
Python tracker 

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



[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 list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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, 'ascii')


Fails without the patch, behaves as expected with the patch.

--

___
Python tracker 

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



[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 

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



[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 standard case.

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[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 forever
- add a different, mutually exclusive parameter,
  like help_ex or help_str
- try to guess whether to use %-formatting or str.format,
  based on inspecting the help string

I'm not really wild about any of these.

I'm still looking through the code, slowly.

--

___
Python tracker 

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



[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 binary-read issue may exist in that
hypothetical code path.

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



[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 wrong. "-lstdc++" is LIBADD, it should appear 
after OBJECTS such as Modules/python.o. The same applies to -pthread.

The command should looks like:
gcc -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Xlinker -export-
dynamic -o python \
Modules/python.o \
-LL. -lpython2.6 -lpthread -ldl  -lutil   -lm  -lstdc++

--

___
Python tracker 

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



[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-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 would have to modify their code to switch from
the current argparse module to the stdlib one, but maybe that's an
acceptable tradeoff. I'm certainly happy to change things to str.format
if that's agreed on.

Thanks again for looking at this.

--

___
Python tracker 

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



[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 to direct the warning
at a piece of code.

If the C implementation doesn't add a frame to the stack, then maybe it
should special case stacklevel=0 (eg, pointing somewhere arbitrary, not
real, and obviously so).  It seems that it already accounts for this
fact for other stacklevel values, as it doesn't exhibit the obvious
off-by-one error one might expect.

Or, close this ticket as won't-fix, if there is no intention of ever
fixing it.

--

___
Python tracker 

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



[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://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 this part of the file
entirely.

--
keywords: +patch
Added file: http://bugs.python.org/file14273/xmlgenerator.patch

___
Python tracker 

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



[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 call to add 
the feature.

--

___
Python tracker 

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



[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 patch is against 2.6 maint.

--
files: py26httplib.patch
keywords: patch
messages: 89288
nosy: jnoller
priority: normal
severity: normal
status: open
title: Add client side certificate support to httplib
type: feature request
versions: Python 2.6, Python 2.7, Python 3.2
Added file: http://bugs.python.org/file14274/py26httplib.patch

___
Python tracker 

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



[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
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 output.  I suspect that what is
printed may be controlled somewhat by the OS.

--
nosy: +tjreedy
versions:  -Python 2.6, Python 3.1

___
Python tracker 

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



[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 

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



[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 

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



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

--
nosy: +amaury.forgeotdarc
stage:  -> needs patch

___
Python tracker 

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



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

--

___
Python tracker 

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



[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] references, sum=24
test_urllib2_localnet leaked [0, 0, 0, 0, 0, 0, 251, -250, 0, 0]
references, sum=1
test_os leaked [0, -26, 26, 0, -26, 26, 0, 23, 0, 0] references, sum=23

--

___
Python tracker 

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



[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
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 that someone finds it useful.

--
keywords: +patch
nosy: +j_mcneil
Added file: http://bugs.python.org/file14276/urllib2_timeouts.diff

___
Python tracker 

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



[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 

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



[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>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

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



[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 

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



[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 

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



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

--
assignee: facundobatista
files: subprocess.py.diff
keywords: patch
messages: 89301
nosy: facundobatista
severity: normal
status: open
title: subprocess.Popen() may leak file descriptors
type: resource usage
versions: Python 2.6, Python 2.7, Python 3.1
Added file: http://bugs.python.org/file14278/subprocess.py.diff

___
Python tracker 

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



[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, and had been for a long time.

What you are adding to httplib is server certificate validation.

I find the patch incomplete, for formal and semantical reasons:
a) it doesn't come with documentation or test suite changes, and
b) it doesn't implement the typical certificate checks that browsers
   do, beyond validating that the certificate is valid - e.g. also
   validating that the certificate is issued to the host you are trying
   to connect to.

API-wise, I'm not sure what the point of passing cert_reqs as a
parameter is - ISTM that, in httplib, if ca_certs is not None, then
cert_reqs should automatically be CERT_REQUIRED (just like it is
in get_server_certificate).

> Also, ideally this could be added to 2.6 maint (it seems like a pretty big 
> hole) 

It's a new feature, so it shouldn't be added to 2.6. Not sure what you
mean by "big hole".

--
nosy: +loewis

___
Python tracker 

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



[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 

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



[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>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 involved with keep the caught exception 
in its exc_value member after it has been successfully thrown (and 
matched)

--
components: Library (Lib)
files: unittest.patch
keywords: easy, needs review, patch, patch
messages: 89304
nosy: krisvale
severity: normal
status: open
title: let unittest.assertRaises() return the exception object caught
type: feature request
versions: Python 2.7
Added file: http://bugs.python.org/file14280/unittest.patch

___
Python tracker 

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



[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
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
>> review.
>
> I wouldn't call the feature "client-side cert support" - client
> certificates are already supported, and had been for a long time.
>
> What you are adding to httplib is server certificate validation.
>
> I find the patch incomplete, for formal and semantical reasons:
> a) it doesn't come with documentation or test suite changes, and
> b) it doesn't implement the typical certificate checks that browsers
>   do, beyond validating that the certificate is valid - e.g. also
>   validating that the certificate is issued to the host you are trying
>   to connect to.
>
> API-wise, I'm not sure what the point of passing cert_reqs as a
> parameter is - ISTM that, in httplib, if ca_certs is not None, then
> cert_reqs should automatically be CERT_REQUIRED (just like it is
> in get_server_certificate).
>
>> Also, ideally this could be added to 2.6 maint (it seems like a  
>> pretty big
>> hole)
>
> It's a new feature, so it shouldn't be added to 2.6. Not sure what you
> mean by "big hole".
>

Thanks, that's why I filed the ticket, it's my first foray into  
patching httplib - I'll go back to the patch drawing board!

--

___
Python tracker 

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



[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 these semantics are
documented?

Thanks!

--
nosy: +Nikratio

___
Python tracker 

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



[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 

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



[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 intended
for display to the user or to be passed to a Windows API?

--
nosy: +ncoghlan

___
Python tracker 

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



[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 and will post a patch for
Python 2.7 and / or Python 3.1rc1.

--
nosy: +ericpruitt

___
Python tracker 

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



[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 tried this setting __context__ to 1 - it was
still overridden):

>>> try:
...   1/0
... finally:
...   exc = RuntimeError()
...   exc.__context__ = None
...   raise exc
...
Traceback (most recent call last):
  File "", line 2, in 
ZeroDivisionError: int division or modulo by zero

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 6, in 
RuntimeError

The "raise ... from ..." syntax is not the correct syntax to use
however, since that relates the __cause__ atribute rather than __context__.

A better approach may be to provide a "sys.clear_exc_info()" method in
the sys module to allow exceptions to be raised from exception handlers
without any __context__ information.

A somewhat clumsy workaround that will work with current Python 3 is to
defer raising the exception until after the exception handler has
finished execution:

>>> exc = None
>>> try:
...   1/0
... except:
...   exc = RuntimeError()
...
>>> if exc is not None: raise exc
...
Traceback (most recent call last):
  File "", line 1, in 
RuntimeError

--
nosy: +ncoghlan

___
Python tracker 

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



[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-dev in this thread:
http://mail.python.org/pipermail/python-dev/2009-June/089986.html

And previously here:
http://mail.python.org/pipermail/python-dev/2009-April/088229.html

The thread from April suggests the current behaviour may be intentional,
in which case it is the documentation that needs to be fixed, as it is
currently not just misleading but flat out wrong. Then again, Benjamin's
initial response to that thread was to support the idea of changing
peek() so that the argument actually was a cap.

The previous documentation that Alexandre quotes in the April was
changed to the current description in late April without any
corresponding change to the implementation:
http://svn.python.org/view/python/branches/py3k/Doc/library/io.rst?r1=62422&r2=62430

However, the old description was also wrong for the io-c implementation
since it just returns the current buffered data from peek, no matter
what argument you pass in.

--
assignee:  -> benjamin.peterson
nosy: +benjamin.peterson, ncoghlan
priority:  -> release blocker

___
Python tracker 

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



[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 

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



[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

___
Python tracker 

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



[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 

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



[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 use a read() followed by a seek() instead?

--

___
Python tracker 

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