[issue12173] PyImport_ImportModuleLevel doesn't have 'const' on its argument

2011-05-25 Thread Chris Angelico

New submission from Chris Angelico :

An anomaly in the argument types of similar functions: 
PyImport_ImportModuleLevel takes char *, while the related functions 
PyImport_AddModule, PyImport_ImportModule, and PyImport_ImportModuleNoBlock all 
take const char *. This made a nuisance of itself for me when I tried to 
compile my code against Python.h (embedding Python). Attached is a relatively 
trivial patch to add const. Should not impact existing code, as the compiler 
will happily pass a char* to a const char* (just not the other way).

--
components: Interpreter Core
files: importconst.patch
keywords: patch
messages: 136829
nosy: Rosuav
priority: normal
severity: normal
status: open
title: PyImport_ImportModuleLevel doesn't have 'const' on its argument
type: feature request
versions: Python 3.3
Added file: http://bugs.python.org/file22103/importconst.patch

___
Python tracker 

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



[issue12173] PyImport_ImportModuleLevel doesn't have 'const' on its argument

2011-05-25 Thread Ezio Melotti

Changes by Ezio Melotti :


--
keywords: +needs review
nosy: +brett.cannon, haypo
stage:  -> patch review

___
Python tracker 

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



[issue12172] IDLE crashes when I use F5 to run

2011-05-25 Thread Ned Deily

Ned Deily  added the comment:

How are you launching IDLE? Are you sure you aren't launching the IDLE for the 
Apple-supplied Python 2.6?  The two easiest ways to launch IDLE 3.2 are to 
either double-click on the IDLE file in the /Applications/Python 3.2 folder or, 
from a terminal shell window, type /usr/local/bin/idle3.2.  The resulting 
"Python Shell" window should say Python 3.2.  If you still get a crash, please 
report any relevant output from the system.log; you can use 
/Applications/Utilities/Console.app to examine system.log.  Or, if there is an 
OS X crash report, report the output from that.  You could also verify the 
patch level of the ActiveState Tcl by doing the following:

cd /Library/Frameworks/Tcl.framework
grep TCL_VERSION tclConfig.sh
# should be "TCL_VERSION='8.5'"
grep TCL_PATCH tclConfig.sh
# should be "TCL_PATCH_LEVEL='.9'"

--
assignee:  -> ned.deily
nosy: +ned.deily

___
Python tracker 

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



[issue12171] Reset method of the incremental encoders of CJK codecs calls the decoder reset function

2011-05-25 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Amaury Forgeot d'Arc wrote:
> 
> Amaury Forgeot d'Arc  added the comment:
> 
> Do we need an additional method? It seems that this reset() could also be 
> written encoder.encode('', final=True)

+1

I think that's a much more natural way to implement "finalize the
encoding output without adding any data to it".

--
title: Reset method of the incremental encoders of CJK codecs calls the decoder 
reset function -> Reset method of the incremental encoders of CJK codecs
calls the decoder reset function

___
Python tracker 

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



[issue12049] expose RAND_bytes() function of OpenSSL

2011-05-25 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 96a82c973224 by Victor Stinner in branch 'default':
Issue #12049: test_ssl now checks also that RAND_bytes() raises an error if
http://hg.python.org/cpython/rev/96a82c973224

--

___
Python tracker 

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



[issue12049] expose RAND_bytes() function of OpenSSL

2011-05-25 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 178d367c9733 by Victor Stinner in branch 'default':
Issue #12049: Document errors cases of ssl.RAND_bytes() and
http://hg.python.org/cpython/rev/178d367c9733

--

___
Python tracker 

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



[issue12165] Does nonlocal include global?

2011-05-25 Thread Lukas Petru

Lukas Petru  added the comment:

Well, I read that text before, but it may be because I am not native english 
speaker that I interpret the text differently. Let's go through it one step at 
a time and show me where I am wrong.

1) The nonlocal statement causes the listed identifiers to refer to previously 
bound variables in the nearest enclosing scope.

- I assume here that global scope is an enclosing scope (global encloses 
everything in the module).

2) The statement allows encapsulated code to rebind variables outside of the 
local scope besides the global (module) scope.

- Here I interpret "besides" as "in addition to".

Nothing specifically says that global bindings are excluded.

--

___
Python tracker 

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



[issue11272] input() has trailing carriage return on windows

2011-05-25 Thread Giuseppe Laurenza

Giuseppe Laurenza  added the comment:

On my pc with both architecture (x86 and x64) the bug is still presentes

--
nosy: +Phoenix Fire

___
Python tracker 

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



[issue11272] input() has trailing carriage return on windows

2011-05-25 Thread STINNER Victor

STINNER Victor  added the comment:

> On my pc with both architecture (x86 and x64) the bug
> is still presentes

Which version of Python are you using? Python 3.1, Python 3.2.1 and Python 3.3 
doesn't have the bug, Python 3.2.0 has the bug. Python 3.2.1 doesn't have the 
bug, but it's not released yet: it will be released in a few weeks. Python 3.3 
is a development version.

--

___
Python tracker 

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



[issue11272] input() has trailing carriage return on windows

2011-05-25 Thread Giuseppe Laurenza

Giuseppe Laurenza  added the comment:

I'm using the 3.2,
the 3.0 has the bug?

2011/5/25 STINNER Victor 

>
> STINNER Victor  added the comment:
>
> > On my pc with both architecture (x86 and x64) the bug
> > is still presentes
>
> Which version of Python are you using? Python 3.1, Python 3.2.1 and Python
> 3.3 doesn't have the bug, Python 3.2.0 has the bug. Python 3.2.1 doesn't
> have the bug, but it's not released yet: it will be released in a few weeks.
> Python 3.3 is a development version.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

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

___
Python tracker 

___I'm using the 3.2,the 3.0 has the bug?2011/5/25 STINNER Victor rep...@bugs.python.org>

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

> On my pc with both architecture (x86 and x64) the bug
> is still presentes

Which version of Python are you using? Python 3.1, Python 3.2.1 and 
Python 3.3 doesn't have the bug, Python 3.2.0 has the bug. Python 3.2.1 
doesn't have the bug, but it's not released yet: it will be released in 
a few weeks. Python 3.3 is a development version.


--

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

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



[issue12049] expose RAND_bytes() function of OpenSSL

2011-05-25 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 195de3d10879 by Victor Stinner in branch 'default':
Issue #12049: cleanup the warning in the random module doc
http://hg.python.org/cpython/rev/195de3d10879

--

___
Python tracker 

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



[issue12174] Multiprocessing logging levels unclear

2011-05-25 Thread JJeffries

New submission from JJeffries :

It is unclear without reference to the logging module where the multiprocessing 
logging levels fit in the normal logging provided by the logging module, even 
though it says above the table

"The table below illustrates where theses fit in the
normal level hierarchy.

+++
| Level  | Numeric value  |
+++
| ``SUBWARNING`` | 25 |
+++
| ``SUBDEBUG``   | 5  |
+++"

I propose adding further values from the logging module for clarification.

--
assignee: docs@python
components: Documentation
messages: 136839
nosy: JJeffries, docs@python
priority: normal
severity: normal
status: open
title: Multiprocessing logging levels unclear
versions: Python 3.3

___
Python tracker 

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



[issue12175] FileIO.readall() read the file position and size at each read

2011-05-25 Thread STINNER Victor

New submission from STINNER Victor :

FileIO.readall() reads the file position and size before each call to read(), 
to adjust the buffer size.

Moreover FileIO.readall() calls lseek() on Windows: it should use _lseeki64() 
instead, to handle correctly file bigger than 2 GB (or maybe 4 GB? I don't 
know).

Attached patch fixes both problems.

--

BufferedReader.read() calls FileIO.read() until FileIO.read() returns an empty 
byte string. Why not calling FileIO.read() only once?

--
components: IO
files: fileio_readall.patch
keywords: patch
messages: 136840
nosy: haypo, pitrou
priority: normal
severity: normal
status: open
title: FileIO.readall() read the file position and size at each read
versions: Python 3.3
Added file: http://bugs.python.org/file22105/fileio_readall.patch

___
Python tracker 

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



[issue12174] Multiprocessing logging levels unclear

2011-05-25 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

It seems that the documentation of logging no longer gives a table with numeric 
values for levels (I remember seeing it before). Maybe it would be most useful 
to remove the table from multiprocessing documentation and state it explicitly 
that "SUBDEBUG is lower than DEBUG and SUBWARNING is between INFO and WARNING".

--
nosy: +petri.lehtinen

___
Python tracker 

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



[issue12175] FileIO.readall() read the file position and size at each read

2011-05-25 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> BufferedReader.read() calls FileIO.read() until FileIO.read() returns
> an empty byte string. Why not calling FileIO.read() only once?

BufferedReader doesn't call FileIO.read, it calls .read().
The latter can be e.g. a socket and call recv(). If you want to read
till the end of stream, you have to repeat until recv() returns the
empty string.

--

___
Python tracker 

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



[issue12175] FileIO.readall() read the file position and size at each read

2011-05-25 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> FileIO.readall() reads the file position and size before each call to
> read(), to adjust the buffer size.
> 
> Moreover FileIO.readall() calls lseek() on Windows: it should use
> _lseeki64() instead, to handle correctly file bigger than 2 GB (or
> maybe 4 GB? I don't know).
> 
> Attached patch fixes both problems.

Looks ok to me. Did you test under Windows? Did you run some benchmarks?

--

___
Python tracker 

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



[issue12174] Multiprocessing logging levels unclear

2011-05-25 Thread JJeffries

Changes by JJeffries :


--
keywords: +patch
Added file: http://bugs.python.org/file22106/multiprocessing_logging.patch

___
Python tracker 

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



[issue12174] Multiprocessing logging levels unclear

2011-05-25 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

The patch is in an invalid format. See 
http://docs.python.org/devguide/patch.html for instructions on working with 
patches. If you cannot/won't use Mercurial, use two separate directories for 
original and modified cpython source tree, and invoke:

diff -urN cpython-orig cpython-modified

--

___
Python tracker 

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



[issue12175] FileIO.readall() read the file position and size at each read

2011-05-25 Thread STINNER Victor

STINNER Victor  added the comment:

Oh, FileIO.readall() doesn't raise a ValueError if the file is closed => patch 
attached to fix this.

--
Added file: http://bugs.python.org/file22107/fileio_readall_closed.patch

___
Python tracker 

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



[issue12175] FileIO.readall() read the file position and size at each read

2011-05-25 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

+raw = f
+if hasattr(raw, 'buffer'):
+raw = raw.buffer
+if hasattr(raw, 'raw'):
+raw = raw.raw
 f.close()
 self.assertRaises(ValueError, f.flush)
 self.assertRaises(ValueError, f.fileno)
@@ -2512,6 +2517,7 @@ class MiscIOTest(unittest.TestCase):
 self.assertRaises(ValueError, f.read)
 if hasattr(f, "read1"):
 self.assertRaises(ValueError, f.read1, 1024)
+self.assertRaises(ValueError, raw.readall)

Why not simply:

 if hasattr(f, "readall"):
 self.assertRaises(ValueError, f.readall, 1024)

--

___
Python tracker 

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



[issue12168] SysLogHandler incorrectly appends \000 to messages

2011-05-25 Thread Carl Crowder

Carl Crowder  added the comment:

Flume certainly could avoid parsing certain values. However, while a syslog 
application "should avoid octet values below 32", they are still "legal" [1]. I 
don't think that adjusting flume to reject legal values due to legacy behaviour 
in some unix syslog daemons is the Right Thing™ here.

[1] http://tools.ietf.org/html/rfc5424#section-6.4

--
title: SysLogHandler incorrectly appents \000 to messages -> SysLogHandler 
incorrectly appends \000 to messages

___
Python tracker 

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



[issue12175] FileIO.readall() read the file position and size at each read

2011-05-25 Thread STINNER Victor

STINNER Victor  added the comment:

RawIOBase.readall() fails if .read() returns None: fix attached.

--
Added file: http://bugs.python.org/file22108/rawiobase_readall.patch

___
Python tracker 

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



[issue12173] PyImport_ImportModuleLevel doesn't have 'const' on its argument

2011-05-25 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset a9126e8770e5 by Benjamin Peterson in branch 'default':
make PyImport_ImportModuleLevel's first arg const like similiar functions 
(closes #12173)
http://hg.python.org/cpython/rev/a9126e8770e5

--
nosy: +python-dev
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



[issue12175] FileIO.readall() read the file position and size at each read

2011-05-25 Thread STINNER Victor

STINNER Victor  added the comment:

bufferedreader_readall.patch: BufferedReader.read(None) calls raw.readall() if 
available.

bufferedreader_readall.patch requires fileio_readall_closed.patch and 
rawiobase_readall.patch fixes.

--
Added file: http://bugs.python.org/file22109/bufferedreader_readall.patch

___
Python tracker 

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



[issue12175] FileIO.readall() read the file position and size at each read

2011-05-25 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> bufferedreader_readall.patch: BufferedReader.read(None) calls
> raw.readall() if available.

Have you run any benchmarks?

--

___
Python tracker 

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



[issue12174] Multiprocessing logging levels unclear

2011-05-25 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Converted the patch by JJeffries to a valid format.

--
Added file: http://bugs.python.org/file22110/multiprocessing_logging_2.patch

___
Python tracker 

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



[issue12175] FileIO.readall() read the file position and size at each read

2011-05-25 Thread STINNER Victor

STINNER Victor  added the comment:

Number of syscalls without the patch -> with the patch:

- read the README file, text mode: 17 -> 12 syscalls (-5)
- read the README file, binary mode: 15 -> 11 syscalls (-4)
- read a binary file of 10 MB: 17 -> 12 syscalls (-5)

Quick benchmark open('README').read(); open('README', 'rb').read() in a loop: 
359.1 ms -> 335.4 ms (-7%). So it's not really faster.

--

___
Python tracker 

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



[issue11272] input() has trailing carriage return on windows

2011-05-25 Thread R. David Murray

R. David Murray  added the comment:

You are using the only version that has the bug (3.2.0, also called 3.2).  The 
fixed version will be released shortly (3.2.1).

--
nosy: +r.david.murray

___
Python tracker 

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



[issue12175] FileIO.readall() read the file position and size at each read

2011-05-25 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

About rawiobase_readall.patch: why do you use PyObject_Size() if you know 
chunks is a list? PyList_GET_SIZE is much more efficient.

About bufferedreader_readall.patch:

+PyBytes_Concat(&data, all);
+if (data == NULL)
+return NULL;

You must Py_DECREF(all) first.

Also, you should check that "all" is either None or a bytes object.

--

___
Python tracker 

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



[issue12168] SysLogHandler incorrectly appends \000 to messages

2011-05-25 Thread R. David Murray

R. David Murray  added the comment:

And it goes on to say:

"[...] but a syslog application MAY modify these characters upon reception.  
For example, it might change them into an escape sequence (e.g., value 0 may be 
changed to "\0")"

Flume should not break if it receives NULs.  But there should be a way to 
prevent generating them, and Vinay has agreed with that.  Now we just need a 
patch :)  (he's probably working on one...)

--

___
Python tracker 

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



[issue12168] SysLogHandler incorrectly appends \000 to messages

2011-05-25 Thread Carl Crowder

Carl Crowder  added the comment:

Oh, I understand. Flume doesn't break, it handles the \0 just fine, the problem 
is that I ended up with a message with that additional byte on the end. Sorry 
for the confusion!

--

___
Python tracker 

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



[issue12168] SysLogHandler incorrectly appends \000 to messages

2011-05-25 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

FWIW, I once stumbled on this problem, and solved it by making my own log 
handler that uses functions from the syslog module.

--
nosy: +petri.lehtinen

___
Python tracker 

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



[issue12168] SysLogHandler incorrectly appends \000 to messages

2011-05-25 Thread Vinay Sajip

Vinay Sajip  added the comment:

> Petri Lehtinen  added the  comment:

> 
> FWIW, I once stumbled on this problem, and solved it by making  my own log 
>handler that uses functions from the syslog  module.

@Petri: It's great that it worked for you, but IIRC the syslog module has had 
thread-safety issues at least on some platforms, which is why it's not used in 
the SysLogHandler implementation (disclaimer: this was a while ago, I don't 
know 
if the syslog module is thread-safe now - I believe the thread-safety issues 
were in the underlying C APIs).

I am working on a patch, watch this space :-)

--

___
Python tracker 

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



[issue12168] SysLogHandler incorrectly appends \000 to messages

2011-05-25 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Vinay Sajip wrote:
> @Petri: It's great that it worked for you, but IIRC the syslog module has had 
> thread-safety issues at least on some platforms, which is why it's not used 
> in 
> the SysLogHandler implementation (disclaimer: this was a while ago, I don't 
> know 
> if the syslog module is thread-safe now - I believe the thread-safety issues 
> were in the underlying C APIs).

Ah, I was not aware of thread safety issues. A quick search revealed
that there has been a non-standard syslog_r() function that's thread
safe, but nowadays POSIX requires syslog() to be thread safe, too.

--

___
Python tracker 

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



[issue12045] external shell command executed twice in ctypes.util._get_soname

2011-05-25 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset c540b18b00b9 by Antoine Pitrou in branch 'default':
Issue #12045: Avoid duplicate execution of command in ctypes.util._get_soname().
http://hg.python.org/cpython/rev/c540b18b00b9

--
nosy: +python-dev

___
Python tracker 

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



[issue12176] Compiling Python 2.7.1 on Ubuntu 11.04 (Natty Narwhale)

2011-05-25 Thread Pavel Bogdanovic

New submission from Pavel Bogdanovic :

Compiling of Python does end with an error.

It has to do with changes in Ubuntu: https://wiki.ubuntu.com/MultiarchSpec

I added one line after python's setup.py after line 351
 add_dir_to_list(self.compiler.library_dirs, '/usr/lib/i386-linux-gnu')

and it compiled.
It might be archeticture-dependent. Perhaps it should account
(/lib/i386-linux-gnu
   /lib/x86_64-linux-gnu
   /usr/lib/i386-linux-gnu
   /usr/lib/x86_64-linux-gnu)

--
components: Build
files: patch_setup.py
messages: 136862
nosy: Pavel.Bogdanovic
priority: normal
severity: normal
status: open
title: Compiling Python 2.7.1 on Ubuntu 11.04 (Natty Narwhale)
type: compile error
versions: Python 2.7
Added file: http://bugs.python.org/file22111/patch_setup.py

___
Python tracker 

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



[issue12098] Child process running as debug on Windows

2011-05-25 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Ok, thanks for the patches. Some further comments:
- the function generating the flags should be exported (with a private name), 
so that it can be reused by Lib/test/[test_]support.py. Duplicate code is 
error-prone, especially when enumerating command-line flags, attribute names...
- in the tests, proc_flags() could simply return tuple(sys.flags). This is 
simpler and easier to maintain.

--

___
Python tracker 

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



[issue12045] external shell command executed twice in ctypes.util._get_soname

2011-05-25 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Committed, thank you!

--
resolution:  -> fixed
stage: needs patch -> 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



[issue12176] Compiling Python 2.7.1 on Ubuntu 11.04 (Natty Narwhale)

2011-05-25 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Are you on a 64-bit Ubuntu? Could you attach or copy/paste the error message?

--
nosy: +petri.lehtinen

___
Python tracker 

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



[issue11109] socketserver.ForkingMixIn leaves zombies, also fails to reap all zombies in one pass

2011-05-25 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset e2363b1c4bca by Senthil Kumaran in branch 'default':
Fix closes issue #11109 -  socketserver.ForkingMixIn leaves zombies, also fails 
to reap all zombies in one pass.
http://hg.python.org/cpython/rev/e2363b1c4bca

New changeset 3e3cd0ed82bb by Senthil Kumaran in branch 'default':
News entry for issue11109.
http://hg.python.org/cpython/rev/3e3cd0ed82bb

--
nosy: +python-dev

___
Python tracker 

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



[issue11109] socketserver.ForkingMixIn leaves zombies, also fails to reap all zombies in one pass

2011-05-25 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

The feature is in 3.3. I did not remove the handle_timeout method from the 
Mixin class, because it might be used in the production by the existing 
servers. It is not appropriate to remove methods all of sudden without 
deprecation warnings and also it is not required to remove in this case.

Added the Documentation and News entry too.

--

___
Python tracker 

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



[issue12170] Bytes objects do not accept integers to many functions

2011-05-25 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

___
Python tracker 

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



[issue12176] Compiling Python 2.7.1 on Ubuntu 11.04 (Natty Narwhale)

2011-05-25 Thread Stefan Krah

Stefan Krah  added the comment:

This should have been fixed in issue 11715. Could you try to
build from a mercurial checkout?

--
nosy: +skrah

___
Python tracker 

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



[issue11109] socketserver.ForkingMixIn leaves zombies, also fails to reap all zombies in one pass

2011-05-25 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

This is fixed in 3.3 now. Keeping it open for test_socketserver update. After a 
ForkingServer service call, it should be asserted the collect_children routine 
is run.

--
resolution:  -> fixed
stage: patch review -> committed/rejected
versions:  -Python 2.7, Python 3.2

___
Python tracker 

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



[issue12107] TCP listening sockets created without FD_CLOEXEC flag

2011-05-25 Thread Charles-François Natali

Charles-François Natali  added the comment:

So, SOCK_CLOEXEC is available.
Note that I don't like the idea of falling back to FD_CLOEXEC since
it's not atomic, and some people might rely on this.
Can we close this issue?

--

___
Python tracker 

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



[issue12071] test_concurrent_futures.test_context_manager_shutdown() hangs on OpenIndiana

2011-05-25 Thread Charles-François Natali

Charles-François Natali  added the comment:

Since it's a OOM issue, can we close?

--

___
Python tracker 

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



[issue12107] TCP listening sockets created without FD_CLOEXEC flag

2011-05-25 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> So, SOCK_CLOEXEC is available.
> Note that I don't like the idea of falling back to FD_CLOEXEC since
> it's not atomic, and some people might rely on this.
> Can we close this issue?

Well, this is apparently a feature request for socketserver.TCPServer.
I don't see any problem in adding a best-effort option to add the cloexec flag, 
possibly atomically, and fall back on FD_CLOEXEC.

People who "rely on this" can only do it if their system supports it anyway.

--

___
Python tracker 

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



[issue12107] TCP listening sockets created without FD_CLOEXEC flag

2011-05-25 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

For the record, the best effort approach is already used in subprocess (check 
subprocess_cloexec_pipe() in Modules/_posixsubprocess.c).

Speaking of which, the os module could expose the pipe2() function.

--

___
Python tracker 

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



[issue12176] Compiling Python 2.7.1 on Ubuntu 11.04 (Natty Narwhale)

2011-05-25 Thread Pavel Bogdanovic

Pavel Bogdanovic  added the comment:

yes, the patch mentioned in issue 11715 works.
Sorry for crossposting the issue.

--

___
Python tracker 

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



[issue12168] SysLogHandler incorrectly appends \000 to messages

2011-05-25 Thread Vinay Sajip

Vinay Sajip  added the comment:

Please note: this change is too late for inclusion in Python 3.2.1 :-( as it 
has already rc status. So I will probably push this change once 3.2.1 is out.

--

___
Python tracker 

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



[issue12176] Compiling Python 2.7.1 on Ubuntu 11.04 (Natty Narwhale)

2011-05-25 Thread Stefan Krah

Stefan Krah  added the comment:

Thanks for testing. I guess we can close this one then.

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

___
Python tracker 

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



[issue12165] Does nonlocal include global?

2011-05-25 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Lukas, I'll fix-up the docs.  Thanks for pointing out the deficiency.

--
assignee:  -> rhettinger
components: +Documentation -Interpreter Core
nosy: +rhettinger
versions: +Python 3.3

___
Python tracker 

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



[issue12170] Bytes.index() and bytes.count() do not accept byte ints

2011-05-25 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

> It is certainly unusual for n to be in the sequence, but not to be able to 
> find it.

Agreed. Doc Lib: 4.6. Sequence Types — str, bytes, bytearray, list, tuple, 
range says '''
s.index(i) index of the first occurence of i in s   
s.count(i) total number of occurences of i in s '''
so everything *in* a bytes should be valid for .index and .count.

>>> test = b'0120'
>>> z = b'0'
>>> zo = ord(z)
>>> z in test
True
>>> zo in test
True
>>> test.index(z)
0
>>> test.index(zo)
...
TypeError: expected an object with the buffer interface
>>> test.count(z)
2
>>> test.count(zo)
...
TypeError: expected an object with the buffer interface
# longer subsequences like b'01' also work

So I think the code for 3.2+ bytes.count() and bytes.index() should do the same 
branching as the code for bytes.__contains__.

The other functions you list, including .rindex are not general sequence 
functions but are string functions defined as taking subsequences as inputs. So 
they would never be used in generic code like .count and .index can be.

--
nosy: +terry.reedy
stage:  -> test needed
title: Bytes objects do not accept integers to many functions -> Bytes.index() 
and bytes.count() do not accept byte ints
type:  -> behavior
versions: +Python 3.3

___
Python tracker 

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



[issue12170] Bytes.index() and bytes.count() should accept byte ints

2011-05-25 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
title: Bytes.index() and bytes.count() do not accept byte ints -> Bytes.index() 
and bytes.count() should accept byte ints

___
Python tracker 

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



[issue12170] Bytes.index() and bytes.count() should accept byte ints

2011-05-25 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue12107] TCP listening sockets created without FD_CLOEXEC flag

2011-05-25 Thread Charles-François Natali

Charles-François Natali  added the comment:

> Well, this is apparently a feature request for socketserver.TCPServer.

Honestly, I'm not sure what this request is about.
The original request seemed to imply this should be made the default. I don't 
agree, and think this should be made optional. Also, the title is much more 
general: "TCP listening sockets created without FD_CLOEXEC flag".

> I don't see any problem in adding a best-effort option to add the cloexec 
> flag, possibly atomically, and fall back on FD_CLOEXEC.
> People who "rely on this" can only do it if their system supports it anyway.

I wasn't clear. I thought we were talking about the socket constructor. In that 
case, yes, we could do that for socketserver, but with an explicit warning 
(because with a cloexec flag to a constructor, people will unconsciously expect 
it to behave like SOCK_CLOEXEC and be atomic).

> Speaking of which, the os module could expose the pipe2() function.

I'll work on a patch.

--

___
Python tracker 

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



[issue12177] re.match raises MemoryError

2011-05-25 Thread EungJun Yi

New submission from EungJun Yi :

re.match raises MemoryError when trying to match r'()+?1' to 'a1', as shown 
below.

~$ python
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24) 
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import re
>>> re.match(r'()+?1', 'a1')
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.7/re.py", line 137, in match
return _compile(pattern, flags).match(string)
MemoryError
>>>

~$ python3
Python 3.2 (r32:88445, Mar 25 2011, 19:28:28) 
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import re
>>> re.match(r'()+?1', 'a1')
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.2/re.py", line 153, in match
return _compile(pattern, flags).match(string)
MemoryError
>>>

--
components: Regular Expressions
messages: 136880
nosy: EungJun.Yi
priority: normal
severity: normal
status: open
title: re.match raises MemoryError
type: resource usage
versions: Python 2.7, Python 3.2

___
Python tracker 

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



[issue12178] csv writer doesn't escape escapechar

2011-05-25 Thread Eric Breck

New submission from Eric Breck :

Consider the attached two files.  A reader and writer with the same dialect 
parameters (escapechar \ quotechar " doublequote False) read, then write a CSV 
cell that looks like "C\\".  It's written "C\".  The problem is, when 
doublequote=False, the escapechar isn't used to escape itself, and the writer 
writes something that in the same dialect would be understood differently (\" 
isn't \ then end of string, it's an escaped quotechar within the string).

Execute python err.py first.csv to see.

--
components: None
files: pybug.zip
messages: 136881
nosy: ebreck
priority: normal
severity: normal
status: open
title: csv writer doesn't escape escapechar
type: behavior
versions: Python 2.6, Python 2.7
Added file: http://bugs.python.org/file22112/pybug.zip

___
Python tracker 

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



[issue12165] Does nonlocal include global?

2011-05-25 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Another problem with the current text is that it fails to exclude enclosing 
class scopes, and I had to test to be sure they were., and some of the phrasing 
strikes me as awkward. Here is a possible rewrite.

"When the definition of a function is nested (enclosed) within the definitions 
of other functions, its nonlocal scopes are the local scopes of the enclosing 
functions. The nonlocal statement causes the listed identifiers to refer to 
names previously bound in nonlocal scopes. If a name is bound in more than one 
nonlocal scope, the nearest binding is used. If a name is not bound in any 
nonlocal scope, or if there is no nonlocal scope, a SyntaxError is raised.

Except for the requirement that the listed indentifiers be previously bound, 
the nonlocal statement is similar to the global statement. It applies to the 
entire function body, so it cannot follow any local bindings of the same names."

My main change is to first unambiguously define nonlocal scopes and continue 
from there.

--
keywords: +patch
nosy: +terry.reedy

___
Python tracker 

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



[issue12165] Nonlocal does not include global; clarify doc

2011-05-25 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
title: Does nonlocal include global? -> Nonlocal does not include global; 
clarify doc

___
Python tracker 

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



[issue12170] Bytes.index() and bytes.count() should accept byte ints

2011-05-25 Thread Max

Max  added the comment:

Fair enough.

I think it would make sense for the string methods to also accept single ints 
where possible as well:

For haystack and needles both strings:
[haystack.find(n) for n in needles]

For both bytes, it's a bit contortionist:
[haystack.find(needles[i:i+1]) for i in range(len(needles))]

One ends up doing a lot of the [i:i+1] bending when using bytes functions.

--
type: behavior -> 
versions:  -Python 3.3

___
Python tracker 

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



[issue12170] Bytes.index() and bytes.count() should accept byte ints

2011-05-25 Thread Max

Changes by Max :


--
type:  -> behavior
versions: +Python 3.3

___
Python tracker 

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



[issue12172] IDLE crashes when I use F5 to run

2011-05-25 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Did I read right?
Clicking F5 crashes while clicking Run and then 'Run Module F5' works?
(They ought to be the same thing.)
If so, check the key bindings. Options/Configure IDLE .../Keys.
There should be an entry 'Run Module - '.
Is F5 bound to anything else?

--
nosy: +terry.reedy

___
Python tracker 

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



[issue3754] cross-compilation support for python build

2011-05-25 Thread wrobell

wrobell  added the comment:

Would it be possible to get list of steps required to test this patch?

1. hg clone
2. copy config.sub and config.guess?
3. autoreconf
4. configure...
5. make

What else?

--

___
Python tracker 

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



[issue12006] strptime should implement %V or %u directive from libc

2011-05-25 Thread Ashley Anderson

Ashley Anderson  added the comment:

OK, here is my second attempt. I think it functions as desired, but a code 
review may reveal flaws in my implementation. I'm sure there are associated 
tests and documentation to write, but I have basically no experience with that 
yet. If this looks like the right direction, I can take it to the 
python-mentors list for help with the test/docs.

--
Added file: http://bugs.python.org/file22113/12006_2.patch

___
Python tracker 

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



[issue12006] strptime should implement %V or %u directive from libc

2011-05-25 Thread Ashley Anderson

Changes by Ashley Anderson :


Removed file: http://bugs.python.org/file22101/12006.patch

___
Python tracker 

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



[issue3754] cross-compilation support for python build

2011-05-25 Thread Roumen Petrov

Roumen Petrov  added the comment:

Usually this is not a question for bug-tracking system . configure .. 
--host= will enter into cross-compilation mode. You could find more 
details into respective manual.

Roumen

--

___
Python tracker 

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



[issue12179] Race condition using PyGILState_Ensure on a new thread

2011-05-25 Thread Sye van der Veen

New submission from Sye van der Veen :

I'm wanting to call PyThreadState_SetAsyncExc from a function registered with 
SetConsoleCtrlHandler.  To do so, I need to call PyGILState_Ensure, which 
asserts that Python is initialized, so I need to check for that.  However, I 
noticed a race condition with the code:

  if( Py_IsInitialized( ) ) {
// XXX What if another thread calls Py_Finalize here?
gstate = PyGILState_Ensure( );
PyThreadState_SetAsyncExc( MainThreadId, PyExc_SystemExit );
PyGILState_Release( gstate );
  }

What I need is to be able to hold the GIL around the entire block of code, 
potentially before Py_Initialize is called for the first time.  Now, 3.2 
deprecated PyEval_AcquireLock, and PyEval_InitThreads can no longer be called 
before Py_Initialize.  Thankfully, I'm on 2.6.4, so I was able to write this 
code:

  PyEval_AcquireLock( );
  if( Py_IsInitialized( ) ) {
gstate = PyGILState_Ensure( );
PyThreadState_SetAsyncExc( MainThreadId, PyExc_SystemExit );
PyGILState_Release( gstate );
  }
  PyEval_ReleaseLock( );

The problem in 2.6.4 is that PyGILState_Ensure deadlocks because the GIL is 
already held, so that doesn't solve my problem.  (Incidentally, the 
PyGILState_Ensure docs say it works "regardless of the current state of the 
GIL", which is incorrect.)

The 3.2 docs say to use PyEval_AcquireThread or PyEval_RestoreThread, which 
both require an existing PyThreadState.  To get that, I would need to call 
PyThreadState_New, which needs a PyInterpreterState.  To get _that_ I could use 
PyInterpreterState_Head, since I know I only use one interpreter.  Now I'm 
getting into "advanced debugger" territory, but it's no use anyway; it's 
possible that Py_Finalize could sneak in between the time I get this 
interpreter and when I acquire the GIL, causing me to access a free'd 
interpreter.

I believe the best fix for this would be to have a version of PyGILState_Ensure 
that works even when Python is not initialized.  It would not be able to create 
a thread, and thus I would not expect to be able to call any Python API, but it 
would always ensure the GIL is acquired.  This _may_ have to be a new 
"PyGILState_EnsureEx" function, because existing code expects PyGILState_Ensure 
to always allow them to call the Python API.  The resulting code would be:

  gstate = PyGILState_EnsureEx( );
  if( Py_IsInitialized( ) ) {
PyThreadState_SetAsyncExc( MainThreadId, PyExc_SystemExit );
  }
  PyGILState_Release( gstate );

This would require that Py_Initialize itself acquires the GIL.

The above problem was found on 2.6.4, but I've consulted the 3.2 docs and 3.3 
code (via the online source) and it looks like the situation would be exactly 
the same.  In the meantime, I'm going to stick with the first piece of code and 
hope nobody hits CTRL-BREAK during program clean-up.

--
components: Interpreter Core
messages: 136888
nosy: syeberman
priority: normal
severity: normal
status: open
title: Race condition using PyGILState_Ensure on a new thread
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3

___
Python tracker 

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



[issue12179] Race condition using PyGILState_Ensure on a new thread

2011-05-25 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +charles-francois.natali, haypo, pitrou

___
Python tracker 

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



[issue1625] bz2.BZ2File doesn't support multiple streams

2011-05-25 Thread Nir Aides

Nir Aides  added the comment:

Right! I updated the patch and added a test for the aligned stream/buffer case.

--
Added file: http://bugs.python.org/file22114/cpython-bz2-streams.patch

___
Python tracker 

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



[issue1625] bz2.BZ2File doesn't support multiple streams

2011-05-25 Thread Nir Aides

Changes by Nir Aides :


Removed file: http://bugs.python.org/file22087/cpython-bz2-streams.patch

___
Python tracker 

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



[issue12180] test_packaging: failures --without-threads

2011-05-25 Thread Stefan Krah

New submission from Stefan Krah :

There are still a couple of issues on the Fedora buildbot. Most of
them are caused by the absence of threading.

--
components: Tests
keywords: buildbot
messages: 136890
nosy: skrah, tarek
priority: normal
severity: normal
status: open
title: test_packaging: failures --without-threads
type: behavior
versions: Python 3.3

___
Python tracker 

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



[issue12175] FileIO.readall() read the file position and size at each read

2011-05-25 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 742ff94cdd20 by Victor Stinner in branch '3.1':
Issue #12175: FileIO.readall() now raises a ValueError instead of an IOError if
http://hg.python.org/cpython/rev/742ff94cdd20

New changeset 745e373c0b8e by Victor Stinner in branch '3.2':
(Merge 3.1) Issue #12175: FileIO.readall() now raises a ValueError instead of
http://hg.python.org/cpython/rev/745e373c0b8e

New changeset 9051275a68fe by Victor Stinner in branch 'default':
(Merge 3.2) Issue #12175: FileIO.readall() now raises a ValueError instead of
http://hg.python.org/cpython/rev/9051275a68fe

--
nosy: +python-dev

___
Python tracker 

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



[issue12175] FileIO.readall() read the file position and size at each read

2011-05-25 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset f2414bb35c96 by Victor Stinner in branch '2.7':
Issue #12175: FileIO.readall() now raises a ValueError instead of an IOError if
http://hg.python.org/cpython/rev/f2414bb35c96

--

___
Python tracker 

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



[issue12181] SIGBUS error on OpenBSD (sparc64)

2011-05-25 Thread rpointel

New submission from rpointel :

Hello,

on OpenBSD (arch: sparc64), when I run the regress tests, I have a SIGBUS error 
during the test_kqueue.py:

(gdb) run /tmp/test_kqueue.py
Starting program: /usr/local/bin/python2.7 /tmp/test_kqueue.py
testPair (__main__.TestKQueue) ...
Program received signal SIGBUS, Bus error.
PyMember_GetOne (addr=0x21007b72c "", l=0x211d2e9c8) at 
Python/structmember.c:128
128 v = PyLong_FromLongLong(*(PY_LONG_LONG *)addr);

I compiled Python 2.7.1 with debug symbols to help you, attached file is the 
gdb output (backtrace).

Don't hesitate to ask me if you need information.

Thanks.

--
components: Tests
files: python2.7.1_sigbus_sparc64
messages: 136893
nosy: rpointel
priority: normal
severity: normal
status: open
title: SIGBUS error on OpenBSD (sparc64)
type: crash
versions: Python 2.7
Added file: http://bugs.python.org/file22115/python2.7.1_sigbus_sparc64

___
Python tracker 

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



[issue11109] socketserver.ForkingMixIn leaves zombies, also fails to reap all zombies in one pass

2011-05-25 Thread STINNER Victor

STINNER Victor  added the comment:

> New changeset 3e3cd0ed82bb by Senthil Kumaran in branch 'default':
> News entry for issue11109.
> http://hg.python.org/cpython/rev/3e3cd0ed82bb

Please try to format NEWS entries using "Issue #xxx: xxx" instead of "Issue 
#xxx - xxx".

--
nosy: +haypo

___
Python tracker 

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



[issue12180] test_packaging: failures --without-threads

2011-05-25 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue12161] StringIO AttributeError instead of ValueError after close..

2011-05-25 Thread Catalin Iacob

Catalin Iacob  added the comment:

Attached patch + test case.

Also tested cStringIO in 2.7 and io.StringIO in 3.2 and 3.3 tip and they aren't 
affected.

--
keywords: +patch
nosy: +catalin.iacob
Added file: http://bugs.python.org/file22116/12161.patch

___
Python tracker 

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



[issue12006] strptime should implement %V or %u directive from libc

2011-05-25 Thread R. David Murray

R. David Murray  added the comment:

I'm not familiar with this module, so at the moment I just gave the patch a 
quick scan.  The approach looks OK to me.  Hopefully Alexander can review it.  
In the meantime I think you should go ahead and work on tests and doc.  It is 
easier to do a detailed review when tests are included.

--

___
Python tracker 

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



[issue12175] FileIO.readall() read the file position and size at each read

2011-05-25 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 4a7118cff1d3 by Victor Stinner in branch '3.1':
Issue #12175: RawIOBase.readall() now returns None if read() returns None.
http://hg.python.org/cpython/rev/4a7118cff1d3

New changeset fb29dc650d24 by Victor Stinner in branch '3.2':
(Merge 3.1) Issue #12175: RawIOBase.readall() now returns None if read()
http://hg.python.org/cpython/rev/fb29dc650d24

New changeset 325453be64ec by Victor Stinner in branch 'default':
(Merge 3.2) Issue #12175: RawIOBase.readall() now returns None if read()
http://hg.python.org/cpython/rev/325453be64ec

New changeset 43a498da8680 by Victor Stinner in branch '2.7':
Issue #12175: RawIOBase.readall() now returns None if read() returns None.
http://hg.python.org/cpython/rev/43a498da8680

--

___
Python tracker 

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



[issue12181] SIGBUS error on OpenBSD (sparc64)

2011-05-25 Thread Charles-François Natali

Charles-François Natali  added the comment:

It's an unaligned access:

addr=0x21007b72c

  case T_LONGLONG:
  v = PyLong_FromLongLong(*(PY_LONG_LONG *)addr);

sizeof(PY_LONG_LONG) == 8, but addr % 8 = 0x21007b72c % 8 == 4

--
nosy: +charles-francois.natali

___
Python tracker 

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



[issue12181] SIGBUS error on OpenBSD (sparc64)

2011-05-25 Thread Charles-François Natali

Changes by Charles-François Natali :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue12006] strptime should implement %V or %u directive from libc

2011-05-25 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

I'll try to give this a more  thorough review by the end of the week.  For now, 
just a nit-pick, but _calc_julian_from_V jumped at me as a really odd name.  
Either "iso_to_julian" or "julian_from_iso" would be much clearer.  The patch 
also needs tests and documentation.

--
assignee:  -> belopolsky
stage: needs patch -> patch review

___
Python tracker 

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



[issue12180] test_packaging: failures --without-threads

2011-05-25 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

looking

--

___
Python tracker 

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



[issue12180] test_packaging: failures --without-threads

2011-05-25 Thread Tarek Ziadé

Changes by Tarek Ziadé :


--
assignee:  -> tarek

___
Python tracker 

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



[issue12181] SIGBUS error on OpenBSD (sparc64)

2011-05-25 Thread STINNER Victor

STINNER Victor  added the comment:

> Don't hesitate to ask me if you need information.

It looks like the crash occurs on r[0].data in testPair() of test_kqueue. Can 
you confirm this? Comment the line in test_kqueue.py to check if it works 
around the crash.

What is the size of intptr_t and "long long" types on your host? You can find 
this information in config.log if you compiled Python manually. Otherwise, use 
a dummy C script like:
--
int main() { return sizeof(long long); }
--
and
--
#include 
int main() { return sizeof(intptr_t); }
--
Compile the script, run it, and read the exitcode (e.g.g echo $? using bash).

Can you try to get the definition of the kevent structure? It should be in 
/usr/include/sys/event.h. And/or the offset of each field using the following C 
script (not tested):
-
#include 
#include 
#include  /* For offsetof */

#ifndef offsetof
#define offsetof(type, member) ( (int) & ((type*)0) -> member )
#endif

struct kevent ev;

#define DUMP(field) printf("offset of " #field ": %u\n", offsetof(ev, field))

int main()
{
   DUMP(ident);
   DUMP(filter);
   DUMP(flags);
   DUMP(fflags);
   DUMP(data);
   DUMP(udata);
   return 0;
}
-

--
nosy: +haypo

___
Python tracker 

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



[issue12175] FileIO.readall() read the file position and size at each read

2011-05-25 Thread STINNER Victor

STINNER Victor  added the comment:

> Attached patch [fileio_readall.patch] fixes both problems.

> Looks ok to me. Did you test under Windows?

Yes, test_io pass on Windows Vista 64 bits.

> Did you run some benchmarks?

Yes, see msg136853. Do you mean that I should not touch FileIO.readall() if it 
doesn't make it faster? (only 7% faster)

--

___
Python tracker 

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



[issue12175] FileIO.readall() read the file position and size at each read

2011-05-25 Thread STINNER Victor

STINNER Victor  added the comment:

> You must Py_DECREF(all) first.
> Also, you should check that "all" is either None or a bytes object.

Right, fixed in bufferedreader_readall-2.patch. By the way, thanks for your 
reviews.

So, do you think that fileio_readall.patch and bufferedreader_readall-2.patch 
should be commited, or these changes are useless?

--
Added file: http://bugs.python.org/file22117/bufferedreader_readall-2.patch

___
Python tracker 

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



[issue12175] FileIO.readall() read the file position and size at each read

2011-05-25 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file22117/bufferedreader_readall-2.patch

___
Python tracker 

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



[issue12175] FileIO.readall() read the file position and size at each read

2011-05-25 Thread STINNER Victor

Changes by STINNER Victor :


Added file: http://bugs.python.org/file22118/bufferedreader_readall-2.patch

___
Python tracker 

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



[issue12175] FileIO.readall() read the file position and size at each read

2011-05-25 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file22109/bufferedreader_readall.patch

___
Python tracker 

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



[issue12175] FileIO.readall() read the file position and size at each read

2011-05-25 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file22107/fileio_readall_closed.patch

___
Python tracker 

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



[issue12181] SIGBUS error on OpenBSD (sparc64)

2011-05-25 Thread rpointel

rpointel  added the comment:

> It looks like the crash occurs on r[0].data in testPair() of test_kqueue. Can 
> you confirm this? Comment the line in test_kqueue.py to check if it works 
> around the crash.

Yes, it does not crash if I comment this line.

> What is the size of intptr_t and "long long" types on your host?

size of intptr_t and "long long" is : 8.

> Can you try to get the definition of the kevent structure? It should be in 
> /usr/include/sys/event.h. And/or the offset of each field using the following 
> C script (not tested).

I have replaced this line of your program (because it failed to build):
#define DUMP(field) printf("offset of " #field ": %u\n", offsetof(ev, field))
by
#define DUMP(field) printf("offset of " #field ": %u\n", offsetof(struct 
kevent, field))

and I have:


   
offset of ident: 0
offset of filter: 4
offset of flags: 6
offset of fflags: 8
offset of data: 12
offset of udata: 16

Thanks a lot for your help,

Remi.

--

___
Python tracker 

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



[issue12175] FileIO.readall() read the file position and size at each read

2011-05-25 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file22108/rawiobase_readall.patch

___
Python tracker 

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



[issue12180] test_packaging: failures --without-threads

2011-05-25 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 8aa1ae77cfe1 by Tarek Ziade in branch 'default':
Issue #12180: Fixed a few remaining errors in test_packaging when no threading.
http://hg.python.org/cpython/rev/8aa1ae77cfe1

--
nosy: +python-dev

___
Python tracker 

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



[issue12177] re.match raises MemoryError

2011-05-25 Thread Stefan Krah

Stefan Krah  added the comment:

Confirmed. The test case quickly uses 8GB of memory.

--
nosy: +ezio.melotti, pitrou, skrah
stage:  -> needs patch
versions: +Python 3.1, Python 3.3

___
Python tracker 

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



[issue12071] test_concurrent_futures.test_context_manager_shutdown() hangs on OpenIndiana

2011-05-25 Thread STINNER Victor

STINNER Victor  added the comment:

> Since it's a OOM issue, can we close?

Yes, I don't want to investigate, and I already changed the size of my swap 
partition, so I cannot reproduce the bug anymore.

--
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue12171] Reset method of the incremental encoders of CJK codecs calls the decoder reset function

2011-05-25 Thread STINNER Victor

STINNER Victor  added the comment:

Le mercredi 25 mai 2011 à 08:23 +, Marc-Andre Lemburg a écrit :
> > Do we need an additional method? It seems that this reset() could
> > also be written encoder.encode('', final=True)
> 
> +1
> 
> I think that's a much more natural way to implement "finalize the
> encoding output without adding any data to it".

And so, reset() should discard the output? I can easily adapt my patch
to discard the output (but still call encreset() instead of decreset()).

--

___
Python tracker 

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



[issue12175] FileIO.readall() read the file position and size at each read

2011-05-25 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> So, do you think that fileio_readall.patch and
> bufferedreader_readall-2.patch should be commited, or these changes
> are useless?

They should be committed.
Thank you :)

--

___
Python tracker 

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



[issue12100] Incremental encoders of CJK codecs reset the codec at each call to encode()

2011-05-25 Thread STINNER Victor

STINNER Victor  added the comment:

The initial problem (reset() at each call to .encode()) is fixed in Python 2.7, 
3.1, 3.2 and 3.3.

I opened a new issue, #12171, for the second problem noticed by Armin (decreset 
vs encreset).

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



  1   2   >