[issue10028] test_concurrent_futures fails on Windows Server 2003

2011-01-02 Thread Brian Quinlan

Brian Quinlan  added the comment:

Fixed in r87673.

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



[issue10737] test_concurrent_futures failure on Windows

2011-01-02 Thread Brian Quinlan

Brian Quinlan  added the comment:

Fixed in r87673.

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



[issue10788] test_logging failure

2011-01-02 Thread Brian Quinlan

Brian Quinlan  added the comment:

Fixed in r87673.

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



Re: [issue670664] HTMLParser.py - more robust SCRIPT tag parsing

2011-01-02 Thread Senthil Kumaran
If you provide some tests augumenting the currently existing tests
test_htmlparser.py  and also ensure that no existing test breaks, it
would be help better to review the patch. I do see some changes made
to the regex and parsing. So tests would definitely help.

___
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-02 Thread Glenn Linderman

Glenn Linderman  added the comment:

Rereading the doc link I pointed at, I guess detach() is part of the new API 
since 3.1, so doesn't need to be checked for in 3.1+ code... but instead, may 
need to be coded as:

try:
sys.stdin = sys.stdin.detach()
except UnsupportedOperation:
pass

--

___
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-02 Thread Glenn Linderman

Glenn Linderman  added the comment:

Peter, it seems that detach is relatively new (3.1) likely the code samples and 
suggestions that I had found to cure the problem predate that.  While I haven't 
yet tried detach, your code doesn't seem to modify stdin, so are you 
suggesting, really...

   sys.stdin = sys.stdin.detach()

or maybe

   if hasattr( sys.stdin, 'detach'):
sys.stdin = sys.stdin.detach()

On the other hand, if detach, coded as above, is equivalent to 

   if hasattr( sys.stdin, 'buffer'):
sys.stdin = sys.stdin.buffer

then I wonder why it was added.  So maybe I'm missing something in reading the 
documentation you pointed at, and also that at 
http://docs.python.org/py3k/library/io.html#io.TextIOBase.detach
both of which seem to be well-documented if you already have an clear 
understanding of the layers in the IO subsystem, but perhaps not so 
well-documented if you don't yet (and I don't).

But then you referred to the platform-dependent stuff... I don't see anything 
in the documentation for detach() that implies that it also makes the 
adjustments needed on Windows to the C-runtime, which is what the 
platform-dependent stuff I suggested does... if it does, great, but a bit more 
documentation would help in understanding that.  And if it does, maybe that is 
the difference between the two code fragments in this comment?  I would have to 
experiment to find out, and am not in a position to do that this moment.

--

___
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-02 Thread Shashwat Anand

Changes by Shashwat Anand :


--
nosy:  -l0nwlf

___
Python tracker 

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



[issue8013] time.asctime segfaults when given a time in the far future

2011-01-02 Thread Shashwat Anand

Changes by Shashwat Anand :


--
nosy:  -l0nwlf

___
Python tracker 

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



[issue10060] python.exe crashes or hangs on help() modules when bad modules found

2011-01-02 Thread Dev Player

Dev Player  added the comment:

Oh I am running on an Intel Pentium 4 3.2GHz/3.2Ghz.
Windows XP Pro SP3 32 bit
So I presume I should not have used the AMD 64 versions of course.

http://sourceforge.net/projects/pywin32/files/pywin32/Build%20214/

--

___
Python tracker 

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



[issue10805] traceback.print_exception throws AttributeError when exception is None

2011-01-02 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +pitrou
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



[issue10811] sqlite segfault with generators

2011-01-02 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
assignee:  -> ghaering
nosy: +ghaering

___
Python tracker 

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



[issue10060] python.exe crashes or hangs on help() modules when bad modules found

2011-01-02 Thread Dev Player

Dev Player  added the comment:

from GetMainFrame import GetWindowText
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named GetMainFrame


Also, I installed from the MS-Windows installer file:
pywin32-214.win32-py2.7.exe

not from "pywin32-214.zip" which I think is the source distrobution.

I've tried reinstallation but I get the same results.

--

___
Python tracker 

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



[issue10060] python.exe crashes or hangs on help() modules when bad modules found

2011-01-02 Thread Dev Player

Dev Player  added the comment:

import win32ui
from win32ui import GetMainFrame

dir(win32ui.GetMainFrame)
['__call__', '__class__', '__cmp__', '__delattr__', '__doc__', '__eq__', 
'__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', 
'__le__', '__lt__', '__module__', '__name__', '__ne__', '__new__', 
'__reduce__', '__reduce_ex__', '__repr__', '__self__', '__setattr__', 
'__sizeof__', '__str__', '__subclasshook__']

dir(GetMainFrame)
['__call__', '__class__', '__cmp__', '__delattr__', '__doc__', '__eq__', 
'__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', 
'__le__', '__lt__', '__module__', '__name__', '__ne__', '__new__', 
'__reduce__', '__reduce_ex__', '__repr__', '__self__', '__setattr__', 
'__sizeof__', '__str__', '__subclasshook__']


Is this normal? I'd expect at least GetWindowText() in the dir().

--

___
Python tracker 

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



[issue10811] sqlite segfault with generators

2011-01-02 Thread Erick Tryzelaar

New submission from Erick Tryzelaar :

I found that the sqlite3 function executemany module crashes when passed in a 
generator that it iself is executing a query. It looks like this confuses the 
statement cache, and causes it to get cleared inappropriately in this case.

I've attached a file that exhibits the problem, which results in this stack 
trace:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0028
pysqlite_statement_mark_dirty (self=0x0) at 
/Users/Shared/erickt/Projects/py3k/Modules/_sqlite/statement.c:367
367 self->in_use = 1;
(gdb) bt
#0  pysqlite_statement_mark_dirty (self=0x0) at 
/Users/Shared/erickt/Projects/py3k/Modules/_sqlite/statement.c:367
#1  0x00010067e125 in _pysqlite_query_execute (self=0x100568880, 
multiple=1, args=) at 
/Users/Shared/erickt/Projects/py3k/Modules/_sqlite/cursor.c:625
#2  0x0001000af6a2 in PyEval_EvalFrameEx (f=0x1003579f0, throwflag=) at Python/ceval.c:3874
#3  0x0001000b000a in PyEval_EvalCodeEx (_co=0x1004977a0, globals=, locals=, args=0x0, argcount=0, kws=0x0, kwcount=0, 
defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:3310
#4  0x0001000b031f in PyEval_EvalCode (co=, globals=, locals=) 
at Python/ceval.c:760
#5  0x0001000d71eb in run_mod [inlined] () at 
/Users/Shared/erickt/Projects/py3k/Python/pythonrun.c:1759
#6  0x0001000d71eb in PyRun_FileExFlags (fp=0x7fff703f6f40, 
filename=0x1005c9190 "/Users/erickt/sqlite-crash.py", start=, globals=0x100325220, locals=0x100325220, 
closeit=1, flags=0x7fff5fbfef90) at Python/pythonrun.c:1716
#7  0x0001000d74b9 in PyRun_SimpleFileExFlags (fp=0x7fff703f6f40, 
filename=0x1005c9190 "/Users/erickt/sqlite-crash.py", closeit=1, 
flags=0x7fff5fbfef90) at Python/pythonrun.c:1241
#8  0x0001000ebe13 in Py_Main (argc=4832928, argv=) at Modules/main.c:297
#9  0x00010abf in main (argc=2, argv=0x7fff5fbff090) at 
./Modules/python.c:59

--
components: Library (Lib)
files: sqlite-crash.py
messages: 125148
nosy: Erick.Tryzelaar
priority: normal
severity: normal
status: open
title: sqlite segfault with generators
type: crash
versions: Python 3.2
Added file: http://bugs.python.org/file20238/sqlite-crash.py

___
Python tracker 

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



[issue10809] complex() comments wrongly say it supports NaN and inf

2011-01-02 Thread Andrew Dalke

Andrew Dalke  added the comment:

Well that's ... interesting. While I compiled 2.7 and was looking at the 2.7 
code my tests were against 2.6. 


Python 2.7 (trunk:74969:87651M, Jan  2 2011, 21:58:12) 
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> complex("nan-nanj")
(nan+nanj)
>>> 

This means that the comments are correct and the error was in my understanding, 
as influenced by issue2121.

I therefore closed this.

--
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue8278] os.utime doesn't allow a atime (Last Access) which is 27 years in the future.

2011-01-02 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Merged into release31-maint (r87668) and release27-maint (r87669)

--
status: pending -> closed

___
Python tracker 

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



[issue10810] logging.handlers.TimedRotatingFileHandler.__init__(): ST_MTIME NameError

2011-01-02 Thread Vinay Sajip

Vinay Sajip  added the comment:

Er, I meant to say "I'll change py3k ... after 3.2 is released".

--

___
Python tracker 

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



[issue10810] logging.handlers.TimedRotatingFileHandler.__init__(): ST_MTIME NameError

2011-01-02 Thread Vinay Sajip

Vinay Sajip  added the comment:

It's just old code which just never got changed. I will change 3.2 to use the 
posix.stat_result attributes and remove the stat import, but I'll wait until 
after 3.2 is released.

--

___
Python tracker 

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



[issue8278] os.utime doesn't allow a atime (Last Access) which is 27 years in the future.

2011-01-02 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Committed r87666 (py3k), I'll backport to 3.1 and 2.7.

--
resolution: accepted -> fixed
status: open -> pending

___
Python tracker 

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



[issue10798] test_concurrent_futures fails on FreeBSD

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

Martin v. Löwis  added the comment:

Follow-up: I have disabled test_all_completed_some_already_completed in r87667, 
as I couldn't figure out why it hangs.

--

___
Python tracker 

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



[issue10798] test_concurrent_futures fails on FreeBSD

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

Martin v. Löwis  added the comment:

Thanks for the review, committed as r87665. Fixing flaky tests is fine, of 
course.

--

___
Python tracker 

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



[issue10798] test_concurrent_futures fails on FreeBSD

2011-01-02 Thread Brian Quinlan

Brian Quinlan  added the comment:

The tests are currently flaky on Windows and I'd like to fix that before the 
release. But I don't have the bandwidth to debug the Call() abstraction used in 
the tests before 3.2 RC1.

You can see the test change here:
http://svn.python.org/view/python/branches/py3k-futures-on-windows/Lib/test/test_concurrent_futures.py?r1=87484&r2=87652

So far it is passing on all the platforms that I've tested it on (Mac OS X, 
Ubuntu and Windows 7).

--

___
Python tracker 

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



[issue8013] time.asctime segfaults when given a time in the far future

2011-01-02 Thread SilentGhost

SilentGhost  added the comment:

yes, sorry. what I meant to say is that fixing only upper bound for the year 
(according to CERT recommendation cited above) and leaving the lower bound in 
its current state is somewhat unsatisfactory.

--

___
Python tracker 

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



[issue8013] time.asctime segfaults when given a time in the far future

2011-01-02 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

Backported in r87664 (2.6), r87663 (2.7) and r87662 (3.1).

Reopening to implement bounds checking for 3.2.  Note that for time.asctime, 
checking the year range is trivial, but for time.ctime it is not because year 
is not computed in python code.  One solution may be to check bounds of the 
time_t timestamp, but those depend on the timezone.  Maybe it is easiest to 
simply call mktime(), check year and call asctime() bypassing OS ctime 
completely.

--
components: +Extension Modules -Library (Lib)
nosy:  -Alexander.Belopolsky
resolution: fixed -> 
stage: patch review -> needs patch
status: closed -> open
type: crash -> behavior
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



[issue8013] time.asctime segfaults when given a time in the far future

2011-01-02 Thread Andreas Stührk

Andreas Stührk  added the comment:

It's documented under "Year 2000 (Y2K) issues": 
http://docs.python.org/library/time.html#time-y2kissues

--

___
Python tracker 

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



[issue10798] test_concurrent_futures fails on FreeBSD

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

Martin v. Löwis  added the comment:

Is this really the time for restructuring tests? I think such activity should 
wait until after the 3.2 release.

--

___
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-02 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

I like the logic of Antoine's patch much better (basing this on whether the 
listening socket had a timeout). I wonder whether it's correct though if there 
is a defaulttimeout: shouldn't it then leave the timeout on the socket instead?

--

___
Python tracker 

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



[issue8013] time.asctime segfaults when given a time in the far future

2011-01-02 Thread SilentGhost

SilentGhost  added the comment:

I'm not sure that whether it's related to the current issue, but asctime 
doesn't seem to accept years < 1900. Which might be fair enough, has this been 
documented.

--

___
Python tracker 

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



[issue8013] time.asctime segfaults when given a time in the far future

2011-01-02 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

On Sun, Jan 2, 2011 at 6:46 PM, Georg Brandl  wrote:
..
> I don't see the range checking as particularly challenging; I'm sure you can 
> get it done in time for 3.2.

Will do.

--

___
Python tracker 

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



[issue8013] time.asctime segfaults when given a time in the far future

2011-01-02 Thread Georg Brandl

Georg Brandl  added the comment:

> There is a long tradition in keeping OS functions'
> wrappers thin with an expectation that application programmers will
> know the limitations/quirks of their target OSes.

Sorry, but that does not apply if we trigger undefined behavior which
is inherently unsafe, as you rightly insist.

I don't see the range checking as particularly challenging; I'm sure you can 
get it done in time for 3.2.

--

___
Python tracker 

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



[issue8013] time.asctime segfaults when given a time in the far future

2011-01-02 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

..
> My plan was to pick the low-hanging fruit (the null check) for 3.3 and

s/3.3/3.2/

--

___
Python tracker 

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



[issue8013] time.asctime segfaults when given a time in the far future

2011-01-02 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

On Sun, Jan 2, 2011 at 6:29 PM, Georg Brandl  wrote:
..
> You cannot have both: a safe implementation and the correct behavior with 
> glibc
> (not Linux!) -- except if you start special-casing.  Not sure that's worth it.
>
That's the reason why this and the related ctime issue were lingering
for so long.

My plan was to pick the low-hanging fruit (the null check) for 3.3 and
leave proper bounds checking and possibly switch to reentrant APIs for
the next release.   There is a long tradition in keeping OS functions'
wrappers thin with an expectation that application programmers will
know the limitations/quirks of their target OSes.  Given that datetime
module does not have these issues, I don't see this as "must fix."

--

___
Python tracker 

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



[issue8278] os.utime doesn't allow a atime (Last Access) which is 27 years in the future.

2011-01-02 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

> The only concern is that the test probably fails on FAT
The patch does not show it, but I've put the test under a
'if get_file_system(support.TESTFN) == "NTFS"'

--

___
Python tracker 

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



[issue10810] logging.handlers.TimedRotatingFileHandler.__init__(): ST_MTIME NameError

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

Martin v. Löwis  added the comment:

Hmm. I wonder why the code doesn't use the st_mtime field. We should really 
deprecate the stat module.

--
nosy: +loewis

___
Python tracker 

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



[issue8278] os.utime doesn't allow a atime (Last Access) which is 27 years in the future.

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

Martin v. Löwis  added the comment:

The patch looks still fine. The only concern is that the test probably fails on 
FAT, but I think that's acceptable.

--

___
Python tracker 

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



[issue8013] time.asctime segfaults when given a time in the far future

2011-01-02 Thread Georg Brandl

Georg Brandl  added the comment:

You cannot have both: a safe implementation and the correct behavior with glibc 
(not Linux!) -- except if you start special-casing.  Not sure that's worth it.

Note that time.asctime() is documented in time.rst to return a 24-character 
string, so what it currently returns with glibc is violating our docs as well.

--

___
Python tracker 

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



[issue8013] time.asctime segfaults when given a time in the far future

2011-01-02 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

On Sun, Jan 2, 2011 at 6:17 PM, Georg Brandl  wrote:
..
> (What I mean is that overwriting \n or not, the code is unsafe, so the check 
> must be
> done beforehand.  Why should that be left to 3.3?)

Reading beyond a buffer is somewhat safer than writing, but I agree
that checks must be done before calling asctime/ctime.   I thought it
would have to wait because it is a feature.  Some Linux users may
expect year 1 to work.  (Maybe as a sentinel value somewhere.)
But you are the RM, so it is your call.

--

___
Python tracker 

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



[issue8013] time.asctime segfaults when given a time in the far future

2011-01-02 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

On Sun, Jan 2, 2011 at 6:10 PM, Georg Brandl  wrote:
..
> All right, then I wonder why your checktm() doesn't check the tm_year?

It is not mine.  I thought it did.  I might have missed that when I
reviewed the patch or there was a reason for that at the time.  Note
that there is a comment that says:

"""
tm_year: [0, max(int)] (1)
..
(1) gettmarg() handles bounds-checking.
"""

If you are ok with introducing stricter bounds checking in beta, I'll
try to get to the bottom of it shortly.

--

___
Python tracker 

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



[issue8013] time.asctime segfaults when given a time in the far future

2011-01-02 Thread Georg Brandl

Georg Brandl  added the comment:

(What I mean is that overwriting \n or not, the code is unsafe, so the check 
must be done beforehand.  Why should that be left to 3.3?)

--

___
Python tracker 

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



[issue10716] Modernize pydoc to use CSS

2011-01-02 Thread Ron Adam

Ron Adam  added the comment:

To go forward I can create a new private api instead of changing HTMLDoc, that 
would be preferable.

Should the -w option also use the new html pages?  Or do we need a new option 
for that?

--

___
Python tracker 

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



[issue8013] time.asctime segfaults when given a time in the far future

2011-01-02 Thread Georg Brandl

Georg Brandl  added the comment:

All right, then I wonder why your checktm() doesn't check the tm_year?

--

___
Python tracker 

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



[issue8013] time.asctime segfaults when given a time in the far future

2011-01-02 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

On Sun, Jan 2, 2011 at 6:01 PM, Georg Brandl  wrote:
..
>
> Since all implementations we have or can test have a defined behavior in one 
> way or the other,
> I think an example of an implementation that exhibits such undefined behavior 
> is required first.

No.  A CERT recommendation on how to write secure and portable code
should be enough.  See msg107605.

--

___
Python tracker 

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



[issue8013] time.asctime segfaults when given a time in the far future

2011-01-02 Thread Georg Brandl

Georg Brandl  added the comment:

In that case however, it's equally unsafe to not replace a \n, but still use 
PyUnicode_FromString() without a size given -- you will read from random memory.

Since all implementations we have or can test have a defined behavior in one 
way or the other, I think an example of an implementation that exhibits such 
undefined behavior is required first.

--

___
Python tracker 

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



[issue10810] logging.handlers.TimedRotatingFileHandler.__init__(): ST_MTIME NameError

2011-01-02 Thread Georg Brandl

Georg Brandl  added the comment:

Thanks, fixed in r87660.

--
nosy: +georg.brandl
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



[issue8013] time.asctime segfaults when given a time in the far future

2011-01-02 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

On Sun, Jan 2, 2011 at 5:35 PM, Georg Brandl  wrote:
..
> Both asctime() and ctime() fixed to remove newline no matter how many
> digits the year has in r87657.  I also took the liberty of making the error
> messages consistent.

Georg,

I disagree with your solution.  According to relevant standards,
asctime is undefined for year > .  A compliant implementation can
do anything in this case including not null-terminating the internal
buffer.  With your change, time.strftime  will happily replace the
first unrelated '\n' with '\0' that it will find beyond the internal
buffer.

I was considering raising an ValueError if '\n' is not found at 24th
position, but this (or a precondition check solution) should wait
until 3.3.

--

___
Python tracker 

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



[issue10810] logging.handlers.TimedRotatingFileHandler.__init__(): ST_MTIME NameError

2011-01-02 Thread Arfrever Frehtes Taifersar Arahesis

New submission from Arfrever Frehtes Taifersar Arahesis 
:

r82912 introduced NameError for ST_MTIME in Lib/logging/handlers.py on 3.1 
branch. It's a regression in 3.1.3. The code in 3.2 is correct.

-from stat import ST_DEV, ST_INO
+from stat import ST_DEV, ST_INO, ST_MTIME

This bug was originally reported in Gentoo Bugzilla:
https://bugs.gentoo.org/show_bug.cgi?id=350400

--
components: Library (Lib)
messages: 125116
nosy: Arfrever, vinay.sajip
priority: normal
severity: normal
status: open
title: logging.handlers.TimedRotatingFileHandler.__init__(): ST_MTIME NameError
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



[issue8278] os.utime doesn't allow a atime (Last Access) which is 27 years in the future.

2011-01-02 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Here is a renewed patch against py3k, with a test.

--
Added file: http://bugs.python.org/file20237/timet_64-2.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-02 Thread Peter Kleiweg

Peter Kleiweg  added the comment:

Using platform-dependant code seems iffy to me. The detach function on 
sys.stdin, sys,stdout and sys.stderr is there specifically to switch these 
streams from text mode to binary mode. See: 
http://docs.python.org/py3k/library/sys.html#sys.stdin

--

___
Python tracker 

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



[issue10716] Modernize pydoc to use CSS

2011-01-02 Thread Georg Brandl

Georg Brandl  added the comment:

These arguments should not really be of concern.  If we indeed deem them public 
API, they can stay but be ignored.

--

___
Python tracker 

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




[issue8013] time.asctime segfaults when given a time in the far future

2011-01-02 Thread Georg Brandl

Georg Brandl  added the comment:

Tests fixed to ignore ValueError in r87656.

Both asctime() and ctime() fixed to remove newline no matter how many digits 
the year has in r87657.  I also took the liberty of making the error messages 
consistent.

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



[issue10716] Modernize pydoc to use CSS

2011-01-02 Thread Ron Adam

Ron Adam  added the comment:

> If the colors are passed directly to the HTML they should be
> removed >and left to the CSS(s) only. I don't know the code
> well enough to say if this is doable and/or if it requires a
> deprecation first;

We may have to do dome depreciating when it comes to the old HTMLDoc class 
methods.  Would it be possible to depreciate the whole class instead of the 
separate methods?  If so, it would be good if we can squeeze that into 3.2. 
  Or else we may not be able to finish this until Python 3.4.

The empty css elements will be used later.

Here is the css_v3.diff for review.  I'd like to hear any thoughts about the 
general html structure and class/id names.

Beside validating them, I test with firefox and chromium. I don't have easy 
access to ms-explorer or the current mac browser.

--
Added file: http://bugs.python.org/file20236/css_v3.diff

___
Python tracker 

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



[issue10802] python3.2 AFTER b2 release has subprocess.Popen broken under colinux/windows

2011-01-02 Thread kai zhu

kai zhu  added the comment:

re-tested under old 2.6.26 kernel using previous foo.py example:

1. unpatched python3.2 broken as expected
2. patched   python3.2 now works :)

strace confirms ENOSYS being raised from pipe2() in both cases

--

___
Python tracker 

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



[issue8013] time.asctime segfaults when given a time in the far future

2011-01-02 Thread STINNER Victor

STINNER Victor  added the comment:

> Sasha, commit is not working.

I suppose that the fix for the segfault is correct. The problem on Linux is the 
new test: asc

>>> import time; time.asctime((12345, 1, 0, 0, 0, 0, 0, 0, 0))
'Mon Jan  1 00:00:00 12345\n'

asctime() of the GNU libc doesn't fail. The test should maybe just calls the 
function without checking the result and ignores the exception.

--
nosy: +haypo

___
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-02 Thread Glenn Linderman

Glenn Linderman  added the comment:

Regarding the use of detach(), I don't know if it works.  Maybe it would.  I 
know my code works, because I have it working.  But if there are simpler 
solutions that are shown to work, that would be great.

--

___
Python tracker 

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



[issue10806] Subprocess error if fds 0,1,2 are closed

2011-01-02 Thread STINNER Victor

STINNER Victor  added the comment:

See also #6610 which has a patch with another test.

--
nosy: +haypo

___
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-02 Thread Pierre Quentel

Pierre Quentel  added the comment:

Here is the correct diff file

I also introduced a test to exit from the loop in read_multi() if the total 
number of bytes read reaches "content-length". It was necessary for my 
framework, which uses cgi.FieldStorage to read from the attribute rfile defined 
in socketserver. Without this patch, the program hangs after receiving the 
number of bytes specified in content length. I work on a Windows XP PC so it 
might be related to the bug #427345 handled by 
server.CGIHTTPRequestHandler.run_cgi()

--
Added file: http://bugs.python.org/file20235/cgi_diff.txt

___
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-02 Thread Peter Kleiweg

Peter Kleiweg  added the comment:

Why not simply:

fp = sys.stdin.detach()

--

___
Python tracker 

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



[issue10808] ssl unwrap fails with Error 0

2011-01-02 Thread Georg Brandl

Changes by Georg Brandl :


--
assignee:  -> pitrou
nosy: +pitrou

___
Python tracker 

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



[issue10809] complex() comments wrongly say it supports NaN and inf

2011-01-02 Thread Andrew Dalke

New submission from Andrew Dalke :

complex("nan") raises "ValueError: complex() arg is a malformed string"  while 
complex(float("nan")) returns (nan+0j). This was reported in 
http://bugs.python.org/issue2121 with the conclusion "wont fix".

complex("inf") has the same behaviors.

The implementation in complexobject.c says 


/* a valid complex string usually takes one of the three forms:

   - real part only
 j - imaginary part only
 j   - real and imaginary parts

   where  represents any numeric string that's accepted by the
   float constructor (including 'nan', 'inf', 'infinity', etc.), and
is any string of the form  whose first
   character is '+' or '-'.

This comment is wrong and it distracted me for a while as I tried to figure out 
why complex("nan") wasn't working. It should be fixed, with the word 
"including" replaced by "excluding".

I don't have a real need for complex("nan") support - this was of intellectual 
interest only. Also of intellectual interest, PyPy 1.4 does accept 
complex("nan") but converts complex("nan+nanj") to (nannanj), so it suffers 
from the strange corner cases which Raymond points out when advocating for 
"wont fix."

Because

--
assignee: d...@python
components: Documentation
messages: 125104
nosy: dalke, d...@python
priority: normal
severity: normal
status: open
title: complex() comments wrongly say it supports NaN and inf
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



[issue10772] Several actions for argparse arguments missing from docs

2011-01-02 Thread Steven Bethard

Steven Bethard  added the comment:

action="help" definitely needs to be documented

action="count" probably should be, though I think it's pretty useless (I just 
copied it from optparse)

action="parsers", nargs="..." and nargs="A..." I'm not so sure about. These are 
currently kind of implementation details.

--

___
Python tracker 

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



[issue10800] libffi build failure on HP-UX 11/PA

2011-01-02 Thread Oren Held

Oren Held  added the comment:

I confirm that on Python 2.7.1, on HP-UX 11.31, ia64 architecture).

dlmalloc.c is the problematic file, a part of libffi.

I reported the same problem and solution + patch in here:
http://sourceware.org/ml/libffi-discuss/2010/msg00203.html

--
nosy: +Oren_Held
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



[issue10806] Subprocess error if fds 0,1,2 are closed

2011-01-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

This further patch also addresses issue9905 (incorporating Ross' tests).

--
Added file: http://bugs.python.org/file20234/sp2.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-02 Thread Glenn Linderman

Glenn Linderman  added the comment:

Pierre, thanks for your work on this.  I hope a fix can make it in to 3.2.

However, while starting Python with -u can help a but, that should not, in my 
opinion, be requirement to use CGI.  Rather, the stdin should be set into 
binary mode by the CGI processing... it would be helpful if the CGI module 
either did it automatically, verified it has been done, or at least provided a 
helper function that could do it, and that appropriate documentation be 
provided, if it is not automatic.  I've seen code like:

try: # Windows needs stdio set for binary mode.
import msvcrt
msvcrt.setmode (0, os.O_BINARY) # stdin  = 0
msvcrt.setmode (1, os.O_BINARY) # stdout = 1
msvcrt.setmode (2, os.O_BINARY) # stderr = 2
except ImportError:
pass

and

if hasattr( sys.stdin, 'buffer'):
sys.stdin = sys.stdin.buffer

which together, seem to do the job.  For output, I use a little class that 
accepts either binary or text, encoding the latter:

class IOMix():
def __init__( self, fh, encoding="UTF-8"):
if hasattr( fh, 'buffer'):
self._bio = fh.buffer
fh.flush()
self._last = 'b'
import io
self._txt = io.TextIOWrapper( self.bio, encoding, None, '\r\n')
self._encoding = encoding
else:
raise ValueError("not a buffered stream")
def write( self, param ):
if isinstance( param, str ):
self._last = 't'
self._txt.write( param )
else:
if self._last == 't':
self._txt.flush()
self._last = 'b'
self._bio.write( param )
def flush( self ):
self._txt.flush()
def close( self ):
self.flush()
self._txt.close()
self._bio.close()


sys.stdout = IOMix( sys.stdout, encoding )
sys.stderr = IOMix( sys.stderr, encoding )


IOMix may need a few more methods for general use, "print" comes to mind, for 
example.

--

___
Python tracker 

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



[issue8013] time.asctime segfaults when given a time in the far future

2011-01-02 Thread SilentGhost

SilentGhost  added the comment:

Sasha, commit is not working. It doesn't pass test on Ubuntu and returns the 
string with a trailing \n. Seems like that hunk of code is misplaced.

--
nosy: +SilentGhost

___
Python tracker 

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



[issue10475] hardcoded compilers for LDSHARED/LDCXXSHARED on NetBSD

2011-01-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> $(CC) and $(CXX) should be expanded by `make`, but configure.in
> contains wrong quoting, which results in incorrect expansion during
> running `configure`.

Oops, sorry. Should be fixed, now.

--

___
Python tracker 

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



[issue10802] python3.2 AFTER b2 release has subprocess.Popen broken under colinux/windows

2011-01-02 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

fixed r87651.

kaizhu if you still have the ability to run your colinux install with an old 
2.6.26 kernel i'd appreciate it if you could explicitly test that the change 
does the right thing.

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



[issue670664] HTMLParser.py - more robust SCRIPT tag parsing

2011-01-02 Thread Yotam Medini

Yotam Medini  added the comment:

Suggested fix for the attached cases:
  lt-in-script-example.tgz
  endtag-space.html
  dollar-extra.html

--
Added file: http://bugs.python.org/file20233/ltscr-endtag-dollarext.diff

___
Python tracker 

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



[issue8013] time.asctime segfaults when given a time in the far future

2011-01-02 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

Committed in revision 87648.

--

___
Python tracker 

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



[issue670664] HTMLParser.py - more robust SCRIPT tag parsing

2011-01-02 Thread Yotam Medini

Changes by Yotam Medini :


Added file: http://bugs.python.org/file20232/dollar-extra.html

___
Python tracker 

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



[issue10806] Subprocess error if fds 0,1,2 are closed

2011-01-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Patch works fine, thank you. Here is an attempt at a slightly more readable 
code by refactoring.

--
Added file: http://bugs.python.org/file20230/sp.patch

___
Python tracker 

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



[issue670664] HTMLParser.py - more robust SCRIPT tag parsing

2011-01-02 Thread Yotam Medini

Changes by Yotam Medini :


Added file: http://bugs.python.org/file20231/endtag-space.html

___
Python tracker 

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



[issue10802] python3.2 AFTER b2 release has subprocess.Popen broken under colinux/windows

2011-01-02 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

This bug has brought up a broader issue.  the pipe2 syscall on Linux is very 
new.  It is perfectly reasonable to expect a Python binary will be compiled 
against a C library that has a pipe2() function but run on a system with an 
older (pre 2.6.27) linux kernel.  I have many systems like that at work.

I'm going to make subprocess_cloexec_pipe check for a not implemented error 
from the pipe2 call and use the fallback pipe+fcntl code in that case instead.

--
resolution: works for me -> 
status: closed -> open

___
Python tracker 

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



[issue10802] python3.2 AFTER b2 release has subprocess.Popen broken under colinux/windows

2011-01-02 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

This bug has brought up a broader issue.  the pipe2 syscall on Linux is very 
new.  It is perfectly reasonable to expect a Python binary will be compiled 
against a C library that has a pipe2() function but run on a system with an 
older (pre 2.6.27) linux kernel.  I have many systems like that at work.

I'm going to make subprocess_cloexec_pipe check for a not implemented error 
from the pipe2 call and use the fallback pipe+fcntl code in that case instead.

--

___
Python tracker 

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



[issue10475] hardcoded compilers for LDSHARED/LDCXXSHARED on NetBSD

2011-01-02 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis  added the comment:

$(CC) and $(CXX) should be expanded by `make`, but configure.in contains wrong 
quoting, which results in incorrect expansion during running `configure`.

-LDSHARED="$(CC) -shared"
-LDCXXSHARED="$(CXX) -shared";;
+LDSHARED='$(CC) -shared'
+LDCXXSHARED='$(CXX) -shared';;

--
nosy: +Arfrever

___
Python tracker 

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



[issue10806] Subprocess error if fds 0,1,2 are closed

2011-01-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Updated patch for debug mode. Does this also need to be applied for 3.1?

Yes, but we can port it ourselves (unless you're really motivated)

--

___
Python tracker 

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



[issue10802] python3.2 AFTER b2 release has subprocess.Popen broken under colinux/windows

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

Martin v. Löwis  added the comment:

If more people report this, there is still something Python could do:

- the configure test could verify that the running kernel actually implements 
the system call, and undefine HAVE_PIPE2 if that's not the case. Of course this 
would only help if the resulting binary only ever runs on the same system, and 
if the kernel is only ever upgraded.
- the test could be deferred to run-time, having subprocess_cloexec_pipe fall 
back to the pipe()/fcntl() branch if the system call fails with ENOSYS.

--

___
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-02 Thread Pierre Quentel

Pierre Quentel  added the comment:

Please ignore previous post. I worked on the version of cgi.py included in 
version 3.2b2, and I just realized there were changes commited to the svn 
repository since this version. I will post the diff file later, but you can 
always test the files in the zip file

--

___
Python tracker 

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



[issue4662] posix module lacks several DeprecationWarning's

2011-01-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Patch committed in r87643, thank you.

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

___
Python tracker 

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



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

2011-01-02 Thread Pierre Quentel

Pierre Quentel  added the comment:

I attach the svn diff file against the present version (generated by Tortoise 
SVN), hope it's what you expect

--
Added file: http://bugs.python.org/file20229/cgi_diff.txt

___
Python tracker 

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



[issue8013] time.asctime segfaults when given a time in the far future

2011-01-02 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

On Sun, Jan 2, 2011 at 1:59 PM, Alexander Belopolsky
 wrote:
..
> Hmm. My search brought up issue 10563, but the last message on that
> issue says that "a change has been recently made to time.asctime() to
> reject year > .  See r85137 and issue6608."  I wonder if that
> change made this issue moot.

It turns out the check added in r85137 does not cover tm_year even
though CERT recommends it (see msg107605).  These are separate issues
though. I think given where we are in the release cycle, the most
conservative solution would be to simply add a null check as follows.
(I did check that it fixes the crash on OSX.)

===
--- timemodule.c(revision 87556)
+++ timemodule.c(working copy)
@@ -620,6 +620,10 @@
 } else if (!gettmarg(tup, &buf) || !checktm(&buf))
 return NULL;
 p = asctime(&buf);
+if (p == NULL) {
+PyErr_SetString(PyExc_ValueError, "invalid time");
+return NULL;
+}
 if (p[24] == '\n')
 p[24] = '\0';
 return PyUnicode_FromString(p);

--

___
Python tracker 

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



[issue10807] `b'dGVzdA==\n'.decode('base64')` raise exception

2011-01-02 Thread STINNER Victor

STINNER Victor  added the comment:

> Looks good, please commit.

Ok, done: r87642

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



[issue10806] Subprocess error if fds 0,1,2 are closed

2011-01-02 Thread Ross Lagerwall

Ross Lagerwall  added the comment:

Updated patch for debug mode. Does this also need to be applied for 3.1?

--
Added file: http://bugs.python.org/file20228/subprocess_v2.patch

___
Python tracker 

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



[issue10751] REMOTE_USER and Remote-User collision in wsgiref

2011-01-02 Thread Phillip J. Eby

Phillip J. Eby  added the comment:

I don't understand.  HTTP_REMOTE_USER is not the name of a standard CGI 
variable - it's REMOTE_USER.

It would help if you could show code for what client/proxy/server combination 
has this problem, what happens when that code runs, and what you want to happen 
instead.

--

___
Python tracker 

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



[issue10808] ssl unwrap fails with Error 0

2011-01-02 Thread Florian Apolloner

New submission from Florian Apolloner :

If I use the server code in the attachment I get this error in unwrap:

Traceback (most recent call last):
  File "server.py", line 23, in 
deal_with_client(connstream)
  File "server.py", line 13, in deal_with_client
s = connstream.unwrap()
  File "/usr/lib/python3.1/ssl.py", line 302, in unwrap
s = self._sslobj.shutdown()
socket.error: [Errno 0] Error

This error message is imo far from optiomal as it gives no clue whatsoever. My 
Openssl version is: 'OpenSSL 0.9.8o 01 Jun 2010'. Aside from that 
connstream.close() doesn't close the underlying socket (as seen in 
http://bugs.python.org/issue10127 Reproduceable with py2.6 and 2.7). The only 
way to properly close the connection now is:

connstream.close(); newsocket.close()
or 
del newsocket; connstream.close()
Maybe the docs should point that out more prominent.

If you need more info just tell me.

--
components: None
files: server.py
messages: 125081
nosy: apollo13
priority: normal
severity: normal
status: open
title: ssl unwrap fails with Error 0
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1
Added file: http://bugs.python.org/file20227/server.py

___
Python tracker 

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



[issue10798] test_concurrent_futures fails on FreeBSD

2011-01-02 Thread Brian Quinlan

Brian Quinlan  added the comment:

Martin,

Could you commit this patch if you think that it is the right thing? I'm going 
to be restructuring the tests and don't want you to get caught in merge hell.

Cheers,
Brian

--

___
Python tracker 

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



[issue10475] hardcoded compilers for LDSHARED/LDCXXSHARED on NetBSD

2011-01-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Patch committed in r87639 (3.2), r87641 (3.1) and r87640 (2.7). Thank you!

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed
versions:  -Python 2.5, Python 2.6

___
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-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

After further testing, it turns out that Windows exhibits BSD-like behaviour 
too. So instead of complicating the flag-setting code again, I suggest an 
alternative of doing it in the Python wrapper. Patch attached.

--
Added file: http://bugs.python.org/file20226/nonblock.patch

___
Python tracker 

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



[issue10807] `b'dGVzdA==\n'.decode('base64')` raise exception

2011-01-02 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
nosy: +belopolsky

___
Python tracker 

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



[issue10807] `b'dGVzdA==\n'.decode('base64')` raise exception

2011-01-02 Thread Georg Brandl

Georg Brandl  added the comment:

Looks good, please commit.

--

___
Python tracker 

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



[issue10807] `b'dGVzdA==\n'.decode('base64')` raise exception

2011-01-02 Thread STINNER Victor

STINNER Victor  added the comment:

Ah yes :-)

--
Added file: http://bugs.python.org/file20225/issue10807.patch

___
Python tracker 

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



[issue10807] `b'dGVzdA==\n'.decode('base64')` raise exception

2011-01-02 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file20224/issue10780.patch

___
Python tracker 

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



[issue10807] `b'dGVzdA==\n'.decode('base64')` raise exception

2011-01-02 Thread Georg Brandl

Georg Brandl  added the comment:

That does not look like the right patch...

--

___
Python tracker 

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



[issue10807] `b'dGVzdA==\n'.decode('base64')` raise exception

2011-01-02 Thread STINNER Victor

STINNER Victor  added the comment:

issue10807.patch just disables hex, base64, ... codecs in aliases (so it's 
still possible to use they through codecs.lookup()).

--
keywords: +patch
Added file: http://bugs.python.org/file20224/issue10780.patch

___
Python tracker 

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



[issue10807] `b'dGVzdA==\n'.decode('base64')` raise exception

2011-01-02 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +georg.brandl
priority: normal -> release blocker

___
Python tracker 

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



[issue7475] codecs missing: base64 bz2 hex zlib hex_codec ...

2011-01-02 Thread STINNER Victor

STINNER Victor  added the comment:

See issue #10807: 'base64' can be used with bytes.decode() (and str.encode()), 
but it raises a confusing exception (TypeError: expected bytes, not memoryview).

--

___
Python tracker 

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



[issue10807] `b'dGVzdA==\n'.decode('base64')` raise exception

2011-01-02 Thread STINNER Victor

STINNER Victor  added the comment:

base64, bz2, hex, quopri, rot13, uu and zlib codecs (reintroduced recently by 
r86934, issue #7475) cannot be used by str.encode/bytes.decode, but with 
.transform() and .untransform() methods of bytes and str objects. But these 
methods were removed by r87176.

The last solution to use base64 codec is:

>>> import codecs
>>> codecs.lookup('base64').decode(b'YWJj\n')[0]
b'abc'
>>> codecs.lookup('base64').encode(b'YWJj\n')[0]
b'abc'

Or simply use directly the base64 module:

>>> import base64
>>> base64.decodebytes(b'YWJj\n')
b'abc'
>>> base64.encodebytes(b'abc')
b'YWJj\n'

base64, bz2, hex, quopri, rot13, uu and zlib codecs should be removed from 
encodings.aliases (because they introduced a confusion for Python 2 users), or 
removed completly (because it's easier to use directly the related module, eg. 
base64 or zlib).

--
nosy: +haypo

___
Python tracker 

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



[issue8013] time.asctime segfaults when given a time in the far future

2011-01-02 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

On Sun, Jan 2, 2011 at 1:52 PM, Alexander Belopolsky
 wrote:
..
>> Well, then I would have no problem with checking for that condition 
>> beforehand and raising
>> ValueError.
>>
>
> IIRC, there was a similar bug report about ctime where pre-condition
> checking was required because platform ctime would crash for huge
> values of time.  I'll try to find the ticket.

Hmm. My search brought up issue 10563, but the last message on that
issue says that "a change has been recently made to time.asctime() to
reject year > .  See r85137 and issue6608."  I wonder if that
change made this issue moot.

--

___
Python tracker 

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



[issue8013] time.asctime segfaults when given a time in the far future

2011-01-02 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

On Sun, Jan 2, 2011 at 10:52 AM, Georg Brandl  wrote:
..
> Well, then I would have no problem with checking for that condition 
> beforehand and raising
> ValueError.
>

IIRC, there was a similar bug report about ctime where pre-condition
checking was required because platform ctime would crash for huge
values of time.  I'll try to find the ticket.

> On the other hand, it seems that implementations either return a correct 
> string or NULL,
> so just erroring out in case of NULL would be fine as well.

This is true on the platforms that I have access to: OSX, Linux, and
Solaris.  I think asctime_r is available and behaves this way on
Python supported platforms.  I'll check this in and watch the bots.

--

___
Python tracker 

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



[issue10791] Wrapping TextIOWrapper around gzip files

2011-01-02 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

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



[issue10806] Subprocess error if fds 0,1,2 are closed

2011-01-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Attached is a patch which basically uses fcntl if necessary to remove
> the close-on-exec flag, and tests.

Python adds extra output at the end of stderr when compiled in debug
mode. Therefore you first have to strip that output, like this:

out, err = subprocess.Popen(...).communicate()
err = support.strip_python_stderr(err)
self.assertEqual((out, err), (b'apple', b'orange'))

Otherwise, looks good, thank you.

--

___
Python tracker 

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



  1   2   >