[issue19256] Optimize marshal format and add version token.

2015-01-29 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Largest modules in the stdlib have up to 800 references. So it would be worth 
to have 4 opcodes for short (10-bit) ref indices.

--

___
Python tracker 

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




[issue23338] PyErr_Format in ctypes uses invalid parameter

2015-01-29 Thread Makoto Kato

Changes by Makoto Kato :


Removed file: http://bugs.python.org/file37890/py.patch

___
Python tracker 

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



[issue23338] PyErr_Format in ctypes uses invalid parameter

2015-01-29 Thread Makoto Kato

Makoto Kato added the comment:

updated for python 2.7

--
versions: +Python 3.6 -Python 2.7
Added file: http://bugs.python.org/file37918/py27.patch

___
Python tracker 

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



[issue23338] PyErr_Format in ctypes uses invalid parameter

2015-01-29 Thread Makoto Kato

Changes by Makoto Kato :


--
hgrepos:  -295

___
Python tracker 

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



[issue23338] PyErr_Format in ctypes uses invalid parameter

2015-01-29 Thread Makoto Kato

Makoto Kato added the comment:

updated.  for master

--
hgrepos: +296
Added file: http://bugs.python.org/file37917/py.patch

___
Python tracker 

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



[issue23338] PyErr_Format in ctypes uses invalid parameter

2015-01-29 Thread Makoto Kato

Changes by Makoto Kato :


Removed file: http://bugs.python.org/file37901/py.patch

___
Python tracker 

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



[issue5811] io.BufferedReader.peek(): Documentation differs from Implementation

2015-01-29 Thread Martin Panter

Martin Panter added the comment:

The non-blocking behaviour that I documented in my patch is under question in 
Issue 13322. I think it would be nice change the implementation to either 
return None or raise BlockingIOError.

--

___
Python tracker 

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



[issue13322] buffered read() and write() does not raise BlockingIOError

2015-01-29 Thread Martin Panter

Martin Panter added the comment:

My experiments with buffered and unbuffered readers wrapping a non-blocking TCP 
socket, with no data received:

Method Buffered impl.  Buffered doc.SocketIO impl.  RawIOBase doc.
=  ==  ===  ==  ==
read   NoneBlockingIOError  NoneNone
read1  b"" [unclear]
readinto   NoneBlockingIOError  NoneNone
readinto1  NoneBlockingIOError
readall None[unclear]
peek   b"" [unclear]
readline   b"" [unspecified]OSError [unspecified]
readlines  []  [unspecified]OSError [unspecified]
__next__   StopIteration   [unspecified]OSError [unspecified]

The non-blocking behaviour of BufferedReader matches the RawIOBase 
documentation better than its own documentation. I’m not sure which way it 
should be fixed. Is this a documentation bug or an implementation bug?

I propose to change the read1() and peek() methods to behave like the others 
(whether than be returning None or raising BlockingIOError). It would be nice 
to have a way to differentiate non-blocking data being unavailable from hard 
EOF, at least for non-interactive mode, and the added consistency would be nice.

A non-blocking BufferedReader use case: to be able to peek one byte of a HTTP 
response stream to see if the connection has been closed. Plain sockets support 
MSG_PEEK, but SSL sockets don’t, and a BufferedReader is already being used. 
Later when actually parsing the response, the reader is set to blocking mode.

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python

___
Python tracker 

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



[issue23349] PyBuffer_ToContiguous() off-by-one error for non-contiguous buffers

2015-01-29 Thread Richard Hansen

Changes by Richard Hansen :


--
title: memoryview.to_bytes() and PyBuffer_ToContiguous() off-by-one error for 
non-contiguous buffers -> PyBuffer_ToContiguous() off-by-one error for 
non-contiguous buffers

___
Python tracker 

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



[issue23352] PyBuffer_IsContiguous() sometimes returns wrong result if suboffsets != NULL

2015-01-29 Thread Richard Hansen

Changes by Richard Hansen :


--
versions:  -Python 3.2, Python 3.3

___
Python tracker 

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



[issue23352] PyBuffer_IsContiguous() sometimes returns wrong result if suboffsets != NULL

2015-01-29 Thread Richard Hansen

Changes by Richard Hansen :


--
versions: +Python 3.2, Python 3.3

___
Python tracker 

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



[issue23350] Content-length is incorrect when request body is a list or tuple

2015-01-29 Thread Martin Panter

Martin Panter added the comment:

[Edit Error: 'utf8' codec can't decode byte 0xe2 in position 207: invalid 
continuation byte]

The documentation currently says “Content-Length header should be explicitly 
provided when the body is an iterable”. See Lib/urllib/request.py:1133 for how 
it is done for urlopen(), using memoryview(), which is probabaly more correct.

--

___
Python tracker 

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



[issue23352] PyBuffer_IsContiguous() sometimes returns wrong result if suboffsets != NULL

2015-01-29 Thread Richard Hansen

Richard Hansen added the comment:

I've attached a new version of the patch.  Suggestions for simplifying the test 
code would be appreciated.

--
Added file: http://bugs.python.org/file37916/PyBuffer_IsContiguous_v2.patch

___
Python tracker 

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



[issue23350] Content-length is incorrect when request body is a list or tuple

2015-01-29 Thread Martin Panter

Changes by Martin Panter :


--
nosy: +vadmium

___
Python tracker 

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



[issue23350] Content-length is incorrect when request body is a list or tuple

2015-01-29 Thread Demian Brecht

Demian Brecht added the comment:

Updated patch based on review.

--
Added file: http://bugs.python.org/file37915/list_content_length_1.patch

___
Python tracker 

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



[issue2292] Missing *-unpacking generalizations

2015-01-29 Thread Guido van Rossum

Guido van Rossum added the comment:

Hi Neil,

I think disallowing them is the best approach. There doesn't seem to be a
good use case that would be thwarted. Hopefully the syntactic prohibition
isn't too hard to implement.

On Thu, Jan 29, 2015 at 4:32 PM, Neil Girdhar 
wrote:

>
> Neil Girdhar added the comment:
>
> All tests pass.
>
> @Guido: can we get some clarification on f(*… and f(**…?  One option is to
> make them illegal for now and then open them up in a future PEP when it's
> more clear what's wanted?
>
> --
> Added file: http://bugs.python.org/file37911/starunpack25.diff
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue23352] PyBuffer_IsContiguous() sometimes returns wrong result if suboffsets != NULL

2015-01-29 Thread Richard Hansen

Richard Hansen added the comment:

> The patch has an obvious syntax error :-)

Doh!

> Other than that, adding a comment would be nice.

Agreed, will do.

> Bonus points if you can write a test (3.x has infrastructure for that, see 
> Lib/test/test_buffer.py).

I'll take a look.  Thanks!

--

___
Python tracker 

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



[issue23352] PyBuffer_IsContiguous() sometimes returns wrong result if suboffsets != NULL

2015-01-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

The patch has an obvious syntax error :-)
Other than that, adding a comment would be nice. Bonus points if you can write 
a test (3.x has infrastructure for that, see Lib/test/test_buffer.py).

--
nosy: +pitrou, skrah
stage:  -> patch review
versions:  -Python 3.2, Python 3.3, Python 3.6

___
Python tracker 

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



[issue23351] socket.settimeout(5.0) does not have any effect

2015-01-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

The way socket timeouts are implemented is by using select() to determine 
whether the socket is ready for read/write. In this case, select() probably 
marks the socket ready even though the queue is full, which later raises EAGAIN.

About SO_SNDTIMEO and SO_RCVTIMEO, POSIX says "it is implementation-defined 
whether the SO_SNDTIMEO option can be set". Also, they would not necessarily 
apply to other operations such as accept().

--
nosy: +neologix, pitrou
versions:  -Python 3.2, Python 3.3, Python 3.6

___
Python tracker 

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



[issue23352] PyBuffer_IsContiguous() sometimes returns wrong result if suboffsets != NULL

2015-01-29 Thread Richard Hansen

Changes by Richard Hansen :


--
type:  -> behavior

___
Python tracker 

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



[issue23352] PyBuffer_IsContiguous() sometimes returns wrong result if suboffsets != NULL

2015-01-29 Thread Richard Hansen

New submission from Richard Hansen:

According to 
https://docs.python.org/2/c-api/buffer.html#the-new-style-py-buffer-struct if 
the suboffsets member of Py_buffer is non-NULL and all members of the array are 
negative, the buffer may be contiguous.

PyBuffer_IsContiguous() does not behave this way.  It assumes that if the 
suboffsets member is non-NULL then at least one member of the array is 
non-negative, and thus assumes that the buffer is non-contiguous.  This is not 
always correct.

One consequence of this bug is PyBuffer_ToContiguous() (and thus 
memoryview.tobytes()) falls back to slow (and currently buggy, see issue 
#23349) memory copying code.

Attached is a patch that fixes this bug.  The patch is against 2.7 but can be 
trivially modified to apply to 3.x.

--
components: Interpreter Core
files: PyBuffer_IsContiguous.patch
keywords: patch
messages: 235014
nosy: rhansen
priority: normal
severity: normal
status: open
title: PyBuffer_IsContiguous() sometimes returns wrong result if suboffsets != 
NULL
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file37914/PyBuffer_IsContiguous.patch

___
Python tracker 

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



[issue23351] socket.settimeout(5.0) does not have any effect

2015-01-29 Thread Piotr Jurkiewicz

New submission from Piotr Jurkiewicz:

After setting socket.settimeout(5.0), socket.send() returns immediately, 
instead of returning after specified timeout.

Steps to reproduce:

Open two python interpreters.

In the first one (the receiver) execute:

>>> import socket
>>> r = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
>>> r.bind("test.sock")

In the second one (the sender) execute:

>>> import socket
>>> s = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)

Then run the following command 11 times:

>>> s.sendto("msg", "test.sock")

On the 12 run command will block. This happens because datagram sockets queue 
on Linux is 11 messages long. Interrupt the command.

So far so good.

Then set sender socket timeout:

>>> s.settimeout(5.0)

Expected behavior:

s.sendto() should block for a 5 seconds and THEN raise error 11 
(EAGAIN/EWOULDBLOCK).

Actual behavior:

s.sendto() raises the error IMMEDIATELY.

>>> s.sendto("msg", "test.sock")
Traceback (most recent call last):
  File "", line 1, in 
socket.error: [Errno 11] Resource temporarily unavailable

So, in fact, s.settimeout(5.0) does not have any effect.

I think that problem is that settimeout() sets the socket to the non-blocking 
mode (docs say: "Timeout mode internally sets the socket in non-blocking 
mode.").

As described [here](http://stackoverflow.com/q/13556972/2178047) setting 
timeout on non-blocking sockets is impossible.

In fact, when I set timeout manually with setsockopt(), everything works as 
expected:

>>> s.setblocking(1)  #go back to blocking mode
>>> tv = struct.pack("ll", 5, 0)
>>> s.setsockopt(socket.SOL_SOCKET, socket.SO_SNDTIMEO, tv)

Now s.sendto() raises the error after 5 seconds, as expected.

--
components: IO, Library (Lib)
messages: 235013
nosy: piotrjurkiewicz
priority: normal
severity: normal
status: open
title: socket.settimeout(5.0) does not have any effect
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue23350] Content-length is incorrect when request body is a list or tuple

2015-01-29 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +orsenthil

___
Python tracker 

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



[issue23350] Content-length is incorrect when request body is a list or tuple

2015-01-29 Thread Demian Brecht

Changes by Demian Brecht :


--
components: +Library (Lib)
type:  -> behavior
versions: +Python 3.5

___
Python tracker 

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



[issue23350] Content-length is incorrect when request body is a list or tuple

2015-01-29 Thread Demian Brecht

New submission from Demian Brecht:

Rather than summing the value of each element of a list or tuple to use as the 
value of the content-length header, the length of the list or tuple is used.

--
files: list_content_length.patch
keywords: patch
messages: 235012
nosy: demian.brecht
priority: normal
severity: normal
status: open
title: Content-length is incorrect when request body is a list or tuple
Added file: http://bugs.python.org/file37913/list_content_length.patch

___
Python tracker 

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



[issue23349] memoryview.to_bytes() and PyBuffer_ToContiguous() off-by-one error for non-contiguous buffers

2015-01-29 Thread Richard Hansen

New submission from Richard Hansen:

PyBuffer_ToContiguous() has an off-by-one error when copying a buffer it thinks 
is non-contiguous.

To reproduce, put the following in foo.pyx and compile with Cython v0.21.2:

cpdef foo():
cdef unsigned char[:] v = bytearray("testing")
print repr(memoryview(v).tobytes())

>>> import foo
>>> foo.foo()
'estingt'

(This issue was fixed for Python 3.x in issue #12834 but it was not fixed for 
Python 2.7.)

--
components: Interpreter Core
files: PyBuffer_ToContiguous.patch
keywords: patch
messages: 235011
nosy: rhansen
priority: normal
severity: normal
status: open
title: memoryview.to_bytes() and PyBuffer_ToContiguous() off-by-one error for 
non-contiguous buffers
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file37912/PyBuffer_ToContiguous.patch

___
Python tracker 

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



[issue23285] PEP 475 - EINTR handling

2015-01-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Victor, do you think there's anything left to do?

--

___
Python tracker 

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



[issue23285] PEP 475 - EINTR handling

2015-01-29 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
stage:  -> patch review
versions: +Python 3.5

___
Python tracker 

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



[issue2292] Missing *-unpacking generalizations

2015-01-29 Thread Neil Girdhar

Neil Girdhar added the comment:

All tests pass.

@Guido: can we get some clarification on f(*… and f(**…?  One option is to make 
them illegal for now and then open them up in a future PEP when it's more clear 
what's wanted?

--
Added file: http://bugs.python.org/file37911/starunpack25.diff

___
Python tracker 

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



[issue23347] asyncio: fix and refactor creation of subprocess transports

2015-01-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c1d92f7221a5 by Victor Stinner in branch '3.4':
Issue #23347, asyncio: send_signal(), terminate(), kill() don't check if the
https://hg.python.org/cpython/rev/c1d92f7221a5

--

___
Python tracker 

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



[issue23284] curses, readline, tinfo, and also --prefix, dbm, CPPFLAGS

2015-01-29 Thread Poor Yorick

Poor Yorick added the comment:

Ths OS is RHEL 6, but that's not so important because the entire collection,
including readline, is built from source and installed into an alternate
location.  With the exception of a few essential shared objects from the
system, everything else is contained in the alternate location.  Here's what
the readline INSTALL document says:

Readline uses the termcap functions, but does not link with the termcap or
curses library itself, allowing applications which link with readline 
to choose an appropriate library.

So if you don't monkey with the readline distribution, but build and install it
as-is, you get a libreadline.so that's not linked to a termcap library.  That's
the situation for our software collection.

--

___
Python tracker 

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



[issue23334] http.client refactor

2015-01-29 Thread Demian Brecht

Demian Brecht added the comment:

Digging into this more, I've opened up a can of worms that will result in 
http.client not looking nearly at all like http.client. I'll work this into 
httplib3 and will open this conversation back up if it gets any traction.

--
resolution:  -> rejected
status: open -> closed

___
Python tracker 

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



[issue23284] curses, readline, tinfo, and also --prefix, dbm, CPPFLAGS

2015-01-29 Thread Stefan Krah

Stefan Krah added the comment:

I still don't understand why libncurses is linked against libtinfo but
libreadline is not.  Again, what is your OS?

Example Ubuntu (a modern system):

$ ldd /lib/x86_64-linux-gnu/libncurses.so.5
linux-vdso.so.1 =>  (0x7fff5bfed000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x7fcb8b43a000)
libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 
(0x7fcb8b211000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x7fcb8ae4a000)
/lib64/ld-linux-x86-64.so.2 (0x7fcb8b87d000)

$ ldd /lib/x86_64-linux-gnu/libreadline.so.6
linux-vdso.so.1 =>  (0x7fff8c5fe000)
libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 
(0x7f43055a)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x7f43051da000)
/lib64/ld-linux-x86-64.so.2 (0x7f4305a2b000)

--

___
Python tracker 

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



[issue21962] No timeout for asyncio.Event.wait() or asyncio.Condition.wait() ?

2015-01-29 Thread STINNER Victor

STINNER Victor added the comment:

Ok, I made a minimal change to the asyncio documentation to suggest the usage 
of wait_for(). If you would like to enhance the documentation (ex: add some 
examples), please write a patch.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue21962] No timeout for asyncio.Event.wait() or asyncio.Condition.wait() ?

2015-01-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 21010940f8c1 by Victor Stinner in branch '3.4':
Issue #21962, asyncio doc: Suggest the usage of wait_for() to replace
https://hg.python.org/cpython/rev/21010940f8c1

--
nosy: +python-dev

___
Python tracker 

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



[issue20284] patch to implement PEP 461 (%-interpolation for bytes)

2015-01-29 Thread Ethan Furman

Changes by Ethan Furman :


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

___
Python tracker 

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



[issue23347] asyncio: fix and refactor creation of subprocess transports

2015-01-29 Thread STINNER Victor

STINNER Victor added the comment:

I commited my change with small changes.

"wait() is a coroutine, which is something uncommon. Is it ok to start using 
coroutines in transports, at least for subprocess transports?"

I made the method private (renamed to _wait()).

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue23347] asyncio: fix and refactor creation of subprocess transports

2015-01-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset dadc372f46fa by Victor Stinner in branch '3.4':
Issue #23347, asyncio: Make BaseSubprocessTransport.wait() private
https://hg.python.org/cpython/rev/dadc372f46fa

--

___
Python tracker 

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



[issue23347] asyncio: fix and refactor creation of subprocess transports

2015-01-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a5efd5021ca1 by Victor Stinner in branch '3.4':
asyncio: sync with Tulip
https://hg.python.org/cpython/rev/a5efd5021ca1

--
nosy: +python-dev

___
Python tracker 

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



[issue18620] multiprocessing page leaves out important part of Pool example

2015-01-29 Thread Davin Potts

Changes by Davin Potts :


--
nosy: +davin

___
Python tracker 

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



[issue16482] pdb.set_trace() clobbering traceback on error

2015-01-29 Thread Peter Inglesby

Peter Inglesby added the comment:

I've just hit this.  Is there anything I can do to help get this fixed?`

--
nosy: +inglesp

___
Python tracker 

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



[issue8144] muliprocessing shutdown infinite loop

2015-01-29 Thread Davin Potts

Davin Potts added the comment:

At nearly 5 years of age, this issue unfortunately never saw a viable 
demonstration of how to provoke the reported behavior.  Hopefully the reporter 
either (1) discovered the nature of the problem originated elsewhere and he was 
able to quickly fix it, or (2) won the lottery and merrily forgot all about 
this issue (and many other real-world issues).  Many things have changed in the 
multiprocessing module in the last 5 years and it is difficult to see how one 
might deliberately reproduce this now.  In the event that there is a 
reproducible issue like described herein, we hope that someone will step 
forward to open a new issue with more information.

--
nosy: +davin
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue15101] multiprocessing pool finalizer can fail if triggered in background pool thread

2015-01-29 Thread Davin Potts

Davin Potts added the comment:

Having reviewed the code commits made by Richard more than 2.5 years ago in 
conjunction with his related code commits from already-closed Issue #15064, I 
am led to conclude that all the items described in this issue have been 
addressed and implemented.

Specifically, the "quick fix" has been implemented in Richard's commits from 
2.5+ years ago, use of context managers was introduced in certain places as 
part of Issue #15064, and any further opportunities for leveraging context 
managers should reasonably be described in a new, separate issue.

The only outstanding item might be the desire for a test case to ensure 
Richard's improvements are not inadvertently undone in the future but given the 
nature of the changes and the age of this issue, I'm voting to go ahead and 
close this issue as resolved years ago.

--
nosy: +davin
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue23284] curses, readline, tinfo, and also --prefix, dbm, CPPFLAGS

2015-01-29 Thread Poor Yorick

Poor Yorick added the comment:

Larger changes represent more work on the part of the submitter ;) 
The following should reproduce the readline problem:

Have the current setup.py detect as the readline termcap library a
libncurses.so that itself links against libtinfo.so.  Without the --as-needed
flag, this is sufficient, since libtinfo ends up being indirectly linked to
readline.so, through libncurses.so.  Not that it was ever the right approach,
but absent --as-needed, it happens to work. 

Then, make sure the --as-needed flag is passed to the link command for the
readline.so module.  In that case, even though there is a "-lncurses" argument,
the linke will not link libncurses.so to readline.so because readline.so
doesn't directly need any symbols provided by libncurses.so.  The readline
module will then fail to load because terminal library symbols like UP will be
missing.

Without --as-needed, superfluous links between shared objects proliferate
through a software collection.  --as-needed is becoming more common, so it
would be good if setup.py didn't break because of it.

--

___
Python tracker 

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



[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2015-01-29 Thread Tomasz Wasilczyk

Tomasz Wasilczyk added the comment:

In such case, I agree it's an "enhancement", not a "bugfix". Could go into 3.5 
branch.

How about changing the ifdef to the following, to avoid any issues on 
non-MSVS2012:

#if defined(MS_WINDOWS) && defined(HAVE_FSTAT) && defined(_MSC_VER) && _MSC_VER 
== 1700

--

___
Python tracker 

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



[issue23285] PEP 475 - EINTR handling

2015-01-29 Thread Ned Deily

Ned Deily added the comment:

With eintr-2.diff, fast!:

$ time ./python 
~/Projects/PyDev/active/dev/3x/source/Lib/test/eintrdata/eintr_tester.py
test_read (__main__.OSEINTRTest) ... ok
test_wait (__main__.OSEINTRTest) ... ok
test_wait3 (__main__.OSEINTRTest) ... ok
test_wait4 (__main__.OSEINTRTest) ... ok
test_waitpid (__main__.OSEINTRTest) ... ok
test_write (__main__.OSEINTRTest) ... ok
test_accept (__main__.SocketEINTRTest) ... ok
test_recv (__main__.SocketEINTRTest) ... ok
test_recvmsg (__main__.SocketEINTRTest) ... ok
test_send (__main__.SocketEINTRTest) ... ok
test_sendall (__main__.SocketEINTRTest) ... ok
test_sendmsg (__main__.SocketEINTRTest) ... ok

--
Ran 12 tests in 7.652s

OK

real0m7.959s
user0m2.573s
sys 0m1.604s

Instrumented test_send, 3 socket.send calls, many socket.recv_into calls:

test_send (__main__.SocketEINTRTest) ... rd SO_RCVBUF default was 8192, wr 
SO_SNDBUF default was 8192
len(data) = 16777215
 
 sent = 8192, total written = 8192
 sent = 4440064, total written = 4448256
 sent = 12328959, total written = 16777215
 
 received = 8192, total read = 8192
 received = 8192, total read = 16384
 received = 8192, total read = 24576
 [...]
 received = 8192, total read = 16760832
 received = 8192, total read = 16769024
 received = 8191, total read = 16777215

--

___
Python tracker 

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



[issue18982] Add tests for CLI of the calendar module

2015-01-29 Thread Berker Peksag

Changes by Berker Peksag :


--
stage: patch review -> commit review

___
Python tracker 

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



[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2015-01-29 Thread Mark Lawrence

Mark Lawrence added the comment:

An enhancement can only go into 3.5, not 3.4.  This has to happen before beta 1 
which is currently scheduled for May 24 2015.  I'm against the idea as it would 
create too many compatibility issues.

--
nosy: +BreamoreBoy

___
Python tracker 

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



[issue8094] Multiprocessing infinite loop

2015-01-29 Thread Davin Potts

Davin Potts added the comment:

On Windows 7 (64-bit), it was not possible to reproduce any infinite looping 
behavior with the supplied example code.

Specifically, with the two examples from Benjamin, the observed behavior when 
running them was the same under 2.7.8 and default (3.5):  a RuntimeError 
results with a message suggesting that the code perhaps needs to leverage the 
"if __name__ == '__main__'" idiom to avoid having both parent and all 
subsequent children processes starting up a new process because they're all 
unintentionally running the same lines of code intended only for the parent to 
run.  Adding that idiomatic test to each of the two examples permits them to 
run to a happy conclusion.  That is, in the case of the first example we make 
that one-line code change to read:
# ---
import multiprocessing

def f(m):
print(m)

if __name__ == '__main__':
p = multiprocessing.Process(target=f, args=('pouet',))
p.start()
# ---

This would be a recommended practice on unix-y systems as well as Windows.

Aside: It was not possible to reproduce the issue injected by Darren either -- 
perhaps the example code provided was not quite what he intended.

The infinite looping behavior described in the original issue description might 
well have been reproducible in much earlier releases.  In the current default 
(3.5) branch (or in 2.7.8), it is no longer possible to reproduce.  I'm tempted 
to mark this as "out of date" but instead will opt for "works for me" and close 
the issue.

--
nosy: +davin
resolution:  -> works for me
status: open -> closed

___
Python tracker 

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



[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2015-01-29 Thread Steve Dower

Steve Dower added the comment:

It's not supported for building Python, is what I meant. I don't know what the 
status is for Microsoft support of VS2012, but I'd expect it's security fix 
only by now.

Being able to support building Python with alternative compilers is a task that 
we don't have the volunteers to support, especially on Windows. That said, I'm 
not against taking patches like this to improve it, but I'd expect they'll be 
treated as an enhancement and won't make it into any version before 3.4.

--

___
Python tracker 

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



[issue23285] PEP 475 - EINTR handling

2015-01-29 Thread Charles-François Natali

Charles-François Natali added the comment:

> eintr-1.diff doesn't seem to make any significant difference from eintr.diff 
> on my system.  It's still pegging a CPU at 100% and takes 7 minutes wall time 
> to complete.

Alright, enough played: the patch attached uses a memoryview and
socket.recv_into() to remove all memory allocations: if this doesn't
fix your problem, I don't know what's going on...

--
Added file: http://bugs.python.org/file37909/eintr-2.diff

___
Python tracker 

___diff -r fe0fddd6fd21 Lib/_pyio.py
--- a/Lib/_pyio.py  Sun Jan 18 11:17:39 2015 +0200
+++ b/Lib/_pyio.py  Thu Jan 29 19:53:06 2015 +
@@ -1006,10 +1006,7 @@
 current_size = 0
 while True:
 # Read until EOF or until read() would block.
-try:
-chunk = self.raw.read()
-except InterruptedError:
-continue
+chunk = self.raw.read()
 if chunk in empty_values:
 nodata_val = chunk
 break
@@ -1028,10 +1025,7 @@
 chunks = [buf[pos:]]
 wanted = max(self.buffer_size, n)
 while avail < n:
-try:
-chunk = self.raw.read(wanted)
-except InterruptedError:
-continue
+chunk = self.raw.read(wanted)
 if chunk in empty_values:
 nodata_val = chunk
 break
@@ -1060,12 +1054,7 @@
 have = len(self._read_buf) - self._read_pos
 if have < want or have <= 0:
 to_read = self.buffer_size - have
-while True:
-try:
-current = self.raw.read(to_read)
-except InterruptedError:
-continue
-break
+current = self.raw.read(to_read)
 if current:
 self._read_buf = self._read_buf[self._read_pos:] + current
 self._read_pos = 0
@@ -1214,8 +1203,6 @@
 while self._write_buf:
 try:
 n = self.raw.write(self._write_buf)
-except InterruptedError:
-continue
 except BlockingIOError:
 raise RuntimeError("self.raw should implement RawIOBase: it "
"should not raise BlockingIOError")
diff -r fe0fddd6fd21 Lib/distutils/spawn.py
--- a/Lib/distutils/spawn.pySun Jan 18 11:17:39 2015 +0200
+++ b/Lib/distutils/spawn.pyThu Jan 29 19:53:06 2015 +
@@ -137,9 +137,6 @@
 try:
 pid, status = os.waitpid(pid, 0)
 except OSError as exc:
-import errno
-if exc.errno == errno.EINTR:
-continue
 if not DEBUG:
 cmd = executable
 raise DistutilsExecError(
diff -r fe0fddd6fd21 Lib/multiprocessing/connection.py
--- a/Lib/multiprocessing/connection.py Sun Jan 18 11:17:39 2015 +0200
+++ b/Lib/multiprocessing/connection.py Thu Jan 29 19:53:06 2015 +
@@ -365,10 +365,7 @@
 def _send(self, buf, write=_write):
 remaining = len(buf)
 while True:
-try:
-n = write(self._handle, buf)
-except InterruptedError:
-continue
+n = write(self._handle, buf)
 remaining -= n
 if remaining == 0:
 break
@@ -379,10 +376,7 @@
 handle = self._handle
 remaining = size
 while remaining > 0:
-try:
-chunk = read(handle, remaining)
-except InterruptedError:
-continue
+chunk = read(handle, remaining)
 n = len(chunk)
 if n == 0:
 if remaining == size:
@@ -595,13 +589,7 @@
 self._unlink = None
 
 def accept(self):
-while True:
-try:
-s, self._last_accepted = self._socket.accept()
-except InterruptedError:
-pass
-else:
-break
+s, self._last_accepted = self._socket.accept()
 s.setblocking(True)
 return Connection(s.detach())
 
diff -r fe0fddd6fd21 Lib/multiprocessing/forkserver.py
--- a/Lib/multiprocessing/forkserver.py Sun Jan 18 11:17:39 2015 +0200
+++ b/Lib/multiprocessing/forkserver.py Thu Jan 29 19:53:06 2015 +
@@ -188,8 +188,6 @@
 finally:
 os._exit(code)
 
-except InterruptedError:
-pass
 except OSError as e:
 if e.errno != errno.ECONNABORTED:
 raise
@@ -230,13 +228,7 @@
 data = b''
 length = UNSIGNED_STRUCT.size
 while len(data) < length:
-while True:
-try:
-s = os.read(fd, len

[issue23284] curses, readline, tinfo, and also --prefix, dbm, CPPFLAGS

2015-01-29 Thread Stefan Krah

Stefan Krah added the comment:

I think even the curses changes alone are rather large, especially
for 2.7.  Perhaps you could give us exact instructions how to
reproduce the issue (OS, version, build command line).

--

___
Python tracker 

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



[issue23284] curses, readline, tinfo, and also --prefix, dbm, CPPFLAGS

2015-01-29 Thread Poor Yorick

Poor Yorick added the comment:

The wholesale inclusion of two additional files makes the patch look larger
than it is.  The modifications to setup.py address three different issues.  The
modifications for each issue don't overlap much, so they could be cherry-picked
fairly easily.  For the readline issue, all that's needed is the new function,
"ldd_find_library_file" and then the changes from line 704 to about line 773
that deal directly with readline and ncurses.

--

___
Python tracker 

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



[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2015-01-29 Thread Tomasz Wasilczyk

Tomasz Wasilczyk added the comment:

I don't mean fixing VS, but providing a workaround in Python code, when 
compiled with VS2012.

I know newer VS versions are fixed. Do you mean, VS2012 is not supported? If 
it's not - then LibreOffice team have a problem, because their official release 
is built with this suite.

If it is supported, and you don't want to alter behavior for other versions, 
then a patch may also contain an ifdef for MSVC 11.0.

--

___
Python tracker 

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



[issue21258] Add __iter__ support for mock_open

2015-01-29 Thread Maciej Zagrabski

Maciej Zagrabski added the comment:

Provided path did not work for me. Probably because lack of __next__ handler. I 
noticed that issue when interacting with cvs.reader and cvs.DictReader. After 
simple modification it seems to work fine.

--
nosy: +mucka
versions: +Python 3.4
Added file: http://bugs.python.org/file37908/mock_new.diff

___
Python tracker 

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



[issue22668] memoryview.format is corrupted due to dangling shared pointer

2015-01-29 Thread Stefan Krah

Stefan Krah added the comment:

Thanks, David.  The tests assumed little-endian, which is now fixed.

The MemoryError is sporadic and unrelated -- the OpenIndiana bot
often has system load issues.

I don't see any more related failures, please reopen if you do. :)

--
status: open -> closed

___
Python tracker 

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



[issue23284] curses, readline, tinfo, and also --prefix, dbm, CPPFLAGS

2015-01-29 Thread Poor Yorick

Poor Yorick added the comment:

ldd was found.  That patch does abstract and generalize ldd usage into a
function for reuse.  I'm building Python as part of a rather large software
collection that lives in an alternate prefix.  The main issue with the termcap
library is that with the --as-needed linker flag, which more modern build
systems prefer, linking to libncurses.so isn't sufficient, even when
libncurses.so itself links to libtinfo.so, but that's what setup.py decides to
do.

--

___
Python tracker 

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



[issue23284] curses, readline, tinfo, and also --prefix, dbm, CPPFLAGS

2015-01-29 Thread Stefan Krah

Stefan Krah added the comment:

What system are you using?  The patch is quite large, and the existing libtinfo 
logic should work on most systems.  Is the main problem that ldd is not found?

--
nosy: +skrah

___
Python tracker 

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



[issue23284] curses, readline, tinfo, and also --prefix, dbm, CPPFLAGS

2015-01-29 Thread Poor Yorick

Poor Yorick added the comment:

An attempt to build python-2.7.9 resulted in this error:

renaming "readline" since importing it failed ... undefined symbol: UP

This happened because setup.py chose "-lncursesw" as the readline terminal
library. Although libncursesw.so itself links to libtinfow.so, in order to
succeed with the "--as-needed" linker flag, setup.py would have to directly
choose libtinfow.so.  The part of the patch that deals with that does not rely
on the other changes that were made to accomodate -isystem in CPPFLAGS.

--

___
Python tracker 

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



[issue23243] asyncio: emit ResourceWarning warnings if transports/event loops are not explicitly closed

2015-01-29 Thread STINNER Victor

STINNER Victor added the comment:

Ok, I commited my change adding destructors on Python 3.4 and newer to emit 
warnings when event loops or transports are not explicitly closed.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue23243] asyncio: emit ResourceWarning warnings if transports/event loops are not explicitly closed

2015-01-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 543f770f62f0 by Victor Stinner in branch '3.4':
Issue #23243, asyncio: Emit a ResourceWarning when an event loop or a transport
https://hg.python.org/cpython/rev/543f770f62f0

--

___
Python tracker 

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



[issue23344] Faster marshalling

2015-01-29 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +kristjan.jonsson

___
Python tracker 

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



[issue12743] C API marshalling doc contains XXX

2015-01-29 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
stage:  -> needs patch
type:  -> behavior

___
Python tracker 

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



[issue22668] memoryview.format is corrupted due to dangling shared pointer

2015-01-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9a4af12dcc9d by Stefan Krah in branch '3.4':
Issue #22668: Remove endianness assumption in test.
https://hg.python.org/cpython/rev/9a4af12dcc9d

New changeset da0ca7b1351f by Stefan Krah in branch 'default':
Issue #22668: Merge from 3.4.
https://hg.python.org/cpython/rev/da0ca7b1351f

--

___
Python tracker 

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



[issue23346] shutil.rmtree doesn't work correctly on FreeBSD.

2015-01-29 Thread Denis Sukhonin

Denis Sukhonin added the comment:

The same problem.

>>> os.listdir(os.open('/tmp/test/', os.O_RDONLY))
Traceback (most recent call last):
  File "", line 1, in 
OSError: [Errno 22] Invalid argument

--

___
Python tracker 

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



[issue22668] memoryview.format is corrupted due to dangling shared pointer

2015-01-29 Thread R. David Murray

R. David Murray added the comment:

The buildbots aren't happy.  This one errors in the added test:

http://buildbot.python.org/all/builders/System%20Z%20Linux%203.x/builds/2595/steps/test/logs/stdio

Another one had a MemoryError in lib2to3 tests.  Not sure what is going on, but 
the one above at least is related to this issue.

(That's not a very descriptive name for a test, by the way, though it did allow 
me to find the issue easily ;)

--
nosy: +r.david.murray
status: closed -> open

___
Python tracker 

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



[issue23348] distutils.LooseVersion fails to compare two valid versions

2015-01-29 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue23348] distutils.LooseVersion fails to compare two valid versions

2015-01-29 Thread Guillaume

New submission from Guillaume:

$ python2.7 -c "from distutils.version import LooseVersion as V; print 
V('3.16.0-0.bpo.4-amd64') > V('3.16-0.bpo.2-amd64')"
False
$ python3.4 -c "from distutils.version import LooseVersion as V; 
print(V('3.16.0-0.bpo.4-amd64') > V('3.16-0.bpo.2-amd64'))" 
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.4/distutils/version.py", line 70, in __gt__
c = self._cmp(other)
  File "/usr/lib/python3.4/distutils/version.py", line 343, in _cmp
if self.version < other.version:
TypeError: unorderable types: int() < str()

Same thing with python3.2 et python3.3.

I find this on Debian. They recently change the numerotation of backported 
kernels.

--
components: Distutils
messages: 234975
nosy: dstufft, eric.araujo, maethor
priority: normal
severity: normal
status: open
title: distutils.LooseVersion fails to compare two valid versions
type: behavior
versions: Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2015-01-29 Thread Steve Dower

Steve Dower added the comment:

This is fixed in VS2015 last time I tried it. I've proposed workarounds for 
this before, but it's never affected any official build do there's never been 
any traction. The fstat patch is normally the check that I use.

I don't know what Tomasz means that it's not fixed. Fixes like this don't 
magically appear in earlier VS versions, and while VS2015 does have the fix, 
it's not quite ready for production work.

--

___
Python tracker 

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



[issue23346] shutil.rmtree doesn't work correctly on FreeBSD.

2015-01-29 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What if add a slash at the end of the path?

os.listdir(os.open('/tmp/test/', os.O_RDONLY))

--

___
Python tracker 

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



[issue22668] memoryview.format is corrupted due to dangling shared pointer

2015-01-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e9c1fca50b46 by Stefan Krah in branch '3.4':
Issue #22668: Ensure that format strings survive slicing after casting.
https://hg.python.org/cpython/rev/e9c1fca50b46

New changeset 37112bd3dfb3 by Stefan Krah in branch 'default':
Closes #22668: Merge from 3.4.
https://hg.python.org/cpython/rev/37112bd3dfb3

--
nosy: +python-dev
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue23333] asyncio: add a new Protocol.connection_failed() method

2015-01-29 Thread STINNER Victor

STINNER Victor added the comment:

I commited  a simplified version of accept_connection_failed.patch, without the 
call to connection_failed().

--

___
Python tracker 

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



[issue23333] asyncio: add a new Protocol.connection_failed() method

2015-01-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c4fd6df9aea6 by Victor Stinner in branch '3.4':
asyncio: sync with Tulip
https://hg.python.org/cpython/rev/c4fd6df9aea6

--
nosy: +python-dev

___
Python tracker 

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



[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2015-01-29 Thread STINNER Victor

STINNER Victor added the comment:

@steve.dower: Do you have info on this issue?

--
nosy: +steve.dower

___
Python tracker 

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



[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2015-01-29 Thread Tomasz Wasilczyk

Tomasz Wasilczyk added the comment:

It seems that bug remains *not* fixed.

Just like eaducac pointed out, there are cases when underlying file handle is 
-2, which is not a valid file handle, but *is* a valid handle (which is 
GetCurrentThread).

Thus, provided dup solution accepts it, while it shouldn't. However, suggested 
GetStdHandle check still doesn't work for me. While working on the related 
Spoon issue, I've worked out a working solution (see the patch attached).

Tomek,
Spoon.net dev

--
keywords: +patch
nosy: +twasilczyk@spoon
Added file: http://bugs.python.org/file37907/python-3.3.5-fdvalidation.patch

___
Python tracker 

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



[issue11578] Increase test coverage for timeit.py

2015-01-29 Thread koobs

koobs added the comment:

7e7c825f75ad832d973542bfcf9ecd6e5dd3f981 broke koobs-freebsd9 and 
koobs-freebsd10, with:

==
FAIL: test_main_exception (test.test_timeit.TestTimeit)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/2.7.koobs-freebsd9/build/Lib/test/test_timeit.py", 
line 300, in test_main_exception
self.assert_exc_string(error_stringio.getvalue(), 'ZeroDivisionError')
  File 
"/usr/home/buildbot/python/2.7.koobs-freebsd9/build/Lib/test/test_timeit.py", 
line 195, in assert_exc_string
self.assertTrue(exc_lines[0].startswith('Traceback'))
AssertionError: False is not true

--

--
nosy: +koobs
status: closed -> open

___
Python tracker 

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



[issue23346] shutil.rmtree doesn't work correctly on FreeBSD.

2015-01-29 Thread koobs

Changes by koobs :


--
nosy: +koobs

___
Python tracker 

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



[issue23346] shutil.rmtree doesn't work correctly on FreeBSD.

2015-01-29 Thread STINNER Victor

Changes by STINNER Victor :


--
versions: +Python 3.5

___
Python tracker 

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



[issue23346] shutil.rmtree doesn't work correctly on FreeBSD.

2015-01-29 Thread STINNER Victor

STINNER Victor added the comment:

>> Does os.listdir(os.open('/tmp/test', os.O_RDONLY)) work?

> No, it throws 22.

Oh, too bad. Maybe we can detect this at Python compilation. If not, rmtree() 
should detect the failure and switch back to the unsafe implementation (which 
uses paths, not file descriptors).

--
nosy: +haypo

___
Python tracker 

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



[issue23346] shutil.rmtree doesn't work correctly on FreeBSD.

2015-01-29 Thread Denis Sukhonin

Denis Sukhonin added the comment:

No, it throws 22.

>>> os.listdir(os.open('/tmp/test', os.O_RDONLY))
Traceback (most recent call last):
  File "", line 1, in 
OSError: [Errno 22] Invalid argument

--

___
Python tracker 

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



[issue23346] shutil.rmtree doesn't work correctly on FreeBSD.

2015-01-29 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Does os.listdir(os.open('/tmp/test', os.O_RDONLY)) work?

--

___
Python tracker 

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



[issue23347] asyncio: fix and refactor creation of subprocess transports

2015-01-29 Thread STINNER Victor

New submission from STINNER Victor:

Attached patch fix and refactors the creation of asyncio subprocess transports. 
It fixes the code handling errors.

Changes:

* Add a wait() method to wait until the child process exit

* The constructor now accepts an optional waiter parameter. The _post_init() 
coroutine must not be called explicitly anymore. It makes subprocess transports 
closer to other transports, and it gives more freedom if we want later to 
change completly how subprocess transports are created.

* close() now kills the process instead of kindly terminate it: the child 
process may ignore SIGTERM and continue to run. Call explicitly terminate() and 
wait() if you want to kindly terminate the child process.

* close() now logs a warning in debug mode if the process is still running and 
needs to be killed

* _make_subprocess_transport() is now fully asynchronous again: if the creation 
of the transport failed, wait asynchronously for the process eixt. Before the 
wait was synchronous. This change requires close() to *kill*, and not 
terminate, the child process.

* Remove the _kill_wait() method, replaced with a more agressive close() 
method. It fixes _make_subprocess_transport() on error. 
BaseSubprocessTransport.close() calls the close() method of pipe transports, 
whereas _kill_wait() closed directly pipes of the subprocess.Popen object 
without unregistering file descriptors from the selector (which caused severe 
bugs).

* These changes make subprocess.py much simpler!

wait() is a coroutine, which is something uncommon. Is it ok to start using 
coroutines in transports, at least for subprocess transports?

--
components: asyncio
files: subprocess_wait.patch
keywords: patch
messages: 234963
nosy: gvanrossum, haypo, yselivanov
priority: normal
severity: normal
status: open
title: asyncio: fix and refactor creation of subprocess transports
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file37906/subprocess_wait.patch

___
Python tracker 

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



[issue23340] uClibc C++ exceptions issue

2015-01-29 Thread Alex Potapenko

Changes by Alex Potapenko :


--
title: armv7l C++ exceptions issue -> uClibc C++ exceptions issue

___
Python tracker 

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



[issue23340] armv7l C++ exceptions issue

2015-01-29 Thread Alex Potapenko

Alex Potapenko added the comment:

Thank you for giving me a hint, Eric! Even though you weren't 100% right, your 
got me thinking in the right direction, and I found out in the end that I have 
to explicitly link python with libgcc_s on build time. Now everything works 
fine. This looks like a uClibc issue, and it should be noted somewhere for 
others who might encounter similar problems, I suppose.

--

___
Python tracker 

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



[issue23345] test_ssl fails on OS X 10.10.2 with latest patch level of OpenSSL libs

2015-01-29 Thread Ned Deily

Ned Deily added the comment:

Yep, 0.9.8 is the newest and presumably last major of version of OpenSSL in OS 
X. OpenSSL has been officially deprecated by Apple in OS X since OS X 10.7; 
it's only there for third-party products shipped by Apple in OS X, like Python. 
 Their own apps use Apple's own frameworks like SecTransform and CommonCrypto.  
(See, for example, 
http://rentzsch.tumblr.com/post/33696323211/wherein-i-write-apples-technote-about-openssl-on)
 Apple also ships 0.9.7 shared libs in 10.10 for really old applications.

--

___
Python tracker 

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



[issue23346] shutil.rmtree doesn't work correctly on FreeBSD.

2015-01-29 Thread Denis Sukhonin

Denis Sukhonin added the comment:

It returns an integer.

>>> import os
>>> os.open('/tmp/test', os.O_RDONLY)
3

--

___
Python tracker 

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



[issue23346] shutil.rmtree doesn't work correctly on FreeBSD.

2015-01-29 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

topfd is '/tmp/test'. But it should be file descriptor, an integer. What 
os.open('/tmp/test', os.O_RDONLY) returns?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue23337] Run python with restricted rights

2015-01-29 Thread Marc

Marc added the comment:

Hi Ramchandra,

I actually have an AV (Sophos) but no firewall on the computer

--

___
Python tracker 

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



[issue23285] PEP 475 - EINTR handling

2015-01-29 Thread Charles-François Natali

Charles-François Natali added the comment:

OK, it turns out the culprit was repeated calls to BytesIO.getvalue(),
which forced large allocations upon reception of every message.
The patch attached fixes this (without changing the socket buffer size).

--
Added file: http://bugs.python.org/file37905/eintr-1.diff

___
Python tracker 

___diff -r fe0fddd6fd21 Lib/_pyio.py
--- a/Lib/_pyio.py  Sun Jan 18 11:17:39 2015 +0200
+++ b/Lib/_pyio.py  Thu Jan 29 07:59:47 2015 +
@@ -1006,10 +1006,7 @@
 current_size = 0
 while True:
 # Read until EOF or until read() would block.
-try:
-chunk = self.raw.read()
-except InterruptedError:
-continue
+chunk = self.raw.read()
 if chunk in empty_values:
 nodata_val = chunk
 break
@@ -1028,10 +1025,7 @@
 chunks = [buf[pos:]]
 wanted = max(self.buffer_size, n)
 while avail < n:
-try:
-chunk = self.raw.read(wanted)
-except InterruptedError:
-continue
+chunk = self.raw.read(wanted)
 if chunk in empty_values:
 nodata_val = chunk
 break
@@ -1060,12 +1054,7 @@
 have = len(self._read_buf) - self._read_pos
 if have < want or have <= 0:
 to_read = self.buffer_size - have
-while True:
-try:
-current = self.raw.read(to_read)
-except InterruptedError:
-continue
-break
+current = self.raw.read(to_read)
 if current:
 self._read_buf = self._read_buf[self._read_pos:] + current
 self._read_pos = 0
@@ -1214,8 +1203,6 @@
 while self._write_buf:
 try:
 n = self.raw.write(self._write_buf)
-except InterruptedError:
-continue
 except BlockingIOError:
 raise RuntimeError("self.raw should implement RawIOBase: it "
"should not raise BlockingIOError")
diff -r fe0fddd6fd21 Lib/distutils/spawn.py
--- a/Lib/distutils/spawn.pySun Jan 18 11:17:39 2015 +0200
+++ b/Lib/distutils/spawn.pyThu Jan 29 07:59:47 2015 +
@@ -137,9 +137,6 @@
 try:
 pid, status = os.waitpid(pid, 0)
 except OSError as exc:
-import errno
-if exc.errno == errno.EINTR:
-continue
 if not DEBUG:
 cmd = executable
 raise DistutilsExecError(
diff -r fe0fddd6fd21 Lib/multiprocessing/connection.py
--- a/Lib/multiprocessing/connection.py Sun Jan 18 11:17:39 2015 +0200
+++ b/Lib/multiprocessing/connection.py Thu Jan 29 07:59:47 2015 +
@@ -365,10 +365,7 @@
 def _send(self, buf, write=_write):
 remaining = len(buf)
 while True:
-try:
-n = write(self._handle, buf)
-except InterruptedError:
-continue
+n = write(self._handle, buf)
 remaining -= n
 if remaining == 0:
 break
@@ -379,10 +376,7 @@
 handle = self._handle
 remaining = size
 while remaining > 0:
-try:
-chunk = read(handle, remaining)
-except InterruptedError:
-continue
+chunk = read(handle, remaining)
 n = len(chunk)
 if n == 0:
 if remaining == size:
@@ -595,13 +589,7 @@
 self._unlink = None
 
 def accept(self):
-while True:
-try:
-s, self._last_accepted = self._socket.accept()
-except InterruptedError:
-pass
-else:
-break
+s, self._last_accepted = self._socket.accept()
 s.setblocking(True)
 return Connection(s.detach())
 
diff -r fe0fddd6fd21 Lib/multiprocessing/forkserver.py
--- a/Lib/multiprocessing/forkserver.py Sun Jan 18 11:17:39 2015 +0200
+++ b/Lib/multiprocessing/forkserver.py Thu Jan 29 07:59:47 2015 +
@@ -188,8 +188,6 @@
 finally:
 os._exit(code)
 
-except InterruptedError:
-pass
 except OSError as e:
 if e.errno != errno.ECONNABORTED:
 raise
@@ -230,13 +228,7 @@
 data = b''
 length = UNSIGNED_STRUCT.size
 while len(data) < length:
-while True:
-try:
-s = os.read(fd, length - len(data))
-except InterruptedError:
-pass
-else:
-break
+s = os.read(fd, length - 

[issue23345] test_ssl fails on OS X 10.10.2 with latest patch level of OpenSSL libs

2015-01-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Er... OS X 10.10 ships OpenSSL 0.9.8??

--

___
Python tracker 

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



[issue23345] test_ssl fails on OS X 10.10.2 with latest patch level of OpenSSL libs

2015-01-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

The assumption was that the patch level represented a letter (from 'a' to 'z'), 
but we can certainly relax that.

--

___
Python tracker 

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



[issue23285] PEP 475 - EINTR handling

2015-01-29 Thread Ned Deily

Ned Deily added the comment:

eintr-1.diff doesn't seem to make any significant difference from eintr.diff on 
my system.  It's still pegging a CPU at 100% and takes 7 minutes wall time to 
complete.

$ time ./python 
~/Projects/PyDev/active/dev/3x/source/Lib/test/eintrdata/eintr_tester.py
test_read (__main__.OSEINTRTest) ... ok
test_wait (__main__.OSEINTRTest) ... ok
test_wait3 (__main__.OSEINTRTest) ... ok
test_wait4 (__main__.OSEINTRTest) ... ok
test_waitpid (__main__.OSEINTRTest) ... ok
test_write (__main__.OSEINTRTest) ... ok
test_accept (__main__.SocketEINTRTest) ... ok
test_recv (__main__.SocketEINTRTest) ... ok
test_recvmsg (__main__.SocketEINTRTest) ... ok
test_send (__main__.SocketEINTRTest) ... ok
test_sendall (__main__.SocketEINTRTest) ... ok
test_sendmsg (__main__.SocketEINTRTest) ... ok

--
Ran 12 tests in 439.966s

OK

real7m20.276s
user5m7.575s
sys 2m9.846s

--

___
Python tracker 

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



[issue20923] ConfigParser should nested [] in section names.

2015-01-29 Thread Sebastian Bank

Sebastian Bank added the comment:

If this is the intended behaviuour, I guess ConfigParser should warn the user 
if he supplies a section name with a ']' (prevent failed roundtrips).

See http://bugs.python.org/issue23301

The current behaviour looks like the opposite of  Postel's law.

--
nosy: +xflr6

___
Python tracker 

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