[issue8033] sqlite: broken long integer handling for arguments to user-defined functions

2011-01-05 Thread Éric Araujo

Changes by Éric Araujo :


--
components: +Extension Modules -Library (Lib)
stage: needs patch -> unit test needed
versions: +Python 2.7, Python 3.2 -Python 2.6

___
Python tracker 

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



[issue10834] Python 2.7 x86 fails to run in Windows 7

2011-01-05 Thread Peter Heiberg

New submission from Peter Heiberg :

I recently installed Win7 on my laptop, and installed the x86 Python 2.7 
package.  IDLE fails to even start, and shows nothing but a process in task 
manager.  I've tried compatibility modes both to Vista and XPSP2, with no luck.

I ran 2.7 x86 on the same laptop in XPSP2, and I am also able to run 2.7 x86 on 
another computer using the exact same version of Win7.

Command line works fine, by the way.

--
components: None
messages: 125415
nosy: excubated
priority: normal
severity: normal
status: open
title: Python 2.7 x86 fails to run in Windows 7
type: crash
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



[issue10130] Create epub format docs and offer them on the download page

2011-01-05 Thread Georg Brandl

Georg Brandl  added the comment:

Thanks, I've committed this as r87760 and r87761.

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



[issue2193] Cookie Colon Name Bug

2011-01-05 Thread John J Lee

John J Lee  added the comment:

karl: I'm not clear precisely what it is that you want to draw our attention 
to.  Note this bug is about parsing of Cookie headers by servers, not 
production of Set-Cookie headers by servers.

--

___
Python tracker 

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



[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2011-01-05 Thread Nick Coghlan

Nick Coghlan  added the comment:

Added Travis to nosy list - even if he doesn't have time to finish this off 
himself, hopefully he can point us in the right direction.

--
nosy: +teoliphant

___
Python tracker 

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-05 Thread R. David Murray

R. David Murray  added the comment:

Yeah, the documentation for the email stuff is in the dev docs.  There's a 
short summary in the changes section of the email intro with links to the 
classes and methods that are affected.  But basically you call BinaryFeedParser 
and feed it a binary data, and everything else works just like it did before, 
including the fact that get_payload() with no arguments returns a string.  If 
there is non-ASCII data in that string and no charset was specified the binary 
data will get trashed though.  To get the binary data out you call it with 
decode=True.

I believe you are right that the io module does not support intermixing calls 
to the main object and its buffer attribute; that's why detach was introduced, 
I believe.  Antoine is nosy on this issue now; he can correct me if I'm wrong.

So unfortunately I think we do need to come at this starting from binary at the 
beginning and *decoding* as needed (I believe http uses latin-1 when no charset 
is specified, but I need to double check that).  That still leaves the problem 
of what if anything to do about existing programs that expect every value in a 
FieldStorage to be a string.  Introduce a new method or parameter for getting 
the binary version of the value, possibly with some flag indicating that 
parsing detected non-ascii data?

--

___
Python tracker 

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



[issue10835] sys.executable default and altinstall

2011-01-05 Thread Allan McRae

New submission from Allan McRae :

when sys.executable is run with a modified argv[0] such as:

> sh -c "exec -a '' /usr/bin/python2.7 -c 'import sys; print(sys.executable)'"

it returns some a hardcoded value.   In this case, it returns /usr/bin/python.  
 This value is likely wrong when python is installed with "make altinstall".

A possible solution is to modify the "progname" variable in Python/pythonrun.c 
to include the version in it so that the hardcoded return value is the most 
version specific binary.  I.e.

static char *progname = "python2.7";

--
components: Interpreter Core
messages: 125420
nosy: allan
priority: normal
severity: normal
status: open
title: sys.executable default and altinstall
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3

___
Python tracker 

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



[issue8033] sqlite: broken long integer handling for arguments to user-defined functions

2011-01-05 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

- unit tests are needed.
- Py_LONG_LONG should be used instead of "long long", and the cast removed.
- The patch assumes that longlong == int64, but is it true on all platforms?

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue10833] Replace %.100s by %s in PyErr_Format(): the arbitrary limit of 500 bytes is outdated

2011-01-05 Thread Eric Smith

Eric Smith  added the comment:

I always thought that one of the reasons for specifying the length was in case 
a pointer pointed to garbage: at least you'd be limiting how much trash was 
printed. But maybe that's just my imagination and there is no such reason.

--
nosy: +eric.smith

___
Python tracker 

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



[issue2193] Cookie Colon Name Bug

2011-01-05 Thread karl

karl  added the comment:

John: Ah sorry, if I misunderstood. The bug seems to say that it is about the 
Cookie Name and legal chars for this cookie name. What I was trying to say is 
that the processing of the Cookie Name is different depending if you are a 
client or a server *and* that there is a specification being developed by Adam 
Barth (part of browser vendors) to obsolete RFC 2109. 

In the case of Server sending to the Client
Set-Cookie: Name=Value

The rules for production of the cookies must be strict. Always. aka the module 
is used for creating a cookie and indeed the "colon" character is forbidden. 
The "token" syntax for valid chars and invalid chars are defined now in 
RFC2696. It means that any US-ASCII characters EXCEPT those are authorized: 

control characters (octets 0-31) and DEL (octet 127) and, the following 
characters “(“, “)”, “<”, “>”, �...@”, “,”, “;”, “:”, “", “/”, “[“, “]”, “?”, 
“=”, “{“, “}”, the double quote character itself, US-ASCII SP (octet 32) or the 
tabulation (octet 9)

Then if you use the Cookie Module for a client it is not anymore the same story.


In the case of Client storing the value of the cookie sent by a server.
See the section "5.2.  The Set-Cookie Header", 
http://tools.ietf.org/html/draft-ietf-httpstate-cookie-20#section-5.2

quote:
  
If the user agent does not ignore the Set-Cookie header
field in its entirety, the user agent MUST parse the
field-value of the Set-Cookie header field as a
set-cookie-string (defined below).

NOTE: The algorithm below is more permissive than the
grammar in Section 4.1. For example, the algorithm strips
leading and trailing whitespace from the cookie name and
value (but maintains internal whitespace), whereas the
grammar in Section 4.1 forbids whitespace in these
positions. User agents use this algorithm so as to
interoperate with servers that do not follow the
recommendations in Section 4."

/quote

then the algorithm is described. Which means that what the server will parse 
will not be necessary what the server have generated. 

Section 5.4 says how the Cookie Header should be sent to the server with an 
algorithm for what will receive the server.

John, do you think there is a missing algorithm for parsing the value of cookie 
header when sent by the client?

--

___
Python tracker 

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



[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2011-01-05 Thread Mark Dickinson

Mark Dickinson  added the comment:

Nick, it sounds as though you have an idea of how you think things should be 
working here---perhaps you can help me out.  I'd really like to understand what 
the implementation should look like from the POV of a 3rd party module that 
defines some object exporting the buffer interface.

Here's a specific scenario I'd like to understand:  module foo defines a type 
Foo that implements the buffer protocol.  For simplicity, suppose it's 
exporting 1-dim buffers. When I do:

>>> from foo import Foo
>>> foo_object = Foo()
>>> m = memoryview(foo_object)
>>> n = m[::2]  # take a slice of m
>>> del m   # delete the objects, in whichever order.
>>> del n

what's the sequence of getbuffer and releasebuffer calls that foo_object should 
expect to see?

Q1. Does foo get 2 requests to getbuffer (and 2 to releasebuffer), or just one 
each?  I'm assuming at least that getbuffer and releasebuffer calls should be 
paired.

Q2. For each pair of getbuffer/releasebuffer calls, should the 'view' parameter 
passed into releasebuffer be identical to that provided to getbuffer?  Or is it 
acceptable for the actual Py_buffer* pointers to be distinct, but the 
pointed-to Py_buffers to be exact copies.  (The existence of the smalltable 
field complicates the notion of an exact copy a little bit, but I think that's 
a detail that can be ignored for these questions.)

--

___
Python tracker 

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



[issue4489] shutil.rmtree is vulnerable to a symlink attack

2011-01-05 Thread Ross Lagerwall

Ross Lagerwall  added the comment:

Here is a draft patch.

It uses the *at functions and fdlistdir consequently it only makes it safe if 
those functions are available. It works using a recursive implementation and an 
open file descriptor pointing to a directory, instead of maintaining state by 
changing the current directory. If the *at functions are unavailable, it falls 
back to the unsafe implementation.

It requires the patches from issue4761 and issue10755 to work.

--
nosy: +rosslagerwall
Added file: http://bugs.python.org/file20274/i4489.patch

___
Python tracker 

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-05 Thread Éric Araujo

Éric Araujo  added the comment:

> I believe you are right that the io module does not support intermixing calls 
> to the main object and its buffer attribute

I’ve learned in a recent discussion on web-sig that you can mix them, provided 
that you call stream.flush() before using stream.buffer.

--

___
Python tracker 

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



[issue2193] Cookie Colon Name Bug

2011-01-05 Thread John J Lee

John J Lee  added the comment:

Again, I don't think this is relevant, because the bug is about servers parsing 
Cookie: headers.  Note that that string (the value of the Cookie: header) may 
be generated by a different server than the server that parses it (see the trac 
example mentioned in the bug comments).

--

___
Python tracker 

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> I believe you are right that the io module does not support intermixing 
> calls to the main object and its buffer attribute; that's why detach
> was introduced, I believe.

Writing is ok as long as you call flush() on the text layer when necessary. 
Reading is not since there's no official way to flush the input buffer on the 
text layer (assuming some input has been consumed, that is). detach() doesn't 
do anything special AFAIR.

(this is all funny in the light of the web-sig discussion where people explain 
that CGI is such a natural model)

--

___
Python tracker 

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



[issue4489] shutil.rmtree is vulnerable to a symlink attack

2011-01-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Thanks for the patch.

There seems to be a race remaining here:

+try:
+if os.path.islink(path):
+# symlinks to directories are forbidden, see bug #1669
+raise OSError("Cannot call rmtree on a symbolic link")
+except OSError:
+onerror(os.path.islink, path, sys.exc_info())
+# can't continue even if onerror hook returns
+return
+fd = os.open(path, os.O_RDONLY)

Someone could change `path` to be a symlink between the calls to islink() and 
open(). You probably need to stat the fd instead.

Some other things:
- if close() is meant to be a private helper, it should be named _close()
- instead of a bare "except" in close(), use "except EnvironmentError" or 
"except OSError"

I haven't looked at the tests yet.

--
stage: needs patch -> patch review
versions:  -Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

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



[issue4489] shutil.rmtree is vulnerable to a symlink attack

2011-01-05 Thread Ralf Schmitt

Changes by Ralf Schmitt :


--
nosy: +schmir

___
Python tracker 

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



[issue10834] Python 2.7 x86 fails to run in Windows 7

2011-01-05 Thread Brian Curtin

Brian Curtin  added the comment:

Can you start IDLE from the command line and see if there is any output?

c:\python27\python.exe -m idlelib.idle

--
components: +Windows -None
nosy: +brian.curtin
type: crash -> behavior

___
Python tracker 

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



[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2011-01-05 Thread Nick Coghlan

Nick Coghlan  added the comment:

PEP 3118 makes it clear that the underlying object should see *two* pairs of 
calls to the buffer methods:
http://www.python.org/dev/peps/pep-3118/#the-py-buffer-struct

Even if we ignore the undocumented "obj" field, the target object needs to 
ensure the exported buffer remains valid as long as any memory views are 
referencing it. The only way to do that is to treat GetBuffer/ReleaseBuffer as 
the moral equivalent of INCREF/DECREF.

However, I believe the current memoryview implementation does the wrong thing 
and only calls them once, and then duplicates the Py_buffer structures without 
ever going back to the original objects (that opinion was based on a quick scan 
of the code a while back, but it would fit with the uncomplimentary sentiments 
Antoine has expressed in trying to get all this to exhibit some kind of 
consistency)

For point 2, it must be the same pointer. When the PEP says "the same", I agree 
it could be taken as ambiguous, but the later reference to the exporter 
managing a linked-list of exported views makes it clear that identity is what 
matters.

As far as I can see, some of things in the PEP were found to be a PITA in 
practice (such as every consumer of the API having to implement the equivalent 
of the "base" attribute in the original memoryview design), so Travis changed 
them. Unfortunately, those changes never made it back into the protocol 
documentation, leading to the current confusion.

--

___
Python tracker 

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



[issue10827] Functions in time module should support year < 1900 when accept2dyear = 0

2011-01-05 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

Attached patch, issue10827b.diff, fixes the accept2dyear = True issue and 
removes unnecessary struct_time to tuple conversion, but otherwise does not 
change the Y2K behavior.  The code handling accept2dyear is refactored so that 
it is now easy to accept y < 1900 in accept2dyear = False mode.  The patch also 
includes unit tests.

--
stage:  -> commit review
Added file: http://bugs.python.org/file20275/issue10827b.diff

___
Python tracker 

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



[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2011-01-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> However, I believe the current memoryview implementation does the
> wrong thing and only calls them once, and then duplicates the
> Py_buffer structures without ever going back to the original objects
> (that opinion was based on a quick scan of the code a while back, but
> it would fit with the uncomplimentary sentiments Antoine has expressed
> in trying to get all this to exhibit some kind of consistency)

Actually, and unless I made a mistake, it does call them twice.
(and does the slicing by hand afterwards, which explains part of the
hilarity with smalltable and friends :-))

> For point 2, it must be the same pointer. When the PEP says "the
> same", I agree it could be taken as ambiguous, but the later reference
> to the exporter managing a linked-list of exported views makes it
> clear that identity is what matters.

The common idiom (including in code not written by me :-)) is currently
to use Py_buffer variables allocated on the C stack.

Also, we have the C API function PyMemoryView_FromBuffer() which
basically mandates that Py_buffer structs can be copied around. And it's
a very useful function since it allows to create a memoryview from a
chunk of anonymous memory.

--

___
Python tracker 

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



[issue5485] pyexpat has no unit tests for UseForeignDTD functionality

2011-01-05 Thread Sandro Tosi

Sandro Tosi  added the comment:

Ok, I've changed the version field and refreshed the patch against py3k.

--
versions: +Python 3.3 -Python 2.7
Added file: http://bugs.python.org/file20276/issue5485-py3k.patch

___
Python tracker 

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



[issue4489] shutil.rmtree is vulnerable to a symlink attack

2011-01-05 Thread Ross Lagerwall

Ross Lagerwall  added the comment:

Updated patch removes the race condition. Since an open follows symlinks, you 
can't just fstat the fd to see if it is a link. I followed the following to 
overcome this:
https://www.securecoding.cert.org/confluence/display/seccode/POS35-C.+Avoid+race+conditions+while+checking+for+the+existence+of+a+symbolic+link

--
Added file: http://bugs.python.org/file20277/i4489_v2.patch

___
Python tracker 

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



[issue4489] shutil.rmtree is vulnerable to a symlink attack

2011-01-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Le mercredi 05 janvier 2011 à 16:58 +, Ross Lagerwall a écrit :
> Ross Lagerwall  added the comment:
> 
> Updated patch removes the race condition. Since an open follows symlinks, you 
> can't just fstat the fd to see if it is a link. I followed the following to 
> overcome this:
> https://www.securecoding.cert.org/confluence/display/seccode/POS35-C.+Avoid+race+conditions+while+checking+for+the+existence+of+a+symbolic+link

Nice. I am unsure about the following piece of code:

+if stat.S_ISDIR(mode):
+if stat.S_ISLNK(mode):
+try:
+raise OSError("Cannot call rmtree on a symbolic
link")
+except OSError:
+onerror(os.fstatat, (dirfd, name), sys.exc_info())

If rmtree() encounters a symlink *inside* the tree, I would expect it to
simply remove the symlink, rather than choke and abort (it's also what
the unsafe implementation does).

--

___
Python tracker 

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



[issue7995] On Mac / BSD sockets returned by accept inherit the parent's FD flags

2011-01-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Ok, here is a patch which prefers the default timeout (if set) over fixing of 
inherited flags. Tested under Linux, Windows, OpenSolaris.

--
Added file: http://bugs.python.org/file20278/nonblock3.patch

___
Python tracker 

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



[issue2193] Cookie Colon Name Bug

2011-01-05 Thread karl

karl  added the comment:

agreed. :)

Then my question about parsing rules for libraries. Is interoperability a plus 
here.

--

___
Python tracker 

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



[issue2193] Cookie Colon Name Bug

2011-01-05 Thread John J Lee

John J Lee  added the comment:

Yes, interoperability is good.  Do you have a specific concern about the change 
that I proposed?

If not, and you're instead just trying to ensure conformance, by all means read 
the draft specification that you pointed out and look for reasons why my 
suggested change would be the wrong thing to do -- that would certainly be 
useful.  Otherwise, it's hard to respond to non-specific "are you doing the 
right thing" questions with anything other than "yes" ;-)

--

___
Python tracker 

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



[issue2193] Cookie Colon Name Bug

2011-01-05 Thread John J Lee

John J Lee  added the comment:

Yes, interoperability is good.  Do you have a specific concern about the change 
that I proposed?

If not, and you're instead just trying to ensure conformance, by all means read 
the draft specification that you pointed out and look for reasons why my 
suggested change would be the wrong thing to do -- that would certainly be 
useful.  Otherwise, it's hard to respond to non-specific "are you doing the 
right thing" questions with anything other than "yes" ;-)

--

___
Python tracker 

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



[issue8499] Set a timeout in test_urllibnet

2011-01-05 Thread Sandro Tosi

Sandro Tosi  added the comment:

This was already fixed (in an unrelated commit) with r85630 and prevoious, so 
I'm marking this issue as closed.

--
nosy: +sandro.tosi
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



[issue6532] thread.get_ident() should return unsigned value

2011-01-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Well, the issue is that signedness differs depending on the platform. Under 
Windows, thread ids are signed (DWORD). Satisfying all cases would complicate 
things quite a bit.

--
nosy: +gregory.p.smith, pitrou, rnk

___
Python tracker 

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



[issue6532] thread.get_ident() should return unsigned value

2011-01-05 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

no, DWORD is a 32-bit unsigned integer
http://msdn.microsoft.com/en-us/library/aa383751(VS.85).aspx

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue10835] sys.executable default and altinstall

2011-01-05 Thread R. David Murray

R. David Murray  added the comment:

Another alternative might be to return "None" ("refuse the temptation to 
guess").  But, given the long standing nature of the current guessing, having 
it return the specific version string may indeed make sense.

--
keywords: +easy
nosy: +r.david.murray
stage:  -> unit test needed
type:  -> behavior
versions:  -Python 2.5, Python 2.6, Python 3.3

___
Python tracker 

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



[issue6532] thread.get_ident() should return unsigned value

2011-01-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> no, DWORD is a 32-bit unsigned integer
> http://msdn.microsoft.com/en-us/library/aa383751(VS.85).aspx

Oops, my bad.

--

___
Python tracker 

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



[issue4489] shutil.rmtree is vulnerable to a symlink attack

2011-01-05 Thread Ross Lagerwall

Ross Lagerwall  added the comment:

I think I misread the original implementation. Here is an updated version with 
that code just taken out.

--
Added file: http://bugs.python.org/file20279/i4489_v3.patch

___
Python tracker 

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



[issue10835] sys.executable default and altinstall

2011-01-05 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue5424] Packed IPaddr conversion tests should be extended

2011-01-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I'm not sure what the point of this patch is, since it's basically testing 
operating system behaviour, rather than Python behaviour. I think that we could 
have a single additional test case for bad inputs and leave it at that.
But in any case, here's the original patch ported to 3.x. Please comment.

--
Added file: http://bugs.python.org/file20280/issue5424.patch

___
Python tracker 

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



[issue10834] Python 2.7 x86 fails to run in Windows 7

2011-01-05 Thread Peter Heiberg

Peter Heiberg  added the comment:

The command line opens, but displays nothing but the white flashing underscore..

--

___
Python tracker 

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



[issue10836] TypeError during exception handling in urllib.request.urlretrieve

2011-01-05 Thread Alexandru Moșoi

New submission from Alexandru Moșoi :

If I try to download a inexistent file I get a TypeError which is thrown during 
exception handling.

>>> import urllib.request
>>> urllib.request.urlretrieve('missing')
Traceback (most recent call last):
  File "/usr/lib/python3.1/urllib/request.py", line 1705, in open_local_file
stats = os.stat(localname)
OSError: [Errno 2] No such file or directory: 'missing'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.1/urllib/request.py", line 133, in urlretrieve
return _urlopener.retrieve(url, filename, reporthook, data)
  File "/usr/lib/python3.1/urllib/request.py", line 1507, in retrieve
fp = self.open_local_file(url1)
  File "/usr/lib/python3.1/urllib/request.py", line 1707, in open_local_file
raise URLError(e.errno, e.strerror, e.filename)
TypeError: __init__() takes at most 3 positional arguments (4 given)

--
components: Library (Lib)
messages: 125449
nosy: Alexandru.Moșoi
priority: normal
severity: normal
status: open
title: TypeError during exception handling in urllib.request.urlretrieve
type: behavior
versions: Python 3.1

___
Python tracker 

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



[issue10834] Python 2.7 x86 fails to run in Windows 7

2011-01-05 Thread Peter Heiberg

Peter Heiberg  added the comment:

I'd like to add that I had the exact same problem on my other laptop running 
Win7 x64, but the same laptop (as mentioned earlier) now runs Win7 x86 and IDLE 
works fine on that.

--

___
Python tracker 

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



[issue10836] TypeError during exception handling in urllib.request.urlretrieve

2011-01-05 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
assignee:  -> orsenthil
nosy: +orsenthil
stage:  -> needs patch
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



[issue10835] sys.executable default and altinstall

2011-01-05 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +barry

___
Python tracker 

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



[issue5485] pyexpat has no unit tests for UseForeignDTD functionality

2011-01-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Doc patch committed in r87762.

--
nosy: +pitrou

___
Python tracker 

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



[issue5485] pyexpat has no unit tests for UseForeignDTD functionality

2011-01-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Ok, I've changed "assertEquals" to "assertEqual" and committed the tests in 
r87765. Thank you!

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



[issue4489] shutil.rmtree is vulnerable to a symlink attack

2011-01-05 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
dependencies: +Add posix.fdlistdir, create Python wrappers for openat() and 
others

___
Python tracker 

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



[issue7995] On Mac / BSD sockets returned by accept inherit the parent's FD flags

2011-01-05 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> Ok, here is a patch which prefers the default timeout (if set) over fixing of 
> inherited flags. Tested under Linux, Windows, OpenSolaris.

This patch looks fine to me. Please also update the accept documentation
to explain the situation (new socket gets
default timeout if given, else is blocking if server socket
has timeout, else inherits flags according to system defaults).

I then think that gettimeout is also incorrect: it really
fetch the O_NONBLOCK flag from the socket.

--

___
Python tracker 

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



[issue10812] Add some posix functions

2011-01-05 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

The patch contains a lot of repeated boilerplate code.  I wonder if some of it 
can be factored out and reused.  For example iov buffer allocation code appears 
to be identical in writev and readv.

--
nosy: +belopolsky

___
Python tracker 

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



[issue8033] sqlite: broken long integer handling for arguments to user-defined functions

2011-01-05 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Alternatively, val_int should have type sqlite3_int64, which is the return type 
of sqlite3_value_int64.

--
nosy: +loewis

___
Python tracker 

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



[issue10350] errno is read too late

2011-01-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

The patch seems a bit confused at times. For example, you need to restore errno 
before calling PyErr_SetFromErrno().
Here is a new patch for py3k.

--
nosy: +pitrou
Added file: http://bugs.python.org/file20281/late_errno.patch

___
Python tracker 

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



[issue10834] Python 2.7 x86 fails to run in Windows 7

2011-01-05 Thread Brian Curtin

Brian Curtin  added the comment:

Have you confirmed that the IDLE window isn't just opened behind another window 
or possibly minimized? I don't know the cause of this, but a coworker has seen 
a few times where IDLE will open but it isn't the main focused window (hiding 
behind a full-screen browser, for instance).

I haven't been able to reproduce this on any of the versions I have here, and 
did a fresh install of 2.7.1 where it also didn't happen. I'm on Windows 7 x64.

--

___
Python tracker 

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



[issue10350] errno is read too late

2011-01-05 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue10835] sys.executable default and altinstall

2011-01-05 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

For Python < 3.2, I think adding the version number alone makes sense.  Can you 
think of any situations where the trailing digits could break something?

For Python 3.2 I'd suggest also adding the build flags to sys.executable.  If 
you want the most specific binary, that would make the most sense.

--

___
Python tracker 

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



[issue10834] Python 2.7 x86 fails to run in Windows 7

2011-01-05 Thread Peter Heiberg

Peter Heiberg  added the comment:

The IDLE window doesn't open, the taskbar shows no icons and IDLE does not show 
up under Task Manager's Application tab..

Also, whenever I open an instance of IDLE, two instances of the .exe shows up 
under the Processes tab:

one instance is completely inactive on CPU use, and uses 9788K of memory,
the other instance runs at 1-2% CPU with a constant 5892K memory usage.

--

___
Python tracker 

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



[issue10834] Python 2.7 x86 fails to run in Windows 7

2011-01-05 Thread Brian Curtin

Brian Curtin  added the comment:

Weird. I'm not sure what could be happening here, and I'm not an IDLE user so I 
don't really have anything else to try out here.

I noticed your email address is for what I think is a Norwegian domain. Is your 
Windows install set to be a language other than English? It may be possible 
that something on startup isn't being encoded/decoded properly. Not really 
sure...

--

___
Python tracker 

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



[issue9419] RUNSHARED needs LDFLAGS

2011-01-05 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

Peter, please explain exactly how you built Python to trigger this bug.  I.e. 
include the exact commands and directories you used.  I cannot reproduce this 
yet.

--

___
Python tracker 

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



[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2011-01-05 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> Martin, we would like to exclude Py_buffer from the stable ABI for
> Python 3.2, until we have a chance to thrash out the missing pieces
> of the documentation for 3.3. I *think* it is a documentation
> problem, but until we're certain, it seems safer to leave it out.

Fine with me. Attached is a patch; it would be good if someone could
confirm that this exactly comprises the API that should be hidden.

--
keywords: +patch
Added file: http://bugs.python.org/file20282/pybuffer.diff

___
Python tracker 

___Index: Include/abstract.h
===
--- Include/abstract.h  (Revision 87765)
+++ Include/abstract.h  (Arbeitskopie)
@@ -488,6 +488,7 @@
 
 /* new buffer API */
 
+#ifndef Py_LIMITED_API
 #define PyObject_CheckBuffer(obj) \
 (((obj)->ob_type->tp_as_buffer != NULL) &&  \
  ((obj)->ob_type->tp_as_buffer->bf_getbuffer != NULL))
@@ -575,6 +576,7 @@
 
/* Releases a Py_buffer obtained from getbuffer ParseTuple's s*.
 */
+#endif /* Py_LIMITED_API */
 
  PyAPI_FUNC(PyObject *) PyObject_Format(PyObject* obj,
 PyObject *format_spec);
Index: Include/object.h
===
--- Include/object.h(Revision 87765)
+++ Include/object.h(Arbeitskopie)
@@ -143,7 +143,7 @@
 typedef int(*ssizessizeobjargproc)(PyObject *, Py_ssize_t, Py_ssize_t, 
PyObject *);
 typedef int(*objobjargproc)(PyObject *, PyObject *, PyObject *);
 
-
+#ifndef Py_LIMITED_API
 /* buffer interface */
 typedef struct bufferinfo {
 void *buf;
@@ -195,6 +195,7 @@
 #define PyBUF_WRITE 0x200
 
 /* End buffer interface */
+#endif /* Py_LIMITED_API */
 
 typedef int (*objobjproc)(PyObject *, PyObject *);
 typedef int (*visitproc)(PyObject *, void *);
Index: Include/memoryobject.h
===
--- Include/memoryobject.h  (Revision 87765)
+++ Include/memoryobject.h  (Arbeitskopie)
@@ -55,9 +55,11 @@
 
 PyAPI_FUNC(PyObject *) PyMemoryView_FromObject(PyObject *base);
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject *) PyMemoryView_FromBuffer(Py_buffer *info);
 /* create new if bufptr is NULL 
 will be a new bytesobject in base */
+#endif
 
 
 /* The struct is declared here so that macros can work, but it shouldn't
Index: PC/python3.def
===
--- PC/python3.def  (Revision 87765)
+++ PC/python3.def  (Arbeitskopie)
@@ -10,13 +10,6 @@
   PyBaseObject_Type=python32.PyBaseObject_Type DATA
   PyBool_FromLong=python32.PyBool_FromLong
   PyBool_Type=python32.PyBool_Type DATA
-  PyBuffer_FillContiguousStrides=python32.PyBuffer_FillContiguousStrides
-  PyBuffer_FillInfo=python32.PyBuffer_FillInfo
-  PyBuffer_FromContiguous=python32.PyBuffer_FromContiguous
-  PyBuffer_GetPointer=python32.PyBuffer_GetPointer
-  PyBuffer_IsContiguous=python32.PyBuffer_IsContiguous
-  PyBuffer_Release=python32.PyBuffer_Release
-  PyBuffer_ToContiguous=python32.PyBuffer_ToContiguous
   PyByteArrayIter_Type=python32.PyByteArrayIter_Type DATA
   PyByteArray_AsString=python32.PyByteArray_AsString
   PyByteArray_Concat=python32.PyByteArray_Concat
@@ -317,7 +310,6 @@
   PyMem_Malloc=python32.PyMem_Malloc
   PyMem_Realloc=python32.PyMem_Realloc
   PyMemberDescr_Type=python32.PyMemberDescr_Type DATA
-  PyMemoryView_FromBuffer=python32.PyMemoryView_FromBuffer
   PyMemoryView_FromObject=python32.PyMemoryView_FromObject
   PyMemoryView_GetContiguous=python32.PyMemoryView_GetContiguous
   PyMemoryView_Type=python32.PyMemoryView_Type DATA
@@ -399,7 +391,6 @@
   PyObject_CallObject=python32.PyObject_CallObject
   PyObject_CheckReadBuffer=python32.PyObject_CheckReadBuffer
   PyObject_ClearWeakRefs=python32.PyObject_ClearWeakRefs
-  PyObject_CopyData=python32.PyObject_CopyData
   PyObject_DelItem=python32.PyObject_DelItem
   PyObject_DelItemString=python32.PyObject_DelItemString
   PyObject_Dir=python32.PyObject_Dir
@@ -412,7 +403,6 @@
   PyObject_GenericSetAttr=python32.PyObject_GenericSetAttr
   PyObject_GetAttr=python32.PyObject_GetAttr
   PyObject_GetAttrString=python32.PyObject_GetAttrString
-  PyObject_GetBuffer=python32.PyObject_GetBuffer
   PyObject_GetItem=python32.PyObject_GetItem
   PyObject_GetIter=python32.PyObject_GetIter
   PyObject_HasAttr=python32.PyObject_HasAttr
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10837] Issue catching KeyboardInterrupt while reading stdin

2011-01-05 Thread Josh Hanson

New submission from Josh Hanson :

Example code:
try:
sys.stdin.read()
except KeyboardInterrupt:
print "Interrupted!"
except:
print "Some other exception?"
finally:
print "cleaning up..."
print "done."

Test: run the code and hit ctrl-c while the read is blocking.
Expected behavior: program should print:
Interrupted!
cleaning up...
done.

Actual behavior: On linux, behaves as expected. On windows, prints:
cleaning up... 
Traceback (most recent call last):
  File "filename.py", line 119, in 
print 'cleaning up...'
KeyboardInterrupt

As you can see, neither of the "except" blocks was executed, and the "finally" 
block was erroneously interrupted.

If I add one line inside the try block, as follows:
try:
sys.stdin.read()
print "Done reading."
... [etc.]

Then this is the output:
Done reading. Interrupted!
cleaning up...
done.

Here, the exception handler and finally block were executed as expected. This 
is still mildly unusual because the "done reading" print statement was reached 
when it probably shouldn't have been, but much more surprising because a 
newline was not printed after "Done reading.", and for some reason a space was.

This has been tested and found in 32-bit python versions 2.6.5, 2.6.6, 2.7.1, 
and 3.1.3 on 64-bit Win7.

--
components: IO, Windows
messages: 125463
nosy: Josh.Hanson
priority: normal
severity: normal
status: open
title: Issue catching KeyboardInterrupt while reading stdin
type: behavior
versions: Python 2.6, 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



[issue10834] Python 2.7 x86 fails to run in Windows 7

2011-01-05 Thread Peter Heiberg

Peter Heiberg  added the comment:

I am running the EN-US version of Win7, with Norwegian regional and keyboard 
settings.  Tried changing everything to EN-US, with no change in results.  Also 
tried deactivating visual themes and desktop composition for the .exe.

What text editor do you personally prefer?  I have tried setting up Notepad++ 
for the job, but I can't seem to get the "Run" function to work properly..

--

___
Python tracker 

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



[issue10834] Python 2.7 x86 fails to run in Windows 7

2011-01-05 Thread Peter Heiberg

Peter Heiberg  added the comment:

Hey, progress!  I ran python.exe, typed "import idlelib.idle", pressed enter - 
same blinking underscore as before.  Then i pressed Ctrl+C, and WHOA, 
python.exe prints 25 lines of something, and the Python Shell (pythonw.exe) 
pops up!

There is no functionality in the Python Shell (=IDLE?) tho, and Ctrl+C'ing the 
window promts me to terminate the running program.

Posting the python.exe output:

>>> import idlelib.idle
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Python27\lib\idlelib\idle.py", line 11, in 
idlelib.PyShell.main()
  File "C:\Python27\lib\idlelib\PyShell.py", line 1403, in main
shell = flist.open_shell()
  File "C:\Python27\lib\idlelib\PyShell.py", line 281, in open_shell
if not self.pyshell.begin():
  File "C:\Python27\lib\idlelib\PyShell.py", line 992, in begin
client = self.interp.start_subprocess()
  File "C:\Python27\lib\idlelib\PyShell.py", line 417, in start_subprocess
self.transfer_path()
  File "C:\Python27\lib\idlelib\PyShell.py", line 499, in transfer_path
\n""" % (sys.path,))
  File "C:\Python27\lib\idlelib\PyShell.py", line 709, in runcommand
self.rpcclt.remotequeue("exec", "runcode", (code,), {})
  File "C:\Python27\lib\idlelib\rpc.py", line 216, in remotequeue
return self.asyncreturn(seq)
  File "C:\Python27\lib\idlelib\rpc.py", line 240, in asyncreturn
response = self.getresponse(seq, wait=0.05)
  File "C:\Python27\lib\idlelib\rpc.py", line 280, in getresponse
response = self._getresponse(myseq, wait)
  File "C:\Python27\lib\idlelib\rpc.py", line 300, in _getresponse
response = self.pollresponse(myseq, wait)
  File "C:\Python27\lib\idlelib\rpc.py", line 424, in pollresponse
message = self.pollmessage(wait)
  File "C:\Python27\lib\idlelib\rpc.py", line 376, in pollmessage
packet = self.pollpacket(wait)
  File "C:\Python27\lib\idlelib\rpc.py", line 347, in pollpacket
r, w, x = select.select([self.sock.fileno()], [], [], wait)
KeyboardInterrupt

--

___
Python tracker 

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



[issue10834] Python 2.7 x86 fails to run in Windows 7

2011-01-05 Thread Brian Curtin

Brian Curtin  added the comment:

Ah! You might want to take a look at #6941. Your firewall might be blocking 
IDLE's communications.

In Windows 7, if you go to Control Panel and search for "firewall" in the top 
right search box, it'll show an option to make an exception for a program.

--

___
Python tracker 

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



[issue10834] Python 2.7 x86 fails to run in Windows 7

2011-01-05 Thread Peter Heiberg

Peter Heiberg  added the comment:

My Windows Firewall have been turned off from the day I installed Win7, so that 
couldn't cause it..  I also tried deactivating UAC, with no luck.  Running with 
administrative privileges, without any results.

--

___
Python tracker 

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



[issue10838] subprocess __all__ is incomplete

2011-01-05 Thread Toshio Kuratomi

New submission from Toshio Kuratomi :

I have a compatibility module for subprocess in python-2.7 for people who are 
stuck on python-2.4 (without check_call) and they got a traceback from trying 
to use compat.subprocess.list2cmdline().

In order to use the stdlib's subprocess if it's of a recent enough version, I 
check the version and import the symbols from there using from subprocess 
import * in the compat module.  Unfortunately, one of the people is using 
list2cmdline() in their code and list2cmdline() is not in __all__.  Comparing 
the output, there's a few things not in __all__ in both python-2.7 and in 
python-3.1:

(From python-2.7, but python-3.1 boils down to the same list):

>>> sorted([d for d in  dir (subprocess) if not d.startswith('_')])
['CalledProcessError', 'MAXFD', 'PIPE', 'Popen', 'STDOUT', 'call', 
'check_call', 'check_output', 'errno', 'fcntl', 'gc', 'list2cmdline', 
'mswindows', 'os', 'pickle', 'select', 'signal', 'sys', 'traceback', 'types']
>>> sorted(subprocess.__all__)
['CalledProcessError', 'PIPE', 'Popen', 'STDOUT', 'call', 'check_call', 
'check_output']

So, MAXFD, list2cmdline, and mswindows seem to be left out.

These could either be made private (prepend with "_"), or added to __all__ to 
resolve this bug.  (I note that searching for "subprocess.any of those three" 
leads to some hits so whether or not they're intended to be public, they are 
being used :-(

--
components: Library (Lib)
messages: 125468
nosy: a.badger
priority: normal
severity: normal
status: open
title: subprocess __all__ is incomplete
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



[issue10835] sys.executable default and altinstall

2011-01-05 Thread R. David Murray

R. David Murray  added the comment:

Well, the digits are there if they are there in the name when that's actually 
what is in argv[0], so as long as that's the name the binary is actually 
installed under I don't think it will break anything.  I presume the same 
applies to the abi flags but haven't checked.

That said, I don't know for sure that progname is the right thing to change; I 
haven't looked through the code to see how sys.executable is generated or if 
there is anything else GetPythonName is used for.

Hmm.  I suppose there could be an issue if Python is invoked through a 
wrapper...I know Gentoo does that, so I've added Arfrever to nosy to see if he 
has an opinion.

--
nosy: +Arfrever

___
Python tracker 

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



[issue10838] subprocess __all__ is incomplete

2011-01-05 Thread Georg Brandl

Georg Brandl  added the comment:

IMO none of these three are meant to be public, and neither are they 
documented.  (Although the docs make a reference to "the list2cmdline 
*method*", which should probably just be removed.)

I remember a thread on python-dev about public-API-ness.  Did we really 
conclude that all non-underscored names must be public and therefore added to 
__all__?

--
nosy: +georg.brandl

___
Python tracker 

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



[issue7995] On Mac / BSD sockets returned by accept inherit the parent's FD flags

2011-01-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Ok, I committed the patch in r87768 and overhauled the timeout docs in r87769. 
I'm not sure this should be backported (because of the very slight behaviour 
change), so I'm closing.

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



[issue10512] regrtest ResourceWarning - unclosed sockets and files

2011-01-05 Thread Nadeem Vawda

Nadeem Vawda  added the comment:

Fix attached for test_imaplib. Most of the warnings were simply due to 
reap_server() not closing the server object correctly. The remaining warning 
was due a genuine leak in imaplib.IMAP4.__init__() - if an exception is raised 
after the connection is opened, the socket is not closed.

--
Added file: http://bugs.python.org/file20283/test_imaplib.diff

___
Python tracker 

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



[issue10839] email module should not allow some header field repetitions

2011-01-05 Thread Adrien Saladin

New submission from Adrien Saladin :

Hi,

The following script shows two problems with email.mime.text.MIMEText:

- first the use of msg['To'] seems confusing because its dictionnary-like 
syntax made me think it acts as a "set or replace", but in fact is working as a 
stream operation
- second this behavior allows for the same field to be repeated several times 
in a header which is discouraged in rfc-822 and forbidden for many fields in 
rfc-2822. 



#"
from email.mime.text import MIMEText

msg = MIMEText("""Hello World""")

dest = ["o...@example.com", "t...@example.com", "th...@example.com", 
"f...@example.com"]
 
for d in dest:
msg["From"] = "mys...@example.com"
msg["To"] = d
msg["subject"] = "just a test"
print (msg)
# + send the buggy mail...
###

the last sent mail will looks like this: 

-
Hello World
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: mys...@example.com
To: o...@example.com
subject: just a test
From: mys...@example.com
To: t...@example.com
subject: just a test
From: mys...@example.com
To: th...@example.com
subject: just a test
From: mys...@example.com
To: f...@example.com
subject: just a test

Hello World
--


I see some possible modifications:

* make the [] operator work as a dictionnary-like syntax. So calling msg['To'] 
multiple times would simply replace the previous 'To:' field. The additional 
constraint is that some fields like 'comments' or 'keywords' can be repeated

* (or) throw an error when some fields are repeated in this list: 
  from,  sender, reply-to, to, cc, bcc, message-id, in-reply-to, references, 
subject

--
components: Library (Lib)
messages: 125473
nosy: adrien-saladin
priority: normal
severity: normal
status: open
title: email module should not allow some header field repetitions
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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-05 Thread Pierre Quentel

Pierre Quentel  added the comment:

I agree that the only consistent solution is to impose that the attribute 
self.fp must read bytes in all cases, all required conversions should occur 
inside FieldStorage, using "some" encoding (not sure how to define it...)

If no argument fp is passed to __init__(), the instance uses the binary version 
of sys.stdin. In my patch I use sys.stdin.buffer, but it also works if I set it 
to sys.stdin.detach()

In all cases the interpreter must be launched with the -u option. As stated in 
the documentation, the effect of this option is to "force the binary layer of 
the stdin, stdout and stderr streams (which is available as their buffer 
attribute) to be unbuffered. The text I/O layer will still be line-buffered.". 
On my PC (Windows XP) this is required to be able to read all the data stream ; 
otherwise, only the beginning is read. I tried Glenn's suggestion with mscvrt, 
with no effect

I am working on the cgi.py module so that all tests (test_cgi and cgi_test) 
pass with binary streams. It's almost finished ; I had to adapt the tests, and 
sometimes fix bugs in them

Problems in test_cgi.py :
- in testQSAndFormData() string "data" should not begin with a line feed
- in testQSAndFormDataFile() : same thing as above + the argument to update 
result should be {'upload': b'this is the content of the fake file\n'} : bytes, 
ending with a line feed as in the string "data"
- in do_test(), for POST method, fp must be a BytesIO
- in test_fieldstorage_multipart(), expected value should be b'Testing 123.\n' 
for the third case (filename is not None, bytes expected, there is a line feed 
in string "data")

Problems in cgi_test.py
- data files mix headers (which should be strings) and POST data which should 
be read as bytes. In setup(), the file is opened in binary mode, the first two 
lines are read to initialize Content-Length and Content-Type, and an attribute 
encoding = 'latin-1' is set
- the tests showed warnings "ResourceWarning: unclosed file <_io.BufferedReader 
name='zenASCII.txt'>", I changed the code to avoid these warnings

I will send the results (diff for new version of cgi + tests) hopefully tomorrow

--

___
Python tracker 

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



[issue10835] sys.executable default and altinstall

2011-01-05 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis  added the comment:

I rather doubt that there will be any problem with Python invoked through a 
wrapper.
Gentoo's python-wrapper isn't used when target executable (e.g. 
/usr/bin/python3.1) is directly called.  A side effect of python-wrapper is 
that sys.executable is the target executable:
$ readlink /usr/bin/python
python-wrapper
$ /usr/bin/python -c 'import sys; print(sys.executable)'
/usr/bin/python3.1
$ /usr/bin/python-wrapper -c 'import sys; print(sys.executable)'
/usr/bin/python3.1
$ sh -c "exec -a '' /usr/bin/python -c 'import sys; print(sys.executable)'"
/usr/bin/python3.1
$ sh -c "exec -a '' /usr/bin/python3.1 -c 'import sys; print(sys.executable)'"
/usr/bin/python

If there is a patch, then I can test it.

--

___
Python tracker 

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



[issue10839] email module should not allow some header field repetitions

2011-01-05 Thread Adrien Saladin

Changes by Adrien Saladin :


--
type:  -> behavior

___
Python tracker 

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



[issue10839] email module should not allow some header field repetitions

2011-01-05 Thread Georg Brandl

Changes by Georg Brandl :


--
assignee:  -> r.david.murray
nosy: +r.david.murray

___
Python tracker 

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



[issue10838] subprocess __all__ is incomplete

2011-01-05 Thread Toshio Kuratomi

Toshio Kuratomi  added the comment:

IIRC, it was more along the lines of: all private names should be underscored.  
The difference being that we get to choose whether currently non-underscored 
names should get underscored, should be deprecated and then underscored, or 
should be made public, put into __all__, and properly documented.

I think there was general agreement that leaving them non-underscored but 
expecting people to treat them as private wasn't a good idea.

--

___
Python tracker 

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



[issue10839] email module should not allow some header field repetitions

2011-01-05 Thread R. David Murray

R. David Murray  added the comment:

The behaviour you observe is by design, and documented.  The email package 
needs to be able to handle RFC-invalid input, which includes messages with 
multiple instances of fields that are supposed to be singletons.  It also needs 
to keep track of the order of headers.  Thus its interface is, as documented, a 
"mapping-like" interface with duplicable keys and an element order.

That said, it would be a valid feature request to have a way to have it 
generate errors if a field that is supposed to be a singleton per-RFC is added 
more than once.  This will require a registry of such headers...a registry of 
headers is planned for the next version of the email package (email6), so that 
would be an appropriate time for this to be implemented.  email6 will also have 
strict and lenient modes, which will also be useful in this context.

--
stage:  -> unit test needed
type: behavior -> feature request
versions: +Python 3.3 -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



[issue1777412] Python's strftime dislikes years before 1900

2011-01-05 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

I would like to push this for 3.2.  Recent discussions at issue10827 and on 
python-dev seem to favor removal of arbitrary limits on year range.

--
nosy: +georg.brandl

___
Python tracker 

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



[issue1777412] datetime.strftime dislikes years before 1900

2011-01-05 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
title: Python's strftime dislikes years before 1900 -> datetime.strftime 
dislikes years before 1900

___
Python tracker 

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



[issue10655] Wrong powerpc define in Python/ceval.c

2011-01-05 Thread Dave Malcolm

Dave Malcolm  added the comment:

FWIW, I just added this patch downstream to Fedora's python 3 builds:
http://pkgs.fedoraproject.org/gitweb/?p=python3.git;a=blob_plain;f=python-3.2b2-fix-ppc-debug-build.patch;hb=5659c63442be2e91eb42e60284d7a9a9ab0b80dd

--

___
Python tracker 

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



[issue10655] Wrong powerpc define in Python/ceval.c

2011-01-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> FWIW, I just added this patch downstream to Fedora's python 3 builds:
> http://pkgs.fedoraproject.org/gitweb/?p=python3.git;a=blob_plain;f=python-3.2b2-fix-ppc-debug-build.patch;hb=5659c63442be2e91eb42e60284d7a9a9ab0b80dd

Any reason not to commit it here?

--

___
Python tracker 

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-05 Thread Glenn Linderman

Glenn Linderman  added the comment:

R. David said:
(I believe http uses latin-1 when no charset is specified, but I need to double 
check that)

See http://bugs.python.org/issue4953#msg121864 ASCII and UTF-8 are what HTTP 
defines. Some implementations may, in fact, use latin-1 instead of ASCII in 
some places.  Not sure if we want Python CGI to do that or not.

Thanks for getting the email APIs in the docs... shouldn't have to bug you as 
much that way :)

Antoine said:
(this is all funny in the light of the web-sig discussion where people explain 
that CGI is such a natural model)

Thanks for clarifying the stdin buffering vs. binary issue... it is as I 
suspected.  Maybe you can also explain the circumstances in which "my" Windows 
code is needed, and whether Python's "-u" does it automatically, but I still 
believe that "-u" shouldn't be necessary for a properly functioning program, 
not even a CGI program... it seems like a hack to allow some programs to work 
without other changes, so might be a useful feature, but hopefully not a 
required part of invoking a CGI program.

The CGI interface is "self describing", when you follow the standards, and use 
the proper decoding for the proper pieces.  In that way, it is similar to 
email.  It is certainly not as simple as using UTF-8 everywhere, but 
compatibility with things invented before UTF-8 even existed somewhat prevents 
the simplest solution, and then not everything is text, either.  At least it is 
documented, and permits full UNICODE data to be passed around where needed, and 
permits binary to be passed around where that is needed, when the specs are 
adhered to.

--

___
Python tracker 

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



[issue10838] subprocess __all__ is incomplete

2011-01-05 Thread Toshio Kuratomi

Toshio Kuratomi  added the comment:

For other's reference, there were three threads in November2010 that touch on 
this:

  :About removing argparse.__all__ or adding more methods to it:
http://mail.python.org/pipermail/python-dev/2010-November/105147.html

  :Removing tk interface in pydoc:
http://mail.python.org/pipermail/python-dev/2010-November/105375.html

The most on topic thread is the one with Subject:
  :[Python-Dev] Breaking undocumented API:
http://mail.python.org/pipermail/python-dev/2010-November/105392.html

People broke threading a few times so you might have to search on the subject.

And ick.  The thread's more of a mess than I remembered.  Reading what Guido 
wrote last it seems like:

All private names should be prepended with "_" .  Imported modules are the 
exception to this -- they're private unless included in __all__.  Reading 
between the lines I think it's also saying that not all public names need to be 
in __all__.

So to resolve this ticket:

1) Is this the actual consensus from the end of those threads?
2) Are the three names mentioned in this ticket public or private?
3a) If private, initiate deprecation and create underscore versions of the 
variables.
3b) If public, documentation and adding to __all__ are good but not necessary.

--

___
Python tracker 

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Antoine said:
> (this is all funny in the light of the web-sig discussion where people
> explain that CGI is such a natural model)
> 
> Thanks for clarifying the stdin buffering vs. binary issue... it is as
> I suspected.  Maybe you can also explain the circumstances in which
> "my" Windows code is needed, and whether Python's "-u" does it
> automatically, but I still believe that "-u" shouldn't be necessary
> for a properly functioning program, not even a CGI program...

Could you open a separate bug with a simple piece of code to reproduce
the issue (preferably without launching an HTTP server :))?

--

___
Python tracker 

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



[issue10512] regrtest ResourceWarning - unclosed sockets and files

2011-01-05 Thread STINNER Victor

STINNER Victor  added the comment:

> Fix attached for test_imaplib

Oh thanks! Commited as r8 and r87778. I just changed the name of the 
subfunction.

--

___
Python tracker 

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



[issue10838] subprocess __all__ is incomplete

2011-01-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> So, MAXFD, list2cmdline, and mswindows seem to be left out.

IMO they should all be prefixed with an underscore. Greg?

--
nosy: +gregory.p.smith, pitrou

___
Python tracker 

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



[issue10838] subprocess __all__ is incomplete

2011-01-05 Thread Antoine Pitrou

Changes by Antoine Pitrou :


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



[issue8458] buildbot: test_cmd_line failure on Tiger: [Errno 9] Bad file descriptor

2011-01-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I'm closing it in the hope that it's fixed. If it reappears, we'll have to 
reopen.

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



[issue10492] test_doctest fails with iso-8859-15 locale

2011-01-05 Thread STINNER Victor

STINNER Victor  added the comment:

> set the trace function later. Eg. replace exec(cmd, ...)
> by code=compile(cmd, ...) + exec(code) and set the trace function 
> after the call to compile.

Implemented in the attached patch, bdb.patch: trace the execution of the code, 
not the compilation of the code.

> I don't know if both codes are equivalent.

I still don't know :-p

--
keywords: +patch
Added file: http://bugs.python.org/file20284/bdb.patch

___
Python tracker 

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



[issue10840] pyarg_parsetuple docs and py_buffer

2011-01-05 Thread Antoine Pitrou

New submission from Antoine Pitrou :

The docs for "s*" and friends should mention that contiguity of the buffer is 
automatically enforced.

--
assignee: d...@python
components: Documentation
messages: 125488
nosy: d...@python, exarkun, mark.dickinson, pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: pyarg_parsetuple docs and py_buffer
versions: Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

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



[issue10840] pyarg_parsetuple docs and py_buffer

2011-01-05 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue10840] pyarg_parsetuple docs and py_buffer

2011-01-05 Thread STINNER Victor

STINNER Victor  added the comment:

See also #8991.

--

___
Python tracker 

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



[issue10840] pyarg_parsetuple docs and py_buffer

2011-01-05 Thread STINNER Victor

STINNER Victor  added the comment:

See also #8215.

--

___
Python tracker 

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



[issue10840] pyarg_parsetuple docs and py_buffer

2011-01-05 Thread STINNER Victor

STINNER Victor  added the comment:

Ah ok, now I remember the story. I cleaned up getargs.c recently. r83197 
(#8991) removes the support of discontinious buffers. I guess that most 
developers don't know what a discontinious buffer is and so they don't support 
this kind of buffer. Moreover, most PyArg_Parse*() formats don't provide 
information about the buffer (how it is stored in memory), and so the caller 
cannot handle discontinious anyway.

I think that even Python code developers don't know what a discontinious buffer 
is... I think that today there is just no program or library using Python 
discontinious buffer. And maybe the authors of the PEP forgot it too :-)

--

___
Python tracker 

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



[issue10492] test_doctest fails with iso-8859-15 locale

2011-01-05 Thread STINNER Victor

STINNER Victor  added the comment:

bdb.patch doesn't work if cmd is not a string (if cmd is a code object).

r87780 fixes this issue: bdb.Bdb.run() only traces the execution of the code, 
not the compilation (if the input is a string).

With this fix, the whole test suite pass on Linux with ISO-8859-1, ISO-8859-15 
and UTF-8 locale encodings (I only tested in an ASCII path).

--

___
Python tracker 

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



[issue10492] test_doctest fails with iso-8859-15 locale

2011-01-05 Thread STINNER Victor

Changes by STINNER Victor :


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



[issue10720] test_threadsignals hang on FreeBSD 6.4

2011-01-05 Thread STINNER Victor

STINNER Victor  added the comment:

test_threadsignals hang on "x86 FreeBSD 3.x" buildbot since at least the 17th 
december (build 1030, r87341).

What is "FreeBSD 6.4"? Another buildbot?

--
nosy: +haypo

___
Python tracker 

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



[issue10720] test_threadsignals hang on FreeBSD 6.4

2011-01-05 Thread STINNER Victor

STINNER Victor  added the comment:

test_threadsignals hang also on "x86 gentoo 3.x" since at least the 17th 
december (build 3681, r87348).

--

___
Python tracker 

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



[issue10720] test_threadsignals hang on FreeBSD 6.4

2011-01-05 Thread STINNER Victor

STINNER Victor  added the comment:

"x86 gentoo 3.x" is an old Linux setup, see #4970: glibc 2.3.4, 
linuxthreads-0.10 and Linux kernel 2.6.9-gentoo-r1. linuxthreads is the old 
implementation of threads on Linux. It was replaced by NPTL with Linux kernel 
2.6 and the GNU libc 2.4.

#4970 was fixed by r80108: skip the test if linuxthreads is used.

--

___
Python tracker 

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



[issue10492] test_doctest fails with iso-8859-15 locale

2011-01-05 Thread STINNER Victor

STINNER Victor  added the comment:

"x86 debian parallel 3.x" buildbot is green again! :-)

--

___
Python tracker 

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



[issue10720] test_threadsignals hang on FreeBSD 6.4

2011-01-05 Thread STINNER Victor

STINNER Victor  added the comment:

I am unable to reproduce test_threadsignals hang with my FreeBSD 8.0 VM. A bug 
was maybe fixed between FreeBSD 7.2 and FreeBSD 8.0?

--

___
Python tracker 

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



[issue10512] regrtest ResourceWarning - unclosed sockets and files

2011-01-05 Thread Nadeem Vawda

Nadeem Vawda  added the comment:

Awesome. That just leaves test_urllibnet, test_urllib2net, and test_cgi. I'm 
hoping to post patches for the first two tomorrow.

About test_cgi, I've fiddled around with it a bit more. The leak manifests 
itself with any set of tests including test_cgi and test___all__, for example:

  ☿ ./python -Wd -E -bb -m test.regrtest test___all__ test_cgi
  [1/2] test___all__
  [2/2] test_cgi
  All 2 tests OK.
  sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name='/dev/null' 
encoding='UTF-8'>

... but not with any other 2-test combination. This led me to think it was 
something specific to test___all__, but it does also come up when running all 
tests *except* test___all__.

I'm guessing there's something somewhere that's causing the cgi module to be 
garbage-collected between the tests finishing and the process terminating. 
Without some familiarity with unittest's internals, I can't say anything more, 
though.

--

___
Python tracker 

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



[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2011-01-05 Thread Nick Coghlan

Nick Coghlan  added the comment:

It's OK if the Py_buffer is on the stack - it's just a unique identifier for 
the exporter to use as a key, not something the exporter controls the lifecycle 
of (the latter is true only for the pointers *inside* the struct, such as buf, 
shape, strides, etc).

PyMemoryView_FromBuffer should be calling PyObject_Getbuffer on the view->obj 
member (it's one of the things that embedding the reference allows, just as it 
allowed removal of the separate obj argument from the PyObject_ReleaseBuffer 
signature). That way the source object knows there is now a *second* Py_buffer 
struct kicking around, and can decide whether to re-use the same internal 
pointers or create new ones.

--

___
Python tracker 

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



[issue10841] binary stdio

2011-01-05 Thread Glenn Linderman

New submission from Glenn Linderman :

Per Antoine's request, I wrote this test code, it isn't elegant, I whipped it 
together quickly; but it shows the issue.  The issue may be one of my 
ignorance, but it does show the behavior I described in issue 4953. Here's the 
output from the various test parameters that might be useful in running the 
test.

>c:\python32\python.exe test.py test 1
['c:\\python32\\python.exe', 'test.py', '1']
All OK

>c:\python32\python.exe test.py test 2
['c:\\python32\\python.exe', 'test.py', '2']
Not OK: b'abc\r\r\ndef\r\r\n'

>c:\python32\python.exe test.py test 3
['c:\\python32\\python.exe', 'test.py', '3']
All OK

>c:\python32\python.exe test.py test 4
['c:\\python32\\python.exe', 'test.py', '4']
Not OK: b'abc\r\r\ndef\r\r\n'

>c:\python32\python.exe test.py test 1-u
['c:\\python32\\python.exe', '-u', 'test.py', '1-u']
All OK

>c:\python32\python.exe test.py test 2-u
['c:\\python32\\python.exe', '-u', 'test.py', '2-u']
All OK

>c:\python32\python.exe test.py test 3-u
['c:\\python32\\python.exe', '-u', 'test.py', '3-u']
All OK

>c:\python32\python.exe test.py test 4-u
['c:\\python32\\python.exe', '-u', 'test.py', '4-u']
All OK

>

Note that test 2 and 4, which do not use the mscvrt stuff, have double \r: one 
sent by the code, and another added, apparently by MSC newline processing.  
test 2-u and 4-u, which are invoking the subprocess with Python's -u parameter, 
also do not exhibit the problem, even though the mscvrt stuff is not used.  
This seems to indicate that Python's -u parameter does approximately the same 
thing as my windows_binary function.

Seems like if Python already has code for this, that it would be nice to either 
make it more easily available to the user as an API (like my windows_binary 
function, invoked with a single line) in the io or sys modules (since it is 
used to affect sys.std* files).

And it would be nice if the function "worked cross-platform", even if it is a 
noop on most platforms.

--
files: test.py
messages: 125500
nosy: v+python
priority: normal
severity: normal
status: open
title: binary stdio
Added file: http://bugs.python.org/file20285/test.py

___
Python tracker 

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-05 Thread Glenn Linderman

Glenn Linderman  added the comment:

Pierre said:
In all cases the interpreter must be launched with the -u option. As stated in 
the documentation, the effect of this option is to "force the binary layer of 
the stdin, stdout and stderr streams (which is available as their buffer 
attribute) to be unbuffered. The text I/O layer will still be line-buffered.". 
On my PC (Windows XP) this is required to be able to read all the data stream ; 
otherwise, only the beginning is read. I tried Glenn's suggestion with mscvrt, 
with no effect

I say:
If you start the interpreter with -u, then my mscvrt has no effect.  Without 
it, there is an effect.  Read on...

Antoine said:
Could you open a separate bug with a simple piece of code to reproduce
the issue (preferably without launching an HTTP server :))?

I say:
issue 10841

--

___
Python tracker 

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



  1   2   >