[issue5945] PyMapping_Check returns 1 for lists

2011-01-06 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

Rather than introduce fixes that break code and hurt performance, I think it 
would be better to deprecate PyMapping_Check() and wait for a fast, clean C 
version of the ABCs (that is supposed to be our one obvious way to do it).

FWIW, the spreadsheet example has been around for years and I know of more than 
one private company that has made heavy use of code modeled on that example 
(not for spreadsheets, but as a hook for eval).  So, I don't think the new 
keys check should be backported.

--

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



[issue10824] urandom should not block

2011-01-06 Thread Charles-Francois Natali

Charles-Francois Natali neolo...@free.fr added the comment:

 Martin v. Löwis mar...@v.loewis.de added the comment:

 It's a bug in random.c that doesn' t check for signal pending inside the
 read(2) code, so you have no chance to kill the process via signals until
 the read(2) syscall is finished, and it could take a lot of time before
 return, if the buffer given to the read syscall is very big...

 I've had a quick look at the source code, and indeed, read(2) from
 /dev/urandom can now be interrupted by a signal, so looping seems to
 be justified.

 No: if read(2) is interrupted, no data is returned, and exception is
 raised. So it won't loop in that case, but raise the exception out of
 urandom also (which is the right thing to do).


(Sorry for being a little off-topic, but since there's not dedicated thread)
Try with this:
dd if=/dev/urandom of=/dev/null bs=100M count=1

Then, in another terminal:
pkill -USR1 -xn dd

You'll see that read returns less that 100M bytes when interrupted.
You can also try with the following python code:

---
import os

d = os.open('/dev/urandom', os.O_RDONLY)
data = os.read(d, 1  28)
os.close(d)
print('read %d bytes' % len(data))
---

and in another terminal
pkill -STOP -xn python
then
pkill -CONT -xn python

Same thing, read returns less bytes than requested.
Anyway, since /dev/urandom is not part of any standard (AFAIK), it's
probably better to use the common idiom
while len(data)  expected:
read(expected - len(data))

So we're sure it won't break under some systems/conditions.

Cheers

 --

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue10824
 ___


--

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



[issue5945] PyMapping_Check returns 1 for lists

2011-01-06 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 Rather than introduce fixes that break code and hurt performance, I
 think it would be better to deprecate PyMapping_Check() and wait for a
 fast, clean C version of the ABCs (that is supposed to be our one
 obvious way to do it).

Do you also advocate deprecating PySequence_Check()? Both are useful
APIs to know what you're dealing with.

As for the clean C version of the ABCs, I'm afraid we could wait quite
a bit, since that's a lot more work and nobody seems really interested
in the matter.

 FWIW, the spreadsheet example has been around for years and I know of
 more than one private company that has made heavy use of code modeled
 on that example (not for spreadsheets, but as a hook for eval).  So, I
 don't think the new keys check should be backported.

Well, I'm not proposing to backport it, but to fix things in 3.2.

--

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



[issue10841] binary stdio

2011-01-06 Thread Glenn Linderman

Glenn Linderman v+pyt...@g.nevcal.com added the comment:

I can read and understand C well enough, having coded in it for about 40 years 
now... but I left C for Perl and Perl for Python, I try not to code in C when I 
don't have to, these days, as the P languages are more productive, overall.

But there has to be special handling somewhere for opening std*, because they 
are already open, unlike other files.  That is no doubt where the bug is.  Can 
you point me at that code?

--

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



[issue5945] PyMapping_Check returns 1 for lists

2011-01-06 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

 Do you also advocate deprecating PySequence_Check()? 

Perhaps just document PyMapping_Check() as being less informative than before 
(now it has false positives for sequences).

 As for the clean C version of the ABCs, 
 I'm afraid we could wait quite a bit

That may be true.  I hope not.  The ABCs were meant to solve exactly this 
problem.  At this point, I would rather ignore the problem for 3.2 than to 
implement a less clean alternative.

--

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



[issue10841] binary stdio

2011-01-06 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 But there has to be special handling somewhere for opening std*,
 because they are already open, unlike other files.  That is no doubt
 where the bug is.  Can you point me at that code?

See initstdio() in Python/pythonrun.c

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10841
___
___
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-06 Thread Etienne Robillard

Etienne Robillard e...@gthcfoundation.org added the comment:

On 05/01/11 09:12 PM, Glenn Linderman wrote:
 Glenn Linderman v+pyt...@g.nevcal.com 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

 --

   

Thats a quite annoying response. whats the purposes of a option switch
if it becomes
mandatory ? Are you refering to Windows only users ?

I would prefer a way to programmatically allow FieldStorage to use
HTTP_TRANSFER_ENCODING
if available, to select a matching encoding...

Thanks

--

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



[issue10841] binary stdio

2011-01-06 Thread Glenn Linderman

Glenn Linderman v+pyt...@g.nevcal.com added the comment:

I suppose the FileIO in _io is next to look at, wherever it can be found.

--

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



[issue10841] binary stdio

2011-01-06 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 I suppose the FileIO in _io is next to look at, wherever it can be found.

I don't get what you're looking for. FileIO is involved in both the
buffered and unbuffered cases, so it shouldn't make a difference.
In any case, please look into Modules/_io

--

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



[issue410547] os.statvfs support for Windows

2011-01-06 Thread David-Sarah Hopwood

David-Sarah Hopwood david-sa...@jacaranda.org added the comment:

Is there a portable way to get the available disk space by now?

No, but 
http://tahoe-lafs.org/trac/tahoe-lafs/browser/src/allmydata/util/fileutil.py?rev=4894#L308
 might be helpful (uses pywin32).

--
nosy: +davidsarah

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



[issue1677694] test_timeout refactoring

2011-01-06 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

I adapted the patch for current py3k and committed it in r87786. Thank you for 
your patience.

--
nosy: +pitrou
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

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



[issue5945] PyMapping_Check returns 1 for lists

2011-01-06 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

  As for the clean C version of the ABCs, 
  I'm afraid we could wait quite a bit
 
 That may be true.  I hope not.  The ABCs were meant to solve exactly
 this problem.  At this point, I would rather ignore the problem for
 3.2 than to implement a less clean alternative.

Also, please note that checking for ABCs would not solve the
test_builtin failure, since the class there doesn't implement the
Mapping ABC (and doesn't claim to either).

--

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



[issue10841] binary stdio

2011-01-06 Thread Glenn Linderman

Glenn Linderman v+pyt...@g.nevcal.com added the comment:

Found it.

The file browser doesn't tell what line number it is, but in _io/Fileio.c 
function fileio_init, there is code like

#ifdef O_BINARY
flags |= O_BINARY;
#endif

#ifdef O_APPEND
if (append)
flags |= O_APPEND;
#endif

if (fd = 0) {
if (check_fd(fd))
goto error;
self-fd = fd;
self-closefd = closefd;
}


Note that if O_BINARY is defined, it is set into the default flags for opening 
files by name.  But if opening a file by fd, the fd is copied, regardless of 
whether it has O_BINARY set or not.  The rest of the IO code no doubt assumes 
the file was opened in O_BINARY mode.  But that isn't true of MSC std* handles 
by default.

How -u masks or overcomes this problem is not obvious, as yet, but the root bug 
seems to be the assumption in the above code.  A setmode of O_BINARY should be 
done, probably #ifdef O_BINARY, when attaching a MS C fd to a Python IO stack.  
Otherwise it is going to have \r\r\n problems, it would seem.

Alternately, in the location where the Python IO stacks are attached to std* 
handles, those specific std* handles should have the setmode done there... 
other handles, if opened by Python, likely already have it done.

Documentation for open should mention, in the description of the file 
parameter, that on Windows, it is important to only attach Python IO stack to 
O_BINARY files, or beware the consequences of two independent newline handling 
algorithms being applied to the data stream... or to document that setmode 
O_BINARY will be performed on the handles passed to open.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10841
___
___
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-06 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

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

Okay, thanks.  Next point of confusion:  does that mean that in the example I 
gave, the object 'n' (the memoryview slice) needs to know about *two* distinct 
Py_buffer structs---one to pass back to releasebuffer and one to store its own 
information?  It seems to me that these can't be the same, since (a) the 
Py_buffer for the slice will have different shape and stride from that returned 
by getbuffer, (b) what's passed back to releasebuffer should be identical to 
what came from getbuffer, so we can't just modify the shape and stride 
information in place.

--

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



[issue10842] Update third-party libraries for OS X installer builds

2011-01-06 Thread Ned Deily

New submission from Ned Deily n...@acm.org:

The third-party libraries used by the 32-bit OS X installer are in need of 
updating.  (Patch follows.)

--
assignee: ronaldoussoren
components: Build, Macintosh
messages: 125532
nosy: georg.brandl, ned.deily, ronaldoussoren
priority: normal
severity: normal
stage: patch review
status: open
title: Update third-party libraries for OS X installer builds
versions: Python 2.7, Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10842
___
___
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-06 Thread Glenn Linderman

Glenn Linderman v+pyt...@g.nevcal.com added the comment:

Etienne, I'm not sure what you are _really_ referring to by 
HTTP_TRANSFER_ENCODING.  There is a TRANSFER_ENCODING defined by HTTP but it is 
completely orthogonal to character encoding issues.  There is a 
CONTENT_ENCODING defined which is a character encoding, but that is either 
explicit in the MIME data, or assumed to be either ASCII or UTF-8, in certain 
form data contexts.

Because the HTTP protocol is binary, only selected data, either explicitly or 
implicitly (by standard definition) should be decoded, using the appropriate 
encoding.  FieldStorage should be able to (1) read a binary stream (2) do the 
appropriate decoding operations (3) return the data as bytes or str as 
appropriate.

Right now, I'm mostly interested in the fact that it doesn't do (1), so it is 
hard to know what it does for (2) or (3) because it gets an error first.

--

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



[issue10841] binary stdio

2011-01-06 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Ok, actually it boils down to the following code in Modules/main.c:

if (Py_UnbufferedStdioFlag) {
#if defined(MS_WINDOWS) || defined(__CYGWIN__)
_setmode(fileno(stdin), O_BINARY);
_setmode(fileno(stdout), O_BINARY);
#endif

... which explains things quite clearly! Archeology leads to r7409 by Guido in 
1997:

changeset:   4916:5af9f8a98d93
branch:  trunk
user:guido
date:Sat Jan 11 20:28:55 1997 +0100
files:   Modules/main.c
description:
[svn r7409] On Windows, -u implies binary mode for stdin/stdout
(as well as unbuffered stdout/stderr).

--
nosy: +gvanrossum
versions: +Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10841
___
___
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-06 Thread Philippe Devalkeneer

Philippe Devalkeneer phil.le.bienheur...@gmail.com added the comment:

Ok I will redo a patch in the next few days with possibly type sqlite3_int64, 
and include tests.

Thank you for the review.

--

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



[issue10842] Update third-party libraries for OS X installer builds

2011-01-06 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

1. bzip2 1.0.5 - 1.0.6 (fixes CVE-2010-0405)
2. GNU Readline 5.1.4 - 6.1.2
3. SQLite 3.6.11 - 3.7.4 (also enable FTS3/FTS4 and RTREE extensions)
4. ncurses 5.5 - ncursesw 5.5 (enable wide-character support)
5. do not build Sleepycat DB (4.7.25) for Python 3 builds
6. zlib (1.2.3) unchanged

Note: When 3rd-party libs are used in the installers is not changed
  by this patch.  In particular, the libs are only built for
  the 32-bit-only installer variant (or any installer built with
  deployment target  OS X 10.5).  For targets = 10.5,
  as in the 64-/32-bit installer variant, the Apple-supplied
  system versions of the libs are dynamically linked instead,
  with the system BSD editline (libedit) lib used in place
  of GNU readline (which is not shipped by Apple in OS X).

--
keywords: +patch
priority: normal - high
Added file: http://bugs.python.org/file20286/issue10842-py3k-27.patch

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



[issue10841] binary stdio

2011-01-06 Thread Glenn Linderman

Glenn Linderman v+pyt...@g.nevcal.com added the comment:

Don't find initstdio stdio in pythonrun.c.  Has it moved?  There are 
precious few references to stdin, stdout, stderr in that module, mostly for 
attaching the default encoding.

--

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



[issue10842] Update third-party libraries for OS X installer builds

2011-01-06 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Making this a blocker for now; I'd rather not update this during RC phase.

--
nosy: +benjamin.peterson
priority: high - release blocker

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



[issue10841] binary stdio

2011-01-06 Thread Glenn Linderman

Glenn Linderman v+pyt...@g.nevcal.com added the comment:

stderr is notable by its absence in the list of O_BINARY adjustments.

So -u does do 2/3 of what my windows_binary() does :)  Should I switch my test 
case to use stderr to demonstrate that it doesn't help with that?  I vaguely 
remember that early versions of DOS didn't do stderr, but I thought by the time 
Windows came along, let's see, was that about 1983?, that stderr was codified 
for DOS/Windows.  For sure it has never been missing in WinNT 4.0 +.

--

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



[issue10843] OS X installer: install the Tools source directory

2011-01-06 Thread Ned Deily

New submission from Ned Deily n...@acm.org:

As suggested in Issue10502 and now that the former Demos directory has been 
pruned and moved under the Tools directory, the OS X installer should install 
the Tools source directory in the /Applications/Python 3.x/Extras directory 
where Demos was formerly installed.  The existing README file there still 
applies, i.e. not all of these files are applicable to OS X users.  (patch 
follows)

--
assignee: ronaldoussoren
components: Build, Macintosh
messages: 125540
nosy: georg.brandl, michael.foord, ned.deily, ronaldoussoren
priority: high
severity: normal
status: open
title: OS X installer: install the Tools source directory
versions: Python 3.2

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



[issue10843] OS X installer: install the Tools source directory

2011-01-06 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

Patch for py3k.

--
keywords: +patch
stage:  - patch review
Added file: http://bugs.python.org/file20287/issue10843-py3k.patch

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



[issue10844] OS X installer: update copyright dates in app bundles

2011-01-06 Thread Ned Deily

New submission from Ned Deily n...@acm.org:

The copyright dates in the plists for the various app bundles installed by the 
OS X installer need updating.  They are visible with the Finder's Get Info 
command.  (patch for py3k follows, backport for 2.7 and 3.1 needed)

--
assignee: ronaldoussoren
components: Build, Macintosh
messages: 125542
nosy: georg.brandl, ned.deily, ronaldoussoren
priority: high
severity: normal
status: open
title: OS X installer: update copyright dates in app bundles
versions: Python 2.7, Python 3.1, Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10844
___
___
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-06 Thread Etienne Robillard

Etienne Robillard e...@gthcfoundation.org added the comment:

yes, lets not complexify anymore please...
 Because the HTTP protocol is binary, only selected data, either explicitly or 
 implicitly (by standard definition) should be decoded, using the appropriate 
 encoding.  FieldStorage should be able to (1) read a binary stream (2) do the 
 appropriate decoding operations (3) return the data as bytes or str as 
 appropriate.

 Right now, I'm mostly interested in the fact that it doesn't do (1), so it is 
 hard to know what it does for (2) or (3) because it gets an error first.

 --
   
according to rfc2616...

Transfer-codings are analogous to the Content-Transfer-Encoding values
of MIME [7], which were designed to enable safe transport of binary data
over a 7-bit transport service. However, safe transport has a different
focus for an 8bit-clean transfer protocol. In HTTP, the only unsafe
characteristic of message-bodies is the difficulty in determining the
exact body length (section 7.2.2
http://www.w3.org/Protocols/rfc2616/rfc2616-sec7.html#sec7.2.2), or
the desire to encrypt data over a shared transport.

I may have not fully understood that part. Is chunked encoding what's
being used in MIME to allow
large file uploads and properly handle multipart POST requests?

Thanks,

--
Added file: http://bugs.python.org/file20288/unnamed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4953
___!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
html
head
  meta content=text/html; charset=UTF-8 http-equiv=Content-Type
  title/title
/head
body text=#00 bgcolor=#ff
On 06/01/11 04:28 AM, Glenn Linderman wrote:
blockquote
 cite=mid:1294306110.0.0.541859342242.issue4...@psf.upfronthosting.co.za
 type=cite
  pre wrap=
Glenn Linderman a class=moz-txt-link-rfc2396E 
href=mailto:v+pyt...@g.nevcal.com;lt;v+pyt...@g.nevcal.comgt;/a added the 
comment:

Etienne, I'm not sure what you are _really_ referring to by 
HTTP_TRANSFER_ENCODING.  There is a TRANSFER_ENCODING defined by HTTP but it is 
completely orthogonal to character encoding issues.  There is a 
CONTENT_ENCODING defined which is a character encoding, but that is either 
explicit in the MIME data, or assumed to be either ASCII or UTF-8, in certain 
form data contexts.
  /pre
/blockquote
yes, lets not complexify anymore please... br
blockquote
 cite=mid:1294306110.0.0.541859342242.issue4...@psf.upfronthosting.co.za
 type=cite
  pre wrap=Because the HTTP protocol is binary, only selected data, either 
explicitly or implicitly (by standard definition) should be decoded, using the 
appropriate encoding.  FieldStorage should be able to (1) read a binary stream 
(2) do the appropriate decoding operations (3) return the data as bytes or str 
as appropriate.

Right now, I'm mostly interested in the fact that it doesn't do (1), so it is 
hard to know what it does for (2) or (3) because it gets an error first.

--
  /pre
/blockquote
according to rfc2616...br
br
span class=Apple-style-span
 style=border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New 
Roman'; font-style: normal; font-variant: normal; font-weight: normal; 
letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; 
text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; 
font-size: medium;Transfer-codings
are analogous to the Content-Transfer-Encoding values of MIME [7],
which were designed to enable safe transport of binary data over a
7-bit transport service. However, safe transport has a different focus
for an 8bit-clean transfer protocol. In HTTP, the only unsafe
characteristic of message-bodies is the difficulty in determining the
exact body length (sectionspan class=Apple-converted-space /spana
 rel=xref
 
href=http://www.w3.org/Protocols/rfc2616/rfc2616-sec7.html#sec7.2.2;7.2.2/a),
or the desire to encrypt data over a shared transport./spanbr
br
I may have not fully understood that part. Is chunked encoding what's
being used in MIME to allowbr
large file uploads and properly handle multipart POST requests?br
br
Thanks,br
pre class=moz-signature cols=72-- 
Etienne Robillard

Company: Green Tea Hackers Club
Occupation: Software Developer
E-mail: a class=moz-txt-link-abbreviated 
href=mailto:e...@gthcfoundation.org;e...@gthcfoundation.org/a
Work phone: +1 514-962-7703
Website (Company):  a class=moz-txt-link-freetext 
href=https://www.gthc.org/;https://www.gthc.org//a
Website (Blog): a class=moz-txt-link-freetext 
href=https://www.gthc.org/blog/;https://www.gthc.org/blog//a
PGP public key fingerprint:F2A9 32EA 8E7C 460F 1728  A1A7 649C 7F17 A086 
DDEC

During times of universal deceit, telling the truth becomes a revolutionary 
act. -- George Orwell 
/pre
/body
/html
___
Python-bugs-list mailing list
Unsubscribe: 

[issue10844] OS X installer: update copyright dates in app bundles

2011-01-06 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

Patch for py3k. (Patches needed for 31 and 27.)

--
keywords: +patch
stage:  - patch review
Added file: http://bugs.python.org/file20289/issue10844-py3k.patch

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



[issue10844] OS X installer: update copyright dates in app bundles

2011-01-06 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

This looks safe enough for me to apply. Fixed in r87791.

--
resolution:  - fixed
stage: patch review - 
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10844
___
___
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-06 Thread Glenn Linderman

Glenn Linderman v+pyt...@g.nevcal.com added the comment:

Etienne said:
yes, lets not complexify anymore please...

Albert Einstein said:
Things should be as simple as possible, but no simpler.

I say:
My learning of HTTP predates chunked.  I've mostly heard of it being used 
in downloads rather than uploads, but I'm not sure if it pertains to uploads or 
not.  Since all the data transfer is effectively chunked by TCP/IP into 
packets, I'm not clear on what the benefit is, but I am pretty sure it is 
off-topic for this bug, at least until FieldStorage works at all on 3.x, like 
for small pieces of data.

I meant to say in my preceding response, that the multiple encodings that may 
be found in an HTTP stream, make it inappropriate to assign an encoding to the 
file through which the HTTP data streams... that explicit decode calls by 
FieldStorage should take place on appropriate chunks only.  I almost got there, 
so maybe you picked it up.  But I didn't quite say it.

--

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



[issue10845] test_multiprocessing failure under Windows

2011-01-06 Thread Antoine Pitrou

New submission from Antoine Pitrou pit...@free.fr:

This is under a Windows 7 VM. I don't understand what the assertion means:

Z:\__svn__\PCbuild\amd64\python_d.exe -m test -v test_multiprocessing
== CPython 3.2b2+ (py3k, Jan 6 2011, 10:56:48) [MSC v.1500 64 bit (AMD64)]
==   Windows-7-6.1.7600 little-endian
==   Z:\__svn__\build\test_python_1360
Testing with flags: sys.flags(debug=0, division_warning=0, inspect=0, interactiv
e=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_enviro
nment=0, verbose=0, bytes_warning=0, quiet=0)
[1/1] test_multiprocessing
Traceback (most recent call last):
  File string, line 1, in module
  File Z:\__svn__\lib\multiprocessing\forking.py, line 369, in main
prepare(preparation_data)
  File Z:\__svn__\lib\multiprocessing\forking.py, line 477, in prepare
assert main_name not in sys.modules, main_name
AssertionError: __main__
[49434 refs]
Traceback (most recent call last):
  File string, line 1, in module
  File Z:\__svn__\lib\multiprocessing\forking.py, line 369, in main
prepare(preparation_data)
  File Z:\__svn__\lib\multiprocessing\forking.py, line 477, in prepare
assert main_name not in sys.modules, main_name
AssertionError: __main__
[49434 refs]
test test_multiprocessing crashed -- class 'EOFError':
Traceback (most recent call last):
  File Z:\__svn__\lib\test\regrtest.py, line 969, in runtest_inner
Traceback (most recent call last):
  File string, line 1, in module
  File Z:\__svn__\lib\multiprocessing\forking.py, line 369, in main
indirect_test()
  File Z:\__svn__\lib\test\test_multiprocessing.py, line 2102, in test_main
prepare(preparation_data)
  File Z:\__svn__\lib\multiprocessing\forking.py, line 477, in prepare
assert main_name not in sys.modules, main_name
AssertionError: __main__
ManagerMixin.manager.start()
  File /home/antoine/py3k/__svn__/Lib/multiprocessing/managers.py, line 531, i
n start
[49434 refs]
Traceback (most recent call last):
  File string, line 1, in module
  File Z:\__svn__\lib\multiprocessing\forking.py, line 369, in main
self._address = reader.recv()
EOFError
Traceback (most recent call last):
  File string, line 1, in module
prepare(preparation_data)
  File Z:\__svn__\lib\multiprocessing\forking.py, line 477, in prepare
  File Z:\__svn__\lib\multiprocessing\forking.py, line 369, in main
1 test failed:
assert main_name not in sys.modules, main_name
AssertionError: __main__
prepare(preparation_data)
  File Z:\__svn__\lib\multiprocessing\forking.py, line 477, in prepare
[49434 refs]
assert main_name not in sys.modules, main_name
AssertionError: __main__
[49434 refs]
test_multiprocessing
Traceback (most recent call last):
  File Z:\__svn__\lib\test\support.py, line 468, in temp_cwd
yield os.getcwd()
  File Z:\__svn__\lib\test\__main__.py, line 13, in module
regrtest.main()
  File Z:\__svn__\lib\test\regrtest.py, line 708, in main
sys.exit(len(bad)  0 or interrupted)
SystemExit: True

--
components: Library (Lib), Tests
messages: 125547
nosy: asksol, jnoller, pitrou
priority: normal
severity: normal
status: open
title: test_multiprocessing failure under Windows
type: crash
versions: Python 3.2

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



[issue10845] test_multiprocessing failure under Windows

2011-01-06 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +brian.curtin

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



[issue10845] test_multiprocessing failure under Windows

2011-01-06 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Actually, it only happens if I use -m test. If I use -m test.regrtest or 
Lib/test/regrtest.py instead, it works fine.

--
nosy: +michael.foord, ncoghlan

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



[issue10845] test_multiprocessing failure under Windows

2011-01-06 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

(I guess this means that multiprocessing under Windows is not compatible with 
execution of a package through a __main__.py file...)

--

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



[issue10841] binary stdio

2011-01-06 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 So -u does do 2/3 of what my windows_binary() does :)  Should I switch
 my test case to use stderr to demonstrate that it doesn't help with
 that?

Well, judging by the history of this code, selectively putting -u in
binary mode may be justified by the fact that Python 2 relied on the C
runtime's stdio FILE pointers, and therefore on the C runtime's own
newline translation. I would say that Python 3 should put all stdio fds
in binary mode, regardless of the -u switch.

--

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



[issue8746] os.chflags() and os.lchflags() are not built when they should be be

2011-01-06 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

Ping - Garrett, any progress on updating the tests?  With dispatch, this could 
still make it into 3.2.

--

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



[issue10845] test_multiprocessing failure under Windows

2011-01-06 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


--
nosy: +haypo

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



[issue10841] binary stdio

2011-01-06 Thread Peter Kleiweg

Changes by Peter Kleiweg pklei...@xs4all.nl:


--
nosy: +pebbe

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



[issue10841] binary stdio

2011-01-06 Thread Glenn Linderman

Glenn Linderman v+pyt...@g.nevcal.com added the comment:

Makes sense to me.  Still should document the open file parameter when passed 
an fd, and either tell the user that it should be O_BINARY, or that it will be 
O_BINARYd for them, whichever technique is chosen.  But having two newline 
techniques is bad, and if Python thinks it is tracking the file pointer, but 
Windows is doing newline translation for it, then it isn't likely tracking it 
correctly for random access IO.  So I think the choice should be that any fd 
passed in to open on Windows should get O_BINARYd immediately.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10841
___
___
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-06 Thread Stéphane Gaudreault

Changes by Stéphane Gaudreault steph...@archlinux.org:


--
nosy: +stephane

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



[issue10785] parser: store the filename as an unicode object

2011-01-06 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +benjamin.peterson

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



[issue10841] binary stdio

2011-01-06 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Attached stdio_binary.patch always set stdin, stdout and stderr in binary mode 
on Windows (and not only with -u command line flag). I added the following 
comment, is it correct?

/* don't translate newlines */

--
keywords: +patch
nosy: +haypo
Added file: http://bugs.python.org/file20290/stdio_binary.patch

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



[issue10841] binary stdio

2011-01-06 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Using my patch, the interpreter fails with a SyntaxError on \r: attached patch 
translates newlines to avoid this problem.

--
Added file: http://bugs.python.org/file20291/parser_translate_newline.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10841
___
___
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-06 Thread Ross Lagerwall

Ross Lagerwall rosslagerw...@gmail.com added the comment:

This new patch reuses iov allocation code between readv  writev.
It reuses code between exec, execve  fexecve.
It reuses code for parsing off_t types.

I've tried where possible to reuse code but I think though that the code seems 
pretty standard for the posix module. Each function pretty much parses args, 
calls posix function, checks for error and returns result.

--
Added file: http://bugs.python.org/file20292/10812_v3.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10812
___
___
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-06 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

I tried full_source_and_error.zip on Windows and it failed. With 
stdio_binary.patch (attached to #10841), it works but I get an unicode file 
instead of a binary file. With stdio_binary.patch+cgi_plus_tests.diff it works 
as expected: I get a binary file (bytes).

But I don't understand why I have to pass an text stream (sys.stdin) instead of 
a binary stream (sys.stdin.buffer) to the FieldStorage constructor.

--
nosy: +haypo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4953
___
___
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-06 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Haypo: I believe that the consensus we've come to is that you shouldn't have 
to.  FieldStorage should take a binary stream.  So should cgi.parse.  If 
defaulting to sys.stdin, then if stdin is text, they should turn it in to a 
binary stream right at the start.

None of which is true right now, and this presents some backward compatibility 
problems.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4953
___
___
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-06 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 Haypo: I believe that the consensus we've come to is that you
 shouldn't have to.  FieldStorage should take a binary stream.  So
 should cgi.parse.  If defaulting to sys.stdin, then if stdin is text,
 they should turn it in to a binary stream right at the start.

Is mutating sys.stdin really a good idea? Or am I misunderstand your
proposal?

--

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



[issue2973] _ssl compiler warnings

2011-01-06 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

I don't get any warnings with gcc -Wall and OpenSSL 1.0.x.

--
nosy: +pitrou
resolution:  - out of date
status: open - closed

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



[issue968063] Add fileinput.islastline()

2011-01-06 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Anyone wants to produce an up-to-date patch for py3k?

--
keywords: +easy -patch
nosy: +pitrou
stage:  - needs patch
type:  - feature request
versions: +Python 3.3 -Python 2.6

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



[issue10841] binary stdio

2011-01-06 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +benjamin.peterson

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



[issue3163] module struct support for ssize_t and size_t

2011-01-06 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
versions: +Python 3.3 -Python 3.2

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



[issue1158490] locale fails if LANGUAGE has multiple locales

2011-01-06 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +haypo
stage: unit test needed - patch review

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



[issue10841] binary stdio

2011-01-06 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 Using my patch, the interpreter fails with a SyntaxError on \r:
 attached patch translates newlines to avoid this problem.

See also issue #4628.

--

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



[issue1158490] locale fails if LANGUAGE has multiple locales

2011-01-06 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

The initial problem (: in the LANGUAGE variable) was fixed in an independent 
(?) issue (#1166938) by r39572.

If I understood correctly, locale.getdefaultlocale() is supposed to give the 
locale settings that we will be active after the first call to 
locale.setlocale(locale.LC_ALL, ''). In this case, LANGUAGE should be ignored 
because it has no effect on the active locale. The variable is specific to the 
gettext library, it is not used by the locale machinery.

About remove-support-for-LANGUAGE--in-locale.patch: you should also update the 
documentation.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1158490
___
___
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-06 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Ah, you are right.  That makes the backward compatibility issue a lot worse :(

--

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



[issue6269] threading documentation makes no mention of the GIL

2011-01-06 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Ok, done in r87792, r87793 and r87794, thank you.

--
nosy: +pitrou
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

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



[issue9909] request for calendar.dayofyear() function

2011-01-06 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +belopolsky

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



[issue4681] mmap offset should be off_t instead of ssize_t, and size calculation needs corrected

2011-01-06 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
stage:  - patch review
versions: +Python 3.2, Python 3.3 -Python 2.6

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



[issue5369] __ppc__ macro checking is incorrect

2011-01-06 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
resolution:  - duplicate
status: open - closed
superseder:  - Wrong powerpc define in Python/ceval.c

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5369
___
___
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-06 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Issue5369 is a duplicate with the same patch. Dave, can you apply?

--
assignee:  - dmalcolm

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



[issue1521196] smtplib login fails with aol smtp server

2011-01-06 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +r.david.murray

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



[issue3466] urllib2 should support HTTPS connections with client keys

2011-01-06 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

In 3.2, you can instantiate a HTTPSHandler with a custom SSLContext, on which 
you can load your client cert:
http://docs.python.org/dev/library/urllib.request.html#urllib.request.HTTPSHandler
http://docs.python.org/dev/library/ssl.html#ssl.SSLContext.load_cert_chain

--
nosy: +pitrou
resolution:  - out of date
stage: unit test needed - 
status: open - closed
versions: +Python 3.2 -Python 2.7

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



[issue6284] C/API PyErr_AsUnicode()

2011-01-06 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +haypo
stage:  - patch review
type:  - feature request
versions: +Python 3.3 -Python 3.1

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



[issue1697943] msgfmt cannot cope with BOM

2011-01-06 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +haypo
stage: unit test needed - needs patch
versions: +Python 2.7, Python 3.2, Python 3.3 -Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1697943
___
___
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-06 Thread Dave Malcolm

Dave Malcolm dmalc...@redhat.com added the comment:

Adrian verified in the downstream bug tracker that this fixed the build for him 
(and the logs show it successfully ran the test suite), so I committed my patch 
to py3k as r87796.

--

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



[issue8927] Handle version conflicts in dependencies

2011-01-06 Thread anatoly techtonik

Changes by anatoly techtonik techto...@gmail.com:


--
nosy: +techtonik

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



[issue9909] request for calendar.dayofyear() function

2011-01-06 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

This is yet another request for functionality that can be implemented as a 
simple expression using datetime arithmetics.  Also, issue #9864 is not a 
compelling use case because the parsedate() function now returns a datetime 
object.   See msg117496.

--
assignee:  - belopolsky
resolution:  - rejected
status: open - pending

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



[issue3839] wsgi.simple_server resets 'Content-Length' header on empty content even if app defined it.

2011-01-06 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Fixed with tests in r87797 (3.2), r87798 (3.1) and r87799 (2.7). Thank you!

--
nosy: +pitrou -BreamoreBoy
resolution:  - fixed
stage: unit test needed - committed/rejected
status: open - closed

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



[issue1615158] POSIX capabilities support

2011-01-06 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +pitrou, rosslagerwall

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1615158
___
___
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-06 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

About the backward compatibility: does anyone use CGI with Python3? It looks 
like the module is broken (at least to upload files). If not, it's maybe better 
to fix it today than having to maintain a broken API.

Python 3.2 has many incompatibles changes with Python 3.1 to fix bugs. Some 
examples:
 - No more sys.setfilesystemencoding() function
 - ctypes and struct doesn't convert implicitly str to bytes
 - mbcs encoding raise an error if the error handler is not supported
 - etc.

--

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



[issue6064] Add daemon argument to threading.Thread constructor

2011-01-06 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
assignee: jnoller - 
stage:  - patch review
type: behavior - feature request
versions: +Python 3.3 -Python 2.7, Python 3.2

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



[issue8731] BeOS for 2.7 - add to unsupported

2011-01-06 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

We should do a bit sweep over unsupported platforms in 3.3.

--
nosy: +pitrou
resolution:  - out of date
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8731
___
___
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-06 Thread Dave Malcolm

Dave Malcolm dmalc...@redhat.com added the comment:

Merged back to 3.1 as r87800 and to 2.7-maint as r87801

--
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

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



[issue4346] PyObject_CallMethod changes the exception message already set by PyObject_GetAttr

2011-01-06 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +benjamin.peterson -BreamoreBoy

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



[issue9373] pulldom has low code coverage

2011-01-06 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +flox, loewis

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9373
___
___
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-06 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

I agree with Eric.  Limiting field width when formatting error messages is a 
good safety measure.  It is not only the amount of garbage that can be spitted 
in error logs, if garbage is not null-terminated, you may get a SEGV instead of 
a somewhat meaningful error message.

--
nosy: +belopolsky

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10833
___
___
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-06 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

 /* Caller is responsible for limiting the format */

Note that it is a good idea to avoid memory allocation during exception 
processing.  Think of out of memory errors: how would you report those if you 
need more memory to format the error message than the failed operation?

--

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



[issue3173] external strftime for Python?

2011-01-06 Thread Eric Smith

Changes by Eric Smith e...@trueblade.com:


--
nosy: +eric.smith

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



[issue10841] binary stdio

2011-01-06 Thread Guido van Rossum

Guido van Rossum gu...@python.org added the comment:

Not sure why I've been added, but I agree that all fds should always be in 
binary mode in Python 3.

--

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



[issue7858] os.utime(file, (0, 0, )) fails on on vfat, but doesn't fail immediately

2011-01-06 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Committed in r87802 (3.2), r87803 (3.1) and r87804 (2.7). Will watch the 
buildbots.

--
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - pending
versions:  -Python 2.6

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



[issue10841] binary stdio

2011-01-06 Thread Glenn Linderman

Glenn Linderman v+pyt...@g.nevcal.com added the comment:

Victor,  Thanks for your interest and patches.

msg125530 points out the location of the code where _all_ fds could be 
O_BINARYed, when passed in to open.  I think this would make all fds open in 
binary mode, per Guido's comment... he made exactly the comment I was hoping 
for, even though I didn't +nosy him... I believe this would catch std* along 
the way, and render your first patch unnecessary, but your second one would 
likely still be needed.

--

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



[issue3173] external strftime for Python?

2011-01-06 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

Maybe rather than spending the effort maintaining a legacy API such as 
strftime, someone could look into implementing localized date formatting as 
defined by recent Unicode standards:

http://unicode.org/reports/tr35/#Date_Format_Patterns

Apparently there is a free implementation for Python out there:

http://babel.edgewall.org/wiki/Documentation/dates.html#pattern-syntax

See also msg107236 on issue #8913.

--
versions: +Python 3.3 -Python 3.0

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



[issue10846] typo in threading doc's: size of the resource size

2011-01-06 Thread Vladimir Rutsky

New submission from Vladimir Rutsky altsy...@gmail.com:

I think there is a typo in threading documentation:
 In any situation where the size of the resource size is fixed, 
 you should use a bounded semaphore.
 - size of the resource size, see attached patch for proposed fix.

(Based on official http://svn.python.org/projects/python/branches/py3k/ 
repository.)

--
assignee: d...@python
components: Documentation
files: threading_typo_size_of_size.patch
keywords: patch
messages: 125580
nosy: d...@python, rutsky
priority: normal
severity: normal
status: open
title: typo in threading doc's: size of the resource size
versions: Python 3.3
Added file: http://bugs.python.org/file20293/threading_typo_size_of_size.patch

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



[issue10846] typo in threading doc's: size of the resource size

2011-01-06 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Fixed in r87807.

--
nosy: +georg.brandl
resolution:  - fixed
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10846
___
___
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-06 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

Removal of the buffer interface from the ABI has been committed as r87805, 
r87806, r87805, r87808, and r87809.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10181
___
___
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-06 Thread Glenn Linderman

Glenn Linderman v+pyt...@g.nevcal.com added the comment:

We have several, myself included, that can't use CGI under 3.x because it 
doesn't take a binary stream.

I believe there are several alternatives:
1) Document that CGI needs a binary stream, and expect the user to provide it, 
either an explicit handle, or by tweaking sys.stdin before calling with a 
default file stream.
2) Provide a CGI function for tweaking sys.stdin (along with #1)
3) Document that CGI will attempt to convert passed in streams, default or 
explicit, to binary, if they aren't already, and implement the code to do so.

My choice is #3.  I see CGI as being used only in HTTP environments, where the 
data stream should be binary anyway.

--

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



[issue3173] external strftime for Python?

2011-01-06 Thread Eric Smith

Eric Smith e...@trueblade.com added the comment:

I think we're stuck with strftime for quite a while, no matter how ugly it is. 
datetime.__format__ uses it, for example. Although maybe it's possible to write 
an strftime-format to new-format translator.

If we're going to take this on (re-writing strftime), I think the way to do it 
is to have it take the locale info as a parameter, and if that parameter is 
NULL then look up the info in the current locale. It looks like it's still a 
problem to find all of the info in the locale on all platforms, though. Finding 
the locale info is no doubt the tricky part, as someone said.

I agree it would be easier to write this from scratch rather than track down 
the licensing on the existing patch. As it is, there's just not much code there.

--

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



[issue7858] os.utime(file, (0, 0, )) fails on on vfat, but doesn't fail immediately

2011-01-06 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
status: pending - closed

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



[issue3173] external strftime for Python?

2011-01-06 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

On Thu, Jan 6, 2011 at 2:56 PM, Eric Smith rep...@bugs.python.org wrote:
..
 If we're going to take this on (re-writing strftime), I think the way to do 
 it is to have it take the locale info as a
 parameter, and if that parameter is NULL then look up the info in the current 
 locale.

You may want to take a look at BSD-ish strftime_l function which is
defined by POSIX.1-2008:

http://pubs.opengroup.org/onlinepubs/9699919799/functions/strftime.html

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3173
___
___
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-06 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

eric I always thought that one of the reasons for specifying the length
eric was in case a pointer pointed to garbage: at least you'd be limiting 
eric how much trash was printed.

No, it's because of the old (removed) 500 bytes limit.

There are different types of %s arguments:
 - name of a type, eg. PyType(op)-tp_name
 - constant message (a switch/case or if chose between different messages)
 - function/method name
 - ...
 - and sometimes an argument from the user, eg. codec.lookup(name) repeats the 
name in the result

belopolsky Limiting field width when formatting error messages
belopolsky is a good safety measure.  It is not only the amount
belopolsky of garbage that can be spitted in error logs, if garbage
belopolsky is not null-terminated, ...

Can you give me at least one example? I think that it is very unlikely, or just 
impossible. But if I do replace %.100s  by %s in all the code base, I 
accept to check each time that the argument is null-terminated and/or not 
controlable by the user. And maybe keep %.100s if I am not sure.

belopolsky Think of out of memory errors: ...

PyErr_NoMemory() doesn't use PyErr_Format(), it's message is fixed, and the 
exception object is preallocated.

--

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



[issue3173] external strftime for Python?

2011-01-06 Thread Guido van Rossum

Guido van Rossum gu...@python.org added the comment:

On Thu, Jan 6, 2011 at 11:56 AM, Eric Smith rep...@bugs.python.org wrote:
 If we're going to take this on (re-writing strftime), I think the way to do 
 it is to have it take the locale info as a parameter, and if that parameter 
 is NULL then look up the info in the current locale. It looks like it's still 
 a problem to find all of the info in the locale on all platforms, though. 
 Finding the locale info is no doubt the tricky part, as someone said.

Hm, shouldn't the libc locale support offer the same set of locales
and locale info that the libc strftime uses, on any platform? Or are
there platforms whose libc strftime has better locale support than the
libc getlocale implementation???

--

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



[issue3173] external strftime for Python?

2011-01-06 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

The Qt library has its own strftime() implementation. The QLocale object has 
methods providing localized day and month names. For example, day names are 
implemented using a big ushort array (~20.000 bytes) which contains something 
like 
'Sun;Mon;Tue;Wed;Thu;Fri;Sat;Sunday;Monday;Tuesday;Wednesday;Thursday;Friday;Saturday;S;M;T;W;T;F;S;7;1;2;3;4;5;6Dil;Wix;Qib;Rob;Kam;Jim;San;Dilbata;Wiixata;Qibxata;Roobii;Kamiisa;Jimaata;Sanbata;A;E;T;A;K;G;S;Aca;Etl;Tal;Arb;Kam;Gum;Sab;Acaada;Etleeni;Talaata;Arbaqa;Kamiisi;Gumqata;Sabti;1;2;3;4;5;6;7;So;Ma;Di;Wo;Do;Vr;Sa;Sondag;Maandag;Dinsdag;Woensdag;Donderdag;Vrydag;Saterdag;D;H;M;M;E;P;S;Die;H\xebn;Mar;M\xebr;(...)'.

--

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



[issue3173] external strftime for Python?

2011-01-06 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Is nl_langinfo() function reliable? On any OS? Can we use it to get day name, 
abbreviated day name, month name and abbreviated month name?

We should maybe start with an implementation in Python? It's easier to write 
code in Python than in C, and because it can be reused on other Python 
implementations.

--

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



[issue10841] binary stdio

2011-01-06 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

New patch setting O_BINARY mode using _setmode() (on Windows) to stdin, stdout, 
stderr, but also to all FileIO() objects.

The patch on Py_Main() is still needed because Python may use sys.stderr when 
it is still a stdprinter object, before the final TextIOWrapper object is 
created (before the io module is loaded).

I don't know the effect of _setmode(stderr, O_BINARY) on calls to fputs(stderr, 
...) in Py_FatalError().

I would appreciate a review of parser_translate_newline.patch.

--
Added file: http://bugs.python.org/file20294/io_binary_windows.patch

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



[issue10847] Distutils drops -fno-strict-aliasing when CFLAGS are set

2011-01-06 Thread Stefan Krah

New submission from Stefan Krah stefan-use...@bytereef.org:

When CFLAGS are set, distutils drops -fno-strict-aliasing (among other
flags):


$ python2.7 setup.py build
...
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall 
-Wstrict-prototypes -fPIC -I./src -I/usr/local/include 
-I/usr/local/include/python2.7 -c src/gmpy.c -o 
build/temp.linux-x86_64-2.7/src/gmpy.o
...

$ CFLAGS=-fomit-frame-pointer python2.7 setup.py build
...
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes 
-fomit-frame-pointer -fPIC -I./src -I/usr/local/include 
-I/usr/local/include/python2.7 -c src/gmpy.c -o 
build/temp.linux-x86_64-2.7/src/gmpy.o
src/gmpy.c: In function ‘_cmp_to_object’:
src/gmpy.c:4692: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
...

I'm not sure if this is intentional. The documentation says:

Compiler flags can also be supplied through setting the CFLAGS
environment variable. If set, the contents of CFLAGS will be added
to the compiler flags specified in the Setup file.

To me, this sounds as if they should be appended to the regular flags.

--
assignee: tarek
components: Distutils
messages: 125591
nosy: eric.araujo, skrah, tarek
priority: high
severity: normal
status: open
title: Distutils drops -fno-strict-aliasing when CFLAGS are set
type: behavior
versions: Python 2.7, Python 3.1, Python 3.2

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



[issue10841] binary stdio

2011-01-06 Thread Peter Kleiweg

Changes by Peter Kleiweg pklei...@xs4all.nl:


--
nosy:  -pebbe

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10841
___
___
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-06 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

On Thu, Jan 6, 2011 at 3:49 PM, STINNER Victor rep...@bugs.python.org wrote:
..
 eric I always thought that one of the reasons for specifying the length
 eric was in case a pointer pointed to garbage: at least you'd be limiting
 eric how much trash was printed.

 No, it's because of the old (removed) 500 bytes limit.


How do you know?  I, for one, did use %.100s when formatting strings
long before I knew that there was a 500 bytes limit.

..
 belopolsky Limiting field width when formatting error messages
 belopolsky is a good safety measure.  It is not only the amount
 belopolsky of garbage that can be spitted in error logs, if garbage
 belopolsky is not null-terminated, ...

 Can you give me at least one example? I think that it is very unlikely, or 
 just impossible.

I am concerned about conditions that are impossible in a valid
program.  However, if you have a buffer overflow that trashes your
tp_name pointer so that it suddenly resolves to a binary code section,
you will need all help you can get to find the bug.  Having the
program spit 100-character garbage in this case is often preferable to
a SEGV.

 But if I do replace %.100s  by %s in all the code base, I accept to check 
 each
 time that the argument is null-terminated and/or not controlable by the user.

As long as we have ctypes, everything is controllable by user.  Again,
limiting field width when formatting strings is defensive programming.
 And defensive programming pays off when you have to chase bugs.

 And maybe keep %.100s if I am not sure.

Just keep %.100s always.  It does not hurt and it is less work for you. :-)


 belopolsky Think of out of memory errors: ...

 PyErr_NoMemory() doesn't use PyErr_Format(), it's message is fixed, and the 
 exception object is preallocated.

Indeed, there are no PyErr_Format(PyExc_MemoryError, ..) in the code
base, but there are a few PyErr_SetString(PyExc_MemoryError, ..) such
as PyErr_SetString(PyExc_MemoryError, math.fsum partials) in
Modules/mathmodule.c.  Maybe these should be reviewed.  Still, there
may be code paths where OOM triggers an error other than MemoryError.
In any case, I don't see anything wrong with using fixed size buffers
in error handling and truncating too long output.

Code cleanup projects like this are rightfully frowned upon because
they are hard to review and usually error-prone.  However, if for each
change that you make, you would make sure that the error path is
covered by unit tests, it will definitely be an improvement.

--

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



[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2011-01-06 Thread Reid Kleckner

Reid Kleckner r...@mit.edu added the comment:

Looks good to me.  Do you need the TODO(gps)'s in there after implementing the 
behavior described?

--

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



[issue5673] Add timeout option to subprocess.Popen

2011-01-06 Thread Reid Kleckner

Reid Kleckner r...@mit.edu added the comment:

Pablo, so if I understand the issue you've run into correctly, you are using 
shell redirection to redirect stdout to a file, and then attempting to read 
from it using stdout=subprocess.PIPE.

It seems to me like this behavior is expected, because the shell will close 
it's current stdout file descriptor and open a new one pointing at file.  
When python tries to read from its end of the pipe, it complains that the fd 
has been closed.

I can avoid the problem here either by not reading stdout or by not redirecting 
to a file.

--

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



[issue4681] mmap offset should be off_t instead of ssize_t, and size calculation needs corrected

2011-01-06 Thread Nadeem Vawda

Changes by Nadeem Vawda nadeem.va...@gmail.com:


--
nosy: +nvawda

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



[issue10841] binary stdio

2011-01-06 Thread Guido van Rossum

Guido van Rossum gu...@python.org added the comment:

On Thu, Jan 6, 2011 at 1:20 PM, STINNER Victor rep...@bugs.python.org wrote:
 I don't know the effect of _setmode(stderr, O_BINARY) on calls to 
 fputs(stderr, ...) in Py_FatalError().

On Windows it will write lines ending in LF only instead of CRLF. Most
tools to read text files should be able deal with that by now,
conditioned as they are by many years of Unix developers doing Windows
stuff on the side. (Somebody should test what Notepad does though. :-)

I don't know any other supported platforms where O_BINARY exists and
is not a no-op (but I haven't really looked :-).

--

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



  1   2   >