[issue8350] Document lack of support for keyword arguments in C functions

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

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

 Isn't it kind of a CPython-specific detail, though?

If other implementations do provide proper keyword arguments,
I'd be skeptical that they all settled on the names that the
library documentation gives to the arguments.

--
title: Document lack of support for keyword arguments in C functions - 
Document lack of support for keyword arguments in C functions

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8350
___
___
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

Changes by Martin v. Löwis mar...@v.loewis.de:


--
nosy: +loewis

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10802
___
___
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 pierre.quen...@gmail.com added the comment:

Hi,

I have started working on the port of a simplified version of Karrigell (a web 
framework) to Python3. I experienced the same problem as the other posters : in 
the current version, file upload doesn't work. So I've been working on the cgi 
module for a few days and now have a version which correctly manages file 
uploads in the tests I made

The problem in the current version (3.2b2) is that all data is read from 
sys.stdin, which reads strings, not bytes. This obviously can't work properly 
to upload binary files. In the proposed version, for multipart/form-data type, 
all data is read as bytes from sys.stdin.buffer ; in the CGI script, the Python 
interpreter must be launched with the -u option, as suggested by Amaury, 
otherwise sys.stdin.buffer.read() only returns the beginning of the data stream

The headers inside the multipart/form-data are decoded to a string using 
sys.stdin.encoding and passed to a FeedParser (which requires strings) ; then 
the data is read from sys.stdin.buffer (bytes) until a boundary is found

If the field is a file, the file object in self.file stores bytes, and the 
attribute value is a byte string. If it is not a file, the value is decoded 
to a string, always using sys.stdin.encoding, as for all other fields for other 
types of forms

Other cosmetic changes :
- replaced while 1 by while True
- replaced if type(value) == type([]) by if isintance(value,list)

Attached file : zip with cgi_new.py and tests in a folder called http
Tested with Python 3.2b2 (r32b2:87398, Dec 19 2010, 22:51:00) [MSC v.1500 32 
bit (Intel)] on win32 ; files and CGI scripts served by Apache 2.2

--
nosy: +quentel
Added file: http://bugs.python.org/file20217/http.zip

___
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



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

2011-01-02 Thread kai zhu

kai zhu kaizhu...@gmail.com added the comment:

tested w/ following debug code.  looks like greg is correct - HAVE_PIPE2 should 
NOT b defined under colinux.

diff -r 6fa1e3b94d8f Modules/_posixsubprocess.c
--- a/Modules/_posixsubprocess.cSat Jan 01 22:18:46 2011 +0100
+++ b/Modules/_posixsubprocess.cSun Jan 02 03:48:47 2011 -0500
@@ -412,10 +412,12 @@
 int fds[2];
 int res;
 #ifdef HAVE_PIPE2
+PyErr_Format(PyExc_RuntimeError, HAVE_PIPE2 = %i, O_CLOEXEC = %i, 
HAVE_PIPE2, O_CLOEXEC); return NULL;
 Py_BEGIN_ALLOW_THREADS
 res = pipe2(fds, O_CLOEXEC);
 Py_END_ALLOW_THREADS
 #else
+PyErr_Format(PyExc_RuntimeError, HAVE_PIPE2 not defined, O_CLOEXEC = %i, 
O_CLOEXEC); return NULL;
 /* We hold the GIL which offers some protection from other code calling
  * fork() before the CLOEXEC flags have been set but we can't guarantee
  * anything without pipe2(). */



b2 release:
./python -c 'import _posixsubprocess; _posixsubprocess.cloexec_pipe()'
Traceback (most recent call last):
  File string, line 1, in module
RuntimeError: HAVE_PIPE2 not defined, O_CLOEXEC = 524288



latest hg:
./python -c 'import _posixsubprocess; _posixsubprocess.cloexec_pipe()'
Traceback (most recent call last):
  File string, line 1, in module
RuntimeError: HAVE_PIPE2 = 1, O_CLOEXEC = 524288

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10802
___
___
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 kaizhu...@gmail.com added the comment:

i used the same almost vanilla configure for both:

$ ./configure --prefix=$USERPATH; make

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10802
___
___
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 Sandro Tosi

Sandro Tosi sandro.t...@gmail.com added the comment:

I've refreshed the patch to only add DeprecationWarning for tempnam, tmpnam and 
tmpfile.

--
stage:  - patch review
Added file: http://bugs.python.org/file20218/issue4662-rel2.7.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4662
___
___
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 mar...@v.loewis.de added the comment:

Can you please run the script under strace, and report what system call is not 
implemented? I.e. put

  import subprocess
  subprocess.Popen('ls')

into a file (foo.py), then run

  strace -o trace.txt python foo.py

Please attach the output in case you cannot identify the problem.

--

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



[issue1665333] Documentation missing for OptionGroup class in optparse

2011-01-02 Thread Sandro Tosi

Sandro Tosi sandro.t...@gmail.com added the comment:

Could someone give a look to this patch? I can work on fixing the missing stuff 
(if any :)).

--
stage:  - patch review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1665333
___
___
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 Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

I think I've found the problem: test_concurrent_futures calls logging.critical, 
which registers a StreamHandler. This only happens when _wait_on_event and 
_signal_event fail on Win32.

There should be no reason to call logging.critical in a test, especially as the 
next line is assert False, message.

Perhaps the lines were left in by mistake: reassigning to Brian Quinlan.

--
assignee: vinay.sajip - bquinlan
nosy: +bquinlan

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



[issue10348] multiprocessing: use SysV semaphores on FreeBSD

2011-01-02 Thread STINNER Victor

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

More info about FreeBSD.

sysctl p1003_1b.sem_nsems_max gives the maximum number of POSIX semaphores 
(per process? system wide?).

Since FreeBSD 8.1, sudo sysctl -w p1003_1b.sem_nsems_max=256 can be used to 
change this limit at runtime.

Before FreeBSD 8.1, SEM_MAX constant should be changed in the kernel source 
code, and the kernel have to be recompiled. (p1003_1b.sem_nsems_max is not 
configurable in /etc/sysctl.conf, it is an hardcoded limit).

Before FreeBSD 8.0, the POSIX semaphores are disabled by default: the kernel 
have to be compiled using P1003_1B_SEMAPHORES option. Extract of sys/conf/NOTES:

#
# POSIX P1003.1B

# Real time extensions added in the 1993 POSIX
# _KPOSIX_PRIORITY_SCHEDULING: Build in _POSIX_PRIORITY_SCHEDULING

options _KPOSIX_PRIORITY_SCHEDULING
# p1003_1b_semaphores are very experimental,
# user should be ready to assist in debugging if problems arise.
options P1003_1B_SEMAPHORES

# POSIX message queue
options P1003_1B_MQUEUE

#

--

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



[issue10348] multiprocessing: use SysV semaphores on FreeBSD

2011-01-02 Thread STINNER Victor

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

NetBSD.

Extract of the sem_close() manpage
http://www.daemon-systems.org/man/sem_close.3.html
---
STANDARDS
 The sem_open(), sem_close(), and sem_unlink() functions conform to
 ISO/IEC 9945-1:1996 (``POSIX.1'').

HISTORY
 Support for named semaphores first appeared in NetBSD 2.0.
---

Martin wrote on the mailing list:
---
According to

http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/uipc_sem.c?rev=1.22content-type=text/x-cvsweb-markuponly_with_tag=MAIN

SEM_MAX is 128 since 2007, and dynamically adjustable (no reboot).
---

It looks like the sysctl (read/write) option is kern.posix.semmax.

--

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



[issue10804] Copy and paste error in _json.c

2011-01-02 Thread Torsten Landschoff

New submission from Torsten Landschoff t.landsch...@gmx.net:

There is a copy and paste error in _json.c: The pairs_hook field is assigned 
but object_hook is verified to be non-null. The same field is verified a few 
lines back to this is superfluous at least.

--
components: Library (Lib)
files: patch
messages: 125044
nosy: torsten
priority: normal
severity: normal
status: open
title: Copy and paste error in _json.c
versions: Python 2.7
Added file: http://bugs.python.org/file20219/patch

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



[issue10348] multiprocessing: use SysV semaphores on FreeBSD

2011-01-02 Thread STINNER Victor

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

Darwin (Mac OS X).

According to the following email (July 2010), Darwin supports POSIX semaphores 
and the default limit is 10,000 semaphores.
http://osdir.com/ml/darwin-dev/2010-07/msg00012.html

The limit is configurable via sysctl as kern.posix.sem.max.

--

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



[issue10348] multiprocessing: use SysV semaphores on FreeBSD

2011-01-02 Thread STINNER Victor

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

OpenBSD.

According to Martin, OpenBSD doesn't implement POSIX semaphores.
---
I don't have an installation of OpenBSD, but...

In FreeBSD, POSIX semaphores are implemented in sys/kern/uipc_sem.c.
In

http://www.openbsd.org/cgi-bin/cvsweb/src/sys/kern/

that file doesn't exist. Also, in FreeBSD's limits.h,
_POSIX_SEM_NSEMS_MAX is defined (surprisingly to 256);
in

http://www.openbsd.org/cgi-bin/cvsweb/~checkout~/src/include/limits.h?rev=1.15;content-type=text/plain

this constant doesn't appear. So ISTM that OpenBSD doesn't implement
POSIX semaphores. IIUC, this means that the multiprocessing module
won't be fully functional, and its tests (and the concurrent.futures
tests) will be skipped.
---

--

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



[issue10804] Copy and paste error in _json.c

2011-01-02 Thread Torsten Landschoff

Torsten Landschoff t.landsch...@gmx.net added the comment:

FYI, this bug is not in Python 3.3 (as of svn r87615).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10804
___
___
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 kaizhu...@gmail.com added the comment:

the culprit was my colinux kernel (2.6.26.8-co-0.7.7.1) did not have pipe2 
support (which libc erronenously assumed). updating the kernel fixed the 
problem.

the libc issue is partially discussed @ 
http://www.0x61.com/forum/linux-kernel-f109/popen2-popen-call-t1229012.html.  
according to manpage pipe2 was not added to the kernel til 2.6.27

my guess is this affects all unstable debian systems which are running kernels 
2.6.26 or older (u decide whether or not using old kernels for debian unstable 
is an edge case ;)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10802
___
___
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 Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

A few comments about css_v2.diff:
1) when the value is '0', there's no need to specify the unit (e.g. 0em);
2) when the color is specified the background-color should be specified as well 
(and vice versa);
3) hex colors (e.g. #00FF00) should be preferred to named colors (e.g. gray);
4) some selectors and properties don't work with older browsers (e.g. E  F or 
min-width);
5) there are a few empty dl.*{} that I would remove (unless you plan to fill 
them later);
6) the style I prefer for CSS is:
selector {
  property: value;
}

Regarding the HTML:
1) using an HTML 4.01 strict doctype would be better;
2) all the style-related attributes and elements should be removed (e.g 
bgcolor, valign, font);
3) using .red { color: red; } is not a good idea. Classes' names should 
describe the role of the element (e.g. header, entry) and not their style 
(otherwise when you want to change the page with a blue theme you'll end up 
with a .red { color: blue; }). 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;
4) the lis in html_header() should be closed, same for all the other elements 
that support a closing tag, even if optional (e.g. dt, dd);

There are also some minor incontinences in the indentantion, e.g.:
+link_list = ['a href=%s.html%s/a' % (name, name)
+for name in sys.builtin_module_names
+if name != '__main__']
+contents = [html.index_columns('Built-in modules',
+link_list, css_class='section modules')]
+link_list = ['a href=%s.html%s/a' % (name, name)
+  for name in sorted(Helper.keywords.keys())]
(the contents one is indented correctly), and some extra space after the '('.

--

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



[issue9905] subprocess.Popen fails with stdout=PIPE, stderr=PIPE if standard descriptors (0, 1, 2) are closed.

2011-01-02 Thread Ross Lagerwall

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

OK here is a patch + tests. Basically, it makes sure that the fd that it is 
closing is not 0, 1 or 2.

I've set it for 2.7, 3.1 and 3.2.

--
keywords: +patch
nosy: +rosslagerwall
versions: +Python 2.7, Python 3.1, Python 3.2 -Python 2.6
Added file: http://bugs.python.org/file20220/i9905_v1.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9905
___
___
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 kaizhu...@gmail.com added the comment:

hi martin, did an strace  the 'not implemented' system call was pipe2()

pipe2 exists in libc (checked w/ ctypes), but is broken for old linux kernels 
as mentioned previously.

--
Added file: http://bugs.python.org/file20221/trace2.txt

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10802
___
___
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 Georg Brandl

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

Does not seem to be a Python problem then.  Thanks for diagnosing!

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

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



[issue10804] Copy and paste error in _json.c

2011-01-02 Thread Georg Brandl

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

Thanks, fixed in r87626.

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

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10804
___
___
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 Austin Bingham

New submission from Austin Bingham austin.bing...@gmail.com:

traceback.print_exception() will throw an AttributeException if `value` is None 
and `chain` is True. This is because `_iter_chain` assumes that the exception 
object has a `__cause__` attribute. You can trigger this by trying for format a 
non-existent exception:

   import logging, sys
   logging.Formatter().formatException(sys.exc_info())
  Traceback (most recent call last):
  File stdin, line 1, in module
  File /usr/lib/python3.1/logging/__init__.py, line 418, in formatException
traceback.print_exception(ei[0], ei[1], ei[2], None, sio)
  File /usr/lib/python3.1/traceback.py, line 155, in print_exception
for value, tb in values:
  File /usr/lib/python3.1/traceback.py, line 122, in _iter_chain
cause = exc.__cause__

This is assuming that sys.exc_info() returns (None, None, None).

--
components: Library (Lib)
messages: 125054
nosy: abingham
priority: normal
severity: normal
status: open
title: traceback.print_exception throws AttributeError when exception is None
type: behavior
versions: Python 3.1

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



[issue1665333] Documentation missing for OptionGroup class in optparse

2011-01-02 Thread Georg Brandl

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

Looks good, applied in r87627 (after removing stray tabs).

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

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1665333
___
___
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 ge...@python.org added the comment:

The patch is wrong: it hardcodes the number of characters that the time string 
has, but it can be more than 24 if the year is  .  (Of course, the check 
for \n currently in the code is wrong too and must be fixed.)

Also, shouldn't the issue be handled as in ctime()?  There is a NULL check 
there, and by just doing that check we wouldn't depend on asctime_r().

--
assignee:  - belopolsky
nosy: +belopolsky, georg.brandl

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



[issue5870] subprocess.DEVNULL

2011-01-02 Thread Georg Brandl

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

Hmm, we don't like these open-for-eternity file descriptors; we had such a 
thing for os.urandom() but removed it (see #1177468).

I'm okay with DEVNULL (or even just NULL) as a shorthand, but it should open 
(and close) the devnull device each time just as if a normal fd was given.

--
nosy: +georg.brandl

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



[issue5870] subprocess.DEVNULL

2011-01-02 Thread Ross Lagerwall

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

I think if you look closely at the patch, the fd does not stay open the whole 
time. It is opened if necessary in _get_handles() with e.g.:

elif stdin == DEVNULL:
p2cread = self._get_devnull()

and then closed in _execute_child() with:

if hasattr(self, '_devnull'):
os.close(self._devnull)

which is executed from __init__(). So I don't think it stays open for eternity 
:-)

--

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



[issue9074] subprocess closes standard file descriptors when it should not

2011-01-02 Thread Georg Brandl

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

#9905 has a similar patch and adds tests as well.

--
nosy: +georg.brandl
resolution:  - duplicate
status: open - closed
superseder:  - subprocess.Popen fails with stdout=PIPE, stderr=PIPE if 
standard descriptors (0, 1, 2) are closed.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9074
___
___
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 andy-pyt...@hammerhartes.de added the comment:

The real problem with years =  is that it is undefined behaviour anyway 
(see e.g. 
http://pubs.opengroup.org/onlinepubs/9699919799/functions/asctime.html: the 
behavior is undefined if the above algorithm would attempt to generate more 
than 26 bytes of output (including the terminating null)).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8013
___
___
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 andy-pyt...@hammerhartes.de added the comment:

Sorry, I meant  years   of course.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8013
___
___
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 ge...@python.org added the comment:

Well, then I would have no problem with checking for that condition beforehand 
and raising ValueError.

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.

--

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



[issue5870] subprocess.DEVNULL

2011-01-02 Thread Georg Brandl

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

Right, sorry then :)

--
assignee:  - gregory.p.smith
nosy: +gregory.p.smith

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5870
___
___
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 pit...@free.fr added the comment:

I've tried the patch under OpenSolaris and the test fails (EAGAIN),
meaning that accept() semantics there are the same as under BSD:

==
ERROR: testInheritFlags (test.test_socket.NonBlockingTCPTests)
--
Traceback (most recent call last):
  File /home/antoine/vbox/py3k/cc/Lib/test/test_socket.py, line 983,
in testInheritFlags
message = conn.recv(len(MSG))
socket.error: [Errno 11] Resource temporarily unavailable

I think the code path in the patch should be opt-out rather than opt-in:
that is, it should be executed if HAVE_FCNTL, O_NONBLOCK are defined,
and if not under Linux.
(and I don't think O_ASYNC is useful here, is it?)

--

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

Changes by Etienne Robillard e...@gthcfoundation.org:


--
nosy: +erob

___
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-02 Thread R. David Murray

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

Thank you very much for working on this!  I'll try to take a look at the patch 
soon.  A couple quick comments based on your posting: first, the email module 
now has a BytesFeedparser that will accept a byte stream, which I hope might 
simplify your patch.  Second, it would be very helpful if you could upload your 
patch as an 'svn diff' against the current py3k trunk (see python.org/dev for 
details on how to do that).  That will make review and application of the patch 
much much simpler.  (This would be true even if more of the code in cgi.py has 
changed than not.)  If you don't want to set up an svn checkout, then a context 
diff against the copy of cgi.py you started with would be second best.  Please 
post any files individually as .patch or .diff or .txt files...these are 
preferred in the tracker over .zip files because they can be viewed without 
downloading.

--
stage: unit test needed - patch review
versions: +Python 3.3 -Python 3.0, Python 3.1, Python 3.2

___
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



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

2011-01-02 Thread Ross Lagerwall

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

OK try this one, it's now opt-out.

--
Added file: http://bugs.python.org/file20222/7995_v3.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7995
___
___
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

New submission from Ross Lagerwall rosslagerw...@gmail.com:

There is an issue where if a python program closes all the std. file 
descriptors (e.g. a daemon) and then uses the subprocess module, the file 
descriptors may not be set up properly in the subprocess. This may actually be 
a fairly common use case in a daemon program that needs to run a subprocess and 
set up pipes to it.

Here is an example:

import os, subprocess, sys

x=os.open('/dev/null', os.O_RDWR)
os.close(0)
os.close(1)
os.close(2)

res = subprocess.Popen([sys.executable, -c,
  'import sys;'
  'sys.stdout.write(apple);'
  'sys.stdout.flush();'
  'sys.stderr.write(orange)'],
   stdin=x,
   stdout=subprocess.PIPE,
   stderr=subprocess.PIPE).communicate()
with open('/tmp/out', 'w') as f:
f.write(repr(res) + '\n')
f.write(repr((b'apple', b'orange')) + '\n')

The expected output in /tmp/out is:
('apple', 'orange')
('apple', 'orange')

but we get:
(b'', bFatal Python error: Py_Initialize: can't initialize sys standard 
streams\nOSError: [Errno 9] Bad file descriptor\n)
(b'apple', b'orange')

The problem comes about where the calls are made (this applies to the python  
c versions):
 os.dup2(p2cread, 0)
 os.dup2(c2pwrite, 1)
 os.dup2(errwrite, 2)

if c2pwrite or p2cread or errwrite is the same as what it's being dupped() to 
(eg if c2pwrite == 1) then the dup2 call does nothing. But, if we're using 
pipes, the close-on-exec flags are set initially and the dup2() call would 
normally remove the flag but it doesn't.

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

--
components: Library (Lib)
files: subprocess.patch
keywords: patch
messages: 125067
nosy: georg.brandl, giampaolo.rodola, gregory.p.smith, pitrou, rosslagerwall
priority: normal
severity: normal
status: open
title: Subprocess error if fds 0,1,2 are closed
type: behavior
versions: Python 3.2
Added file: http://bugs.python.org/file20223/subprocess.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10806
___
___
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 Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
components: +Library (Lib) -Extension Modules
stage:  - needs patch
title: WSGIREF - REMOTE_USER and REMOTE-USER collision - REMOTE_USER and 
Remote-User collision in wsgiref
type: security - behavior
versions: +Python 3.1, Python 3.2 -Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10751
___
___
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 yihuang

New submission from yihuang yi.codepla...@gmail.com:

 b'dGVzdA==\n'.decode('base64')
Traceback (most recent call last):
  File stdin, line 1, in module
  File ../Lib/encodings/base64_codec.py, line 20, in base64_decode
return (base64.decodebytes(input), len(input))
  File ../Lib/base64.py, line 359, in decodebytes
raise TypeError(expected bytes, not %s % s.__class__.__name__)
TypeError: expected bytes, not memoryview

--
components: Unicode
messages: 125068
nosy: yi.codeplayer
priority: normal
severity: normal
status: open
title: `b'dGVzdA==\n'.decode('base64')` raise exception
type: behavior
versions: Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10807
___
___
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 pit...@free.fr 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 rep...@bugs.python.org
http://bugs.python.org/issue10806
___
___
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 mer...@netwok.org:


--
nosy: +eric.araujo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10791
___
___
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 alexander.belopol...@gmail.com added the comment:

On Sun, Jan 2, 2011 at 10:52 AM, Georg Brandl rep...@bugs.python.org 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 rep...@bugs.python.org
http://bugs.python.org/issue8013
___
___
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 alexander.belopol...@gmail.com added the comment:

On Sun, Jan 2, 2011 at 1:52 PM, Alexander Belopolsky
rep...@bugs.python.org 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 rep...@bugs.python.org
http://bugs.python.org/issue8013
___
___
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 victor.stin...@haypocalc.com 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 rep...@bugs.python.org
http://bugs.python.org/issue10807
___
___
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 victor.stin...@haypocalc.com 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 rep...@bugs.python.org
http://bugs.python.org/issue7475
___
___
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 victor.stin...@haypocalc.com:


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

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10807
___
___
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 victor.stin...@haypocalc.com 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 rep...@bugs.python.org
http://bugs.python.org/issue10807
___
___
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 ge...@python.org added the comment:

That does not look like the right patch...

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10807
___
___
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 victor.stin...@haypocalc.com:


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

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10807
___
___
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 victor.stin...@haypocalc.com added the comment:

Ah yes :-)

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

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10807
___
___
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 ge...@python.org added the comment:

Looks good, please commit.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10807
___
___
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 belopol...@users.sourceforge.net:


--
nosy: +belopolsky

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10807
___
___
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 pit...@free.fr 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 rep...@bugs.python.org
http://bugs.python.org/issue7995
___
___
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 pit...@free.fr 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 rep...@bugs.python.org
http://bugs.python.org/issue10475
___
___
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 br...@sweetapp.com 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 rep...@bugs.python.org
http://bugs.python.org/issue10798
___
___
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 flor...@apolloner.eu:

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 module
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 rep...@bugs.python.org
http://bugs.python.org/issue10808
___
___
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 p...@telecommunity.com 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 rep...@bugs.python.org
http://bugs.python.org/issue10751
___
___
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 rosslagerw...@gmail.com 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 rep...@bugs.python.org
http://bugs.python.org/issue10806
___
___
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 victor.stin...@haypocalc.com added the comment:

 Looks good, please commit.

Ok, done: r87642

--
resolution:  - fixed
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10807
___
___
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 alexander.belopol...@gmail.com added the comment:

On Sun, Jan 2, 2011 at 1:59 PM, Alexander Belopolsky
rep...@bugs.python.org 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 rep...@bugs.python.org
http://bugs.python.org/issue8013
___
___
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 pierre.quen...@gmail.com 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 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



[issue4662] posix module lacks several DeprecationWarning's

2011-01-02 Thread Antoine Pitrou

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

Patch committed in r87643, thank you.

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

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4662
___
___
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 pierre.quen...@gmail.com 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 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



[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 mar...@v.loewis.de 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 rep...@bugs.python.org
http://bugs.python.org/issue10802
___
___
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 pit...@free.fr 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 rep...@bugs.python.org
http://bugs.python.org/issue10806
___
___
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 arfrever@gmail.com 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 rep...@bugs.python.org
http://bugs.python.org/issue10475
___
___
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 g...@krypto.org 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 rep...@bugs.python.org
http://bugs.python.org/issue10802
___
___
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 g...@krypto.org 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 rep...@bugs.python.org
http://bugs.python.org/issue10802
___
___
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 yo...@users.sourceforge.net:


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

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue670664
___
___
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 pit...@free.fr 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 rep...@bugs.python.org
http://bugs.python.org/issue10806
___
___
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 yo...@users.sourceforge.net:


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

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue670664
___
___
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 belopol...@users.sourceforge.net added the comment:

Committed in revision 87648.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8013
___
___
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 yo...@users.sourceforge.net 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 rep...@bugs.python.org
http://bugs.python.org/issue670664
___
___
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 pit...@free.fr 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 rep...@bugs.python.org
http://bugs.python.org/issue10475
___
___
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 michael.mischurow+...@gmail.com 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 rep...@bugs.python.org
http://bugs.python.org/issue8013
___
___
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 v+pyt...@g.nevcal.com 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 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



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

2011-01-02 Thread Antoine Pitrou

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

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

--
Added file: http://bugs.python.org/file20234/sp2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10806
___
___
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 o...@held.org.il 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 rep...@bugs.python.org
http://bugs.python.org/issue10800
___
___
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 steven.beth...@gmail.com 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 rep...@bugs.python.org
http://bugs.python.org/issue10772
___
___
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 da...@dalkescientific.com:

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:

 float  - real part only
 floatj - imaginary part only
 floatsigned-floatj   - real and imaginary parts

   where float represents any numeric string that's accepted by the
   float constructor (including 'nan', 'inf', 'infinity', etc.), and
   signed-float is any string of the form float 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 rep...@bugs.python.org
http://bugs.python.org/issue10809
___
___
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 ge...@python.org:


--
assignee:  - pitrou
nosy: +pitrou

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10808
___
___
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 pklei...@xs4all.nl added the comment:

Why not simply:

fp = sys.stdin.detach()

--

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

Pierre Quentel pierre.quen...@gmail.com 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 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



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

2011-01-02 Thread STINNER Victor

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

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

--
nosy: +haypo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10806
___
___
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 v+pyt...@g.nevcal.com 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 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



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

2011-01-02 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com 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 rep...@bugs.python.org
http://bugs.python.org/issue8013
___
___
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 kaizhu...@gmail.com 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 rep...@bugs.python.org
http://bugs.python.org/issue10802
___
___
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 ron_a...@users.sourceforge.net 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. 
hint hint  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 rep...@bugs.python.org
http://bugs.python.org/issue10716
___
___
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 ge...@python.org 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 rep...@bugs.python.org
http://bugs.python.org/issue8013
___
___
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 ge...@python.org 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 rep...@bugs.python.org
http://bugs.python.org/issue10716
___
___
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 pklei...@xs4all.nl 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 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



[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 amaur...@gmail.com 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 rep...@bugs.python.org
http://bugs.python.org/issue8278
___
___
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 
arfrever@gmail.com:

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 rep...@bugs.python.org
http://bugs.python.org/issue10810
___
___
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 alexander.belopol...@gmail.com added the comment:

On Sun, Jan 2, 2011 at 5:35 PM, Georg Brandl rep...@bugs.python.org 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 rep...@bugs.python.org
http://bugs.python.org/issue8013
___
___
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 ge...@python.org added the comment:

Thanks, fixed in r87660.

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

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10810
___
___
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 ge...@python.org 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 rep...@bugs.python.org
http://bugs.python.org/issue8013
___
___
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 alexander.belopol...@gmail.com added the comment:

On Sun, Jan 2, 2011 at 6:01 PM, Georg Brandl rep...@bugs.python.org 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 rep...@bugs.python.org
http://bugs.python.org/issue8013
___
___
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 ge...@python.org added the comment:

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

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8013
___
___
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 ron_a...@users.sourceforge.net 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 rep...@bugs.python.org
http://bugs.python.org/issue10716
___
___
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 ge...@python.org 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 rep...@bugs.python.org
http://bugs.python.org/issue8013
___
___
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 alexander.belopol...@gmail.com added the comment:

On Sun, Jan 2, 2011 at 6:10 PM, Georg Brandl rep...@bugs.python.org 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 rep...@bugs.python.org
http://bugs.python.org/issue8013
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >