[issue22274] subprocess.Popen(stderr=STDOUT) fails to redirect subprocess stderr to stdout

2016-05-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 642933771fa5 by Martin Panter in branch '3.5':
Issue #22274: Redirect stderr=STDOUT when stdout not redirected, by Akira Li
https://hg.python.org/cpython/rev/642933771fa5

New changeset 5979e7aadd59 by Martin Panter in branch 'default':
Issue #22274: Merge stderr=STDOUT fix from 3.5
https://hg.python.org/cpython/rev/5979e7aadd59

New changeset 5f46ecaf8c6e by Martin Panter in branch '2.7':
Issue #22274: Redirect stderr=STDOUT when stdout not redirected, by Akira Li
https://hg.python.org/cpython/rev/5f46ecaf8c6e

--
nosy: +python-dev

___
Python tracker 

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



[issue26839] Python 3.5 running in a virtual machine with Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-05-13 Thread Colm Buckley

Colm Buckley added the comment:

The attached patch (against 20160330) addresses the issue for me on Linux; it 
has not been tested on other platforms. It adds the GRND_NONBLOCK flag to the 
getrandom() call and sends the appropriate failure return if it returns due to 
lack of entropy. The enclosing functions fall back to reading from /dev/urandom 
in this case.

Affected files:

Python/random.c - changes to py_getrandom()
configure.ac and pyconfig.h.in - look for linux/random.h for inclusion

Can this, or something similar, be considered for integration with mainline?

--
keywords: +patch
Added file: http://bugs.python.org/file42837/nonblocking-getrandom.diff

___
Python tracker 

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



[issue26892] debuglevel not honored in urllib

2016-05-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 63e23b2dedcc by Senthil Kumaran in branch '3.5':
Issue #26892: Honor debuglevel flag in urllib.request.HTTPHandler.
https://hg.python.org/cpython/rev/63e23b2dedcc

New changeset e0ec68d46464 by Senthil Kumaran in branch 'default':
merge from 3.5
https://hg.python.org/cpython/rev/e0ec68d46464

--
nosy: +python-dev

___
Python tracker 

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



[issue26892] debuglevel not honored in urllib

2016-05-13 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Thank you for the patch, Chi Hsuan Yen.

--
assignee:  -> orsenthil
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
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



[issue24358] Should compression file-like objects provide .fileno(), misleading subprocess?

2016-05-13 Thread Jonas H.

Jonas H. added the comment:

I just hit this too. I'd say remove the fileno() method from wrapper objects 
like GzipFile. I'm happy to submit a patch.

--
nosy: +jonash

___
Python tracker 

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



[issue15786] IDLE code completion window can hang or misbehave with mouse

2016-05-13 Thread Tal Einat

Tal Einat added the comment:

Regarding your questions about completion behavior:

You don't have to scroll, you can continue typing and the completion list will 
filter itself to options that match the additional characters. Deleting 
characters works too (options reappear in the list).

The second thing you mention is having to manually type the parenthesis after 
completing a function/method name. A long time ago, I had a prototype which 
added them automatically, but I never got it polished enough to add to IDLE. 
However, this has rarely been raised as a request. Also, Terry said he wants to 
refactor the code and get it well tested, so I imagine new features like this 
won't get in any time soon...

--

___
Python tracker 

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



[issue27013] IDLE completion for dict keys

2016-05-13 Thread Tal Einat

New submission from Tal Einat:

I just wanted to mention that I once added this feature to IDLE and it's really 
great for interactive work, especially with data structures such as tables or 
JSON. If there's ever interest, I can try to hunt down my old code.

--
components: IDLE
messages: 265457
nosy: kbk, roger.serwy, taleinat, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE completion for dict keys
type: enhancement
versions: Python 2.7, 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



[issue26919] android: test_cmd_line fails

2016-05-13 Thread Xavier de Gaye

Xavier de Gaye added the comment:

This patch follows Victor suggestion in msg230407 and brings the changes made 
in issue #4388 and issue #16416 to the Android platform. As a consequence, it 
adds a new test for Android in test_cmd_line named test_osx_android_utf8 (was 
previously test_osx_utf8). The platform.android_ver() function is defined by 
issue #26855: "add platform.android_ver() for android".

With this patch test_cmd_line does not have any failure.

--
keywords: +patch
Added file: http://bugs.python.org/file42838/retrofit_osx.patch

___
Python tracker 

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



[issue26039] More flexibility in zipfile write interface

2016-05-13 Thread Martin Panter

Martin Panter added the comment:

Yes this looks okay to me, so go ahead.

My only concern was other methods affecting the file position while in the 
middle of writing, but it looks like those methods maintain separate objects 
like self.filelist, so there is no conflict.

--

___
Python tracker 

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



[issue22274] subprocess.Popen(stderr=STDOUT) fails to redirect subprocess stderr to stdout

2016-05-13 Thread Martin Panter

Martin Panter added the comment:

Thanks for the patch Akira.

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



[issue26039] More flexibility in zipfile write interface

2016-05-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 175c3f1d0256 by Serhiy Storchaka in branch 'default':
Issue #26039: zipfile.ZipFile.open() can now be used to write data into a ZIP
https://hg.python.org/cpython/rev/175c3f1d0256

--

___
Python tracker 

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



[issue26919] android: test_cmd_line fails

2016-05-13 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Patch updated after vadmium review.

--
Added file: http://bugs.python.org/file42839/retrofit_osx_2.patch

___
Python tracker 

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



[issue26920] android: test_sys fails

2016-05-13 Thread Xavier de Gaye

Xavier de Gaye added the comment:

test_ioencoding_nonascii does not fail when LANG is set to en_GB.UTF-8 in the 
environment.

--

___
Python tracker 

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



[issue24358] Should compression file-like objects provide .fileno(), misleading subprocess?

2016-05-13 Thread Martin Panter

Martin Panter added the comment:

Where would you draw the line though? At one extreme, BufferedWriter is a 
wrapper, but if you removed BufferedWriter.fileno() it would break all the code 
that does

with open(os.devnull, "wb") as null:
proc = subprocess.Popen(..., stdout=null)

Would you remove it from HTTPResponse? Some HTTP responses can be chunked, so 
the child process would see the chunk headers using fileno(). But other HTTP 
responses are more direct and would work smoothly with the subprocess module.

Considering the compatibility problems and other possible uses of fileno(), I 
suspect removing it would be a bad idea. “Throwing the baby out with the 
bathwater” comes to mind. A less drastic change would be to require an explicit 
fileno() call and only passing the file descriptor to subprocess.

There is already a bug open for improving the documentation: Issue 19992

--

___
Python tracker 

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



[issue19992] subprocess documentation not explicit about fileno()

2016-05-13 Thread Martin Panter

Changes by Martin Panter :


--
stage:  -> needs patch
versions: +Python 2.7, 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



[issue26920] android: test_sys fails

2016-05-13 Thread Xavier de Gaye

Xavier de Gaye added the comment:

> test_ioencoding_nonascii does not fail when LANG is set to en_GB.UTF-8 in the 
> environment.

When LANG is not set, we have on an android emulator:

>>> from test.support import FS_NONASCII
>>> print(FS_NONASCII)
Traceback (most recent call last):
  File "", line 1, in 
UnicodeEncodeError: 'ascii' codec can't encode character '\xe6' in position 0: 
ordinal not in range(128)


But on linux when LANG is not set:

$ LANG= ./python
Python 3.6.0a0 (default:eee959fee5f5+, May 13 2016, 11:32:27) 
[GCC 6.1.1 20160501] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from test.support import FS_NONASCII
>>> print(FS_NONASCII)
None
>>> 

And test_ioencoding_nonascii is skipped accordingly on linux for the following 
printed reason: 'requires OS support of non-ASCII encodings'.

On Android, os.fsdecode(os.fsencode('\xe6')) does not raise UnicodeError in the 
test.support module. And locale.getpreferredencoding() returns 'ascii'. So it 
seems that this criterion (FS_NONASCII is not None) is not sufficient to decide 
when this test should be run and not skipped.

--
nosy: +haypo

___
Python tracker 

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



[issue15786] IDLE code completion window can hang or misbehave with mouse

2016-05-13 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Thanks Paul, that will probably be helpful somehow.  I was expecting the 
opposite.  H.

Box comes up after cntl-space or time delay after key char.  I have time delay 
much shorter than default.  I do what Tal said  -- type a couple of letters, 
then sometimes use down arrow key, I guess I learned years ago not to click, 
and had forgotten, so I seldom have a problem.  But I completely understand 
that a new user could get very upset.

--

___
Python tracker 

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



[issue27013] IDLE completion for dict keys

2016-05-13 Thread Terry J. Reedy

Terry J. Reedy added the comment:

#21261 has a patch that I have not looked at.  Comment and review welcome.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Teach IDLE to Autocomplete dictionary keys

___
Python tracker 

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



[issue26092] doctest should allow custom sys.displayhook

2016-05-13 Thread Sergey B Kirpichev

Sergey B Kirpichev added the comment:

> What problem does replacing __displayhook__ provoke?

I don't know for sure.

But the documentation says "These objects contain the original values of 
displayhook and excepthook at the start of the program."  So, other code in 
stdlib may assume something about __displayhook__ value.  I.e. it writes the 
values it gets to sys.stdout.  (Apparently, doctest thinks so.) Such 
assumptions should be documented, before people can override __displayhook__ 
safely.

> What solution do you propose instead of 8048, which fixed a bug?

IMHO, it's not a bug.  Why not override sys.displayhook just for doctests in 
this application?

PS:
Sorry for late answer, somehow I haven't got mail notification after your reply.

--

___
Python tracker 

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



[issue22141] rlcompleter.Completer matches too much

2016-05-13 Thread Martin Panter

Martin Panter added the comment:

Maybe there are two special cases colliding here:

1. complete("A.foo", 0) returns "A.foo(". But the opening bracket is in 
readline.get_completer_delims(), which means the completer has suggested not 
only a “word” but also a delimiter.

2. Perhaps Lorenz has taken "A.foo(" directly and passed it back to the 
completer. But as Robert said, if Readline were used, it would see the bracket 
as a delimiter, and only pass an empty string as the text.

The question is how should the completer behave when it gets (invalid) input 
that would not be possible from default Readline usage?

Lorenz: why are you passing "A.foo(" to the completer, when it only parses 
attribute names, and not other Python syntax such as brackets?

--
nosy: +martin.panter

___
Python tracker 

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



[issue22143] rlcompleter.Completer has duplicate matches

2016-05-13 Thread Martin Panter

Martin Panter added the comment:

I think this was fixed by Issue 25663. (Sorry I wasn’t aware of the work 
already done here.)

--
nosy: +martin.panter
resolution:  -> out of date
status: open -> closed
superseder:  -> Make rlcompleter avoid duplicate global names

___
Python tracker 

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



[issue22143] rlcompleter.Completer has duplicate matches

2016-05-13 Thread Martin Panter

Martin Panter added the comment:

Actually more like Issue 25590 (this was about attribute names, not global 
names)

--
superseder: Make rlcompleter avoid duplicate global names -> tab-completition 
on instances repeatedly accesses attribute/descriptors values

___
Python tracker 

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



[issue14782] Tab-completion of callables displays opening paren

2016-05-13 Thread Martin Panter

Martin Panter added the comment:

FWIW, count me against the automatic brackets as well. Another way it gets in 
the road:

>>> class C(object(. . .

In Issue 5062, Carl thought there might be a switch to turn the behaviour off. 
Perhaps we could add some sort of configuration option.

--

___
Python tracker 

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



[issue27014] maximum recursion depth when using typing options

2016-05-13 Thread Roy Shmueli

New submission from Roy Shmueli:

While creating class of List and using a Optional as part of the typing system. 
I have got an error when I was importing one of my module. I was able to 
simplify the problem by creating a one module that replicate the crash.

--
files: bug.py
messages: 265473
nosy: Roy Shmueli
priority: normal
severity: normal
status: open
title: maximum recursion depth when using typing options
type: crash
versions: Python 3.5
Added file: http://bugs.python.org/file42840/bug.py

___
Python tracker 

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



[issue5062] Rlcompleter.Completer does not use __dir__ magic method

2016-05-13 Thread Martin Panter

Changes by Martin Panter :


--
components: +Library (Lib) -Documentation, Extension Modules

___
Python tracker 

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



[issue5062] Rlcompleter.Completer does not use __dir__ magic method

2016-05-13 Thread Martin Panter

Martin Panter added the comment:

Issue 14782 is open for complaints about the opening brackets.

I think this report was mainly about attributes that fail the hasattr() test. 
In Issue 25590 we were conservative and only fixed it in 3.6+.

--
nosy: +martin.panter
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> tab-completition on instances repeatedly accesses 
attribute/descriptors values
versions: +Python 3.6 -Python 2.6, Python 3.0

___
Python tracker 

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



[issue21261] Teach IDLE to Autocomplete dictionary keys

2016-05-13 Thread Martin Panter

Martin Panter added the comment:

I have no idea how IDLE works internally, but I wonder if it is possible to 
share some of the work with the Readline completer (rlcompleter module). 
Despite the name, rlcompleter should be usable without also using Readline, 
though recently (Issue 25660) I think this was broken. Anyway, maybe see Issue 
10351 for the beginning of an rlcompleter patch and some potential test cases.

--
nosy: +martin.panter

___
Python tracker 

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



[issue22970] asyncio: Cancelling wait() after notification leaves Condition in an inconsistent state

2016-05-13 Thread David Coles

David Coles added the comment:

Since I reported this, I haven't seen any proposed solutions other other than a 
retry loop to ensure that the lock is guaranteed to be reacquired when the 
sleeping coroutine is woken.

The four possibilities of cancelling the waiting coroutine are:

1. Before wait is scheduled
   (Because the coroutine is never run, the lock is never released and a 
CancelledError is thrown by the runtime)
2. While waiting to be notified
   (CancelledError is thrown, but the 'finally' clause reacquires lock)
3. After wait has returned
   (This is a no-op since the wait coroutine has already completed - no 
CancelledError is thrown)
4. After notification, but while waiting on lock reaquisition
   (The problem discussed here)

Cancellation is quite analogous to EINTER of system calls interrupted by 
signals - you'll notice that the CPython runtime will retry acquiring the lock 
forever https://hg.python.org/cpython/file/default/Python/thread_pthread.h#l355 
. This is acceptable behaviour acording the the POSIX spec 
http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_cond_timedwait.html
 , in particular:

"If a signal is delivered to a thread waiting for a condition variable, upon 
return from the signal handler the thread resumes waiting for the condition 
variable as if it was not interrupted, or it shall return zero due to spurious 
wakeup."

"Upon successful return, the mutex shall have been locked and shall be owned by 
the calling thread."

"These functions shall not return an error code of [EINTR]."

Thus, other than throwing something like a RuntimeError, there's no way to 
legally return from a Condition.wait without having that lock reacquired. Thus 
the only option is to retry if the lock reacquire is interrupted.

--

___
Python tracker 

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



[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-05-13 Thread Colm Buckley

Colm Buckley added the comment:

A couple of things to note:

* Despite the earlier title; this does not just apply to VMs; any system with a 
potentially-blocking getrandom() (including all Linux 3.17+ and Solaris 11+) is 
affected.

* It's true that getrandom() only blocks on Linux when called before the RNG 
entropy pool is initialized. However, Python should not be limited to only 
being called after this initialization.

* In particular, systemd-cron relies on a Python script being called very early 
in the boot process (before the urandom pool is initialized), this is now 
prevalent on the Debian testing track; causing a 90-second boot delay.

* The patch I supplied causes getrandom() to be only called in nonblocking 
mode; this seems consistent with the desired semantics of os.urandom and 
_PyRandomInit.

Hope this helps.

Colm

--
title: Python 3.5 running in a virtual machine with Linux kernel 3.17+ can 
block at startup or on importing the random module on getrandom() -> Python 3.5 
running on Linux kernel 3.17+ can block at startup or on importing the random 
module on getrandom()
type:  -> behavior

___
Python tracker 

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



[issue26998] Unable to import "site" in an embedded application

2016-05-13 Thread Steve Dower

Steve Dower added the comment:

The PEP doesn't really apply to 2.7, apart from explicitly expecting tools to 
still detect 32-bit and 64-bit versions despite sys.winver being the same.

As for sys.winver being incorrect in 2.7.11, that's been fixed (issue25824), 
but wasn't deemed critical enough to release 2.7.12 immediately. The next 
update will be released soon with the fix.

--
resolution:  -> duplicate
status: open -> closed
superseder:  -> 32-bit 2.7.11 installer creates registry keys that are 
incompatible with the installed python27.dll

___
Python tracker 

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



[issue26992] 64-bit Python 2.7.11 hangs in 64-bit Windows 10 - CMD and Git Bash

2016-05-13 Thread Steve Dower

Steve Dower added the comment:

I wonder if it's related to issue26882? Seems unlikely as they are very 
different versions, but it's possible.

--

___
Python tracker 

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



[issue26920] android: test_sys fails

2016-05-13 Thread Xavier de Gaye

Xavier de Gaye added the comment:

> On Android, os.fsdecode(os.fsencode('\xe6')) does not raise UnicodeError in 
> the test.support module.

Because of changeset ad6be34ce8c9.

--

___
Python tracker 

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



[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-05-13 Thread Colm Buckley

Colm Buckley added the comment:

@haypo - yes, it's strange that Linux's getrandom() might block even when 
reading the urandom pool. However, I think we need to just cope with this and 
add the GRND_NONBLOCK flag rather than attempting to force a change in the 
Linux kernel

--

___
Python tracker 

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



[issue27015] subprocess.CalledProcessError's repr changes based on kwargs, and doesn't unpickle

2016-05-13 Thread Taywee

New submission from Taywee:

When using kwargs to construct a CalledProcessError, the repr doesn't show 
those args, and using kwargs also breaks pickling:

>>> import pickle; from subprocess import CalledProcessError
>>> CalledProcessError(2, 'foo')
CalledProcessError(2, 'foo')
>>> CalledProcessError(2, 'foo').returncode
2
>>> CalledProcessError(2, 'foo').cmd
'foo'
>>> CalledProcessError(returncode=2, cmd='foo')
CalledProcessError()
>>> CalledProcessError(returncode=2, cmd='foo').returncode
2
>>> CalledProcessError(returncode=2, cmd='foo').cmd
'foo'
>>> pickle.loads(pickle.dumps(CalledProcessError(2, 'foo')))
CalledProcessError(2, 'foo')
>>> pickle.loads(pickle.dumps(CalledProcessError(returncode=2, cmd='foo')))
Traceback (most recent call last):
  File "", line 1, in 
TypeError: __init__() missing 2 required positional arguments: 'returncode' and 
'cmd'
>>>

--
components: Library (Lib)
messages: 265482
nosy: Taywee
priority: normal
severity: normal
status: open
title: subprocess.CalledProcessError's repr changes based on kwargs, and 
doesn't unpickle
type: behavior
versions: Python 3.4, Python 3.5

___
Python tracker 

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



[issue8886] zipfile.ZipExtFile is a context manager, but that is not documented

2016-05-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ae50bf6e3ac8 by Serhiy Storchaka in branch '3.5':
Restored test_interleaved. After issue #8886 it was a duplicate of
https://hg.python.org/cpython/rev/ae50bf6e3ac8

New changeset 62d844d2bd07 by Serhiy Storchaka in branch 'default':
Restored test_interleaved. After issue #8886 it was a duplicate of
https://hg.python.org/cpython/rev/62d844d2bd07

New changeset ba823131b25e by Serhiy Storchaka in branch '2.7':
Restored test_interleaved. After issue #8886 it was a duplicate of
https://hg.python.org/cpython/rev/ba823131b25e

--

___
Python tracker 

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



[issue26293] Embedded zipfile fields dependent on absolute position

2016-05-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, this may be a bug. After appending all offsets are absolute file 
positions. Here is a patch that presumably fixes this issue. Unfortunately I 
can't write tests for this issue. ZipFile is too lenient and all written tests 
are passes with unpatched code. Please test the patch manually.

--
keywords: +patch
stage:  -> patch review
versions: +Python 2.7, Python 3.5
Added file: http://bugs.python.org/file42841/zipfile_concatenated.patch

___
Python tracker 

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



[issue26848] asyncio.subprocess's communicate() method mishandles empty input bytes

2016-05-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 148757a88f19 by Yury Selivanov in branch '3.5':
Issue #26848: Fix asyncio/subprocess.communicate() to handle empty input.
https://hg.python.org/cpython/rev/148757a88f19

New changeset f5e69e2f50d7 by Yury Selivanov in branch 'default':
Merge 3.5 (issue #26848)
https://hg.python.org/cpython/rev/f5e69e2f50d7

--
nosy: +python-dev

___
Python tracker 

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



[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-05-13 Thread Colm Buckley

Colm Buckley added the comment:

See https://lwn.net/Articles/606141/ for an explanation of the blocking 
behavior of getrandom(). This makes sense to me - before the pool has 
initialized, /dev/urandom will be readable but will return highly predictable 
data - ie: it should not be considered safe. In other words, I think that 
getrandom() offers a sensible API.

The only circumstances where we hit the EAGAIN in getrandom() should be when 
it's called extremely early in the boot process (as is the case for the 
systemd-cron generator script I mentioned earlier). I think this is safe 
enough; a more thorough approach would be to flag that the per-process hash 
seed (_Py_HashSecret) is predictable and shouldn't be used.

--

___
Python tracker 

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



[issue27015] subprocess.CalledProcessError's repr changes based on kwargs, and doesn't unpickle

2016-05-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is a problem not only with CalledProcessError, but with all custom 
exceptions with overridden __init__. BaseException.__new__ saves positional 
arguments as the "args" attribute, but ignores keyword arguments. repr() and 
pickle use "args".

--
nosy: +astrand, gregory.p.smith, serhiy.storchaka

___
Python tracker 

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



[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-05-13 Thread Stefan Krah

Changes by Stefan Krah :


--
nosy:  -skrah

___
Python tracker 

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



[issue27010] email library could "recover" from bad mime boundary like (some?) email clients do

2016-05-13 Thread Maciej Szulik

Changes by Maciej Szulik :


--
nosy: +maciej.szulik

___
Python tracker 

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



[issue15786] IDLE code completion window can hang or misbehave with mouse

2016-05-13 Thread paul czyzewski

paul czyzewski added the comment:

hi Tal and Terry,
  
I hadn't noticed that continuing to type does go to the appropriate spot.  
However, I see what I think are two or three bugs (not sure is 'a)' is a bug) 
in the behavior:

  a) on my system it does not visibly filter the list. EG, if I type 'os.', 
wait for the popup, then type ge (so, 'os.ge') it scrolls down to, and selects, 
"get_blocking", but the rest of the list is still there.  
  This is still useful but, Tal, I'm just pointing out that I don't see any 
options disappear (as I think you're saying they should).  Should the list 
really be visibly filtered?

  b) say I want os.get_terminal_size.  I type "os." and wait for the popup to 
appear (see 'c)' for why this is necessary); then I type 'get_t".   Now  
"get_terminal_size" is visible and selected but autocompletion doesn't occur.  
I.E., I still have 'os.get_t" below the popup.  To get the full word I have to 
arrow *away* from the correct answer and then arrow back to it.  Now 
"get_terminal_size" appears below the popup.  This is obviously less serious, 
and less mysterious, than the original hang issue, but it's still a usability 
issue.

  c) Terry: regarding "Box comes up after cntl-space or time delay after key 
char." On my IDLE, the box *never* appears if I initially type beyond the ".".  
E.G.
   import os
   type "os.g" and wait.
  RESULT: the popup never appears.  It will appear if I then do 
"cntl-space" but not from a time delay.  This seems like another biggish 
usability bug.  The time delay should work (as I think you're saying) and 
obviously "cntl-space" isn't something a newbie is likely to know to try.

--

___
Python tracker 

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



[issue21261] Teach IDLE to Autocomplete dictionary keys

2016-05-13 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Thanks.  Being on Windows, I never paid attention to rlcompleter.  The big 
difference is that IDLE completions use IDLE's hyperparser module (which is 
used for other purposes also).  I will look at the tests.

--

___
Python tracker 

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



[issue15786] IDLE code completion window can hang or misbehave with mouse

2016-05-13 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The time delay and popup is only after a key letter, like '.' or '"'.  Having 
the box appear whenever one pauses would be maddening.  I have the delay set to 
.1 second.

The list is not supposed to shrink. Having everything disappear on a typo would 
not seem good to me.  But it might be possible to visually separate remaining 
possibilities, so when only one option (or none) is left, it is visually 
obvious.  Once the overt bugs are fixed, it would not hurt to review details of 
intended behavior, perhaps with some review of other completers.

--

___
Python tracker 

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



[issue15786] IDLE code completion window can hang or misbehave with mouse

2016-05-13 Thread paul czyzewski

paul czyzewski added the comment:

hi Terry,  thanks for all the responses.

Well, what *I* found maddening was that typing  "os." pause "g" works but 
typing  "os.g" (with no pause) does nothing. :)  But, anyway, I guess you're 
saying that that's as designed.


>The list is not supposed to shrink. Having everything disappear on a typo 
>would not seem good to me.

   Actually, I think that many widgets do work that way, but I think that, 
here, I agree with you, since the user might notice a nearby entry which is 
what they wanted.

What about my "b)" (copied just below)?  Is there a reason not to autocomplete 
what's on the command line, as is done if you *arrow* to a selection?  Again, 
not nearly as big an issue as the original hang but I can't think of a reason 
not to autocomplete in this case, and the code to do so must already exist. 

 b) say I want os.get_terminal_size.  I type "os." and wait for the popup to 
appear (see 'c)' for why this is necessary); then I type 'get_t".   Now  
"get_terminal_size" is visible and selected but autocompletion doesn't occur.  
I.E., I still have 'os.get_t" below the popup.  To get the full word I have to 
arrow *away* from the correct answer and then arrow back to it.  Now 
"get_terminal_size" appears below the popup.  This is obviously less serious, 
and less mysterious, than the original hang issue, but it's still a usability 
issue.

--

___
Python tracker 

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



[issue22970] asyncio: Cancelling wait() after notification leaves Condition in an inconsistent state

2016-05-13 Thread Guido van Rossum

Guido van Rossum added the comment:

Yury can you take this on?

--
assignee:  -> yselivanov

___
Python tracker 

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



[issue22970] asyncio: Cancelling wait() after notification leaves Condition in an inconsistent state

2016-05-13 Thread Yury Selivanov

Yury Selivanov added the comment:

OK, I'll see what I can do (this is some code that I don't know/use).

--

___
Python tracker 

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



[issue23749] asyncio missing wrap_socket (starttls)

2016-05-13 Thread Yury Selivanov

Yury Selivanov added the comment:

I'll create a PR on the GitHub for this.  I like the proposed design, and I've 
implemented an SSL test micro-framework that we can use to test starttls in 
asyncio.

--

___
Python tracker 

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



[issue15786] IDLE code completion window can hang or misbehave with mouse

2016-05-13 Thread Terry J. Reedy

Terry J. Reedy added the comment:

When the correct item is highlighted, hit tab once to copy it to the text, hit 
tab a second time to close the box.  If you use the arrow keys to select and 
copy as you go, you still have to hit tab twice to close the box (or click 
elsewhere).

--

___
Python tracker 

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



[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-05-13 Thread STINNER Victor

STINNER Victor added the comment:

Please elaborate the comment in the patch:

- explain that the RNG is not initialized yet with enough entropy
- add a referénce to this issue
- explain that it's a deliberate choice to use weak (non initialized) RNG
for practical reasons

--

___
Python tracker 

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



[issue26870] Unexpected call to readline's add_history in call_readline

2016-05-13 Thread Martin Panter

Martin Panter added the comment:

Thankyou for testing this Meador, it increases my confidence in my code. I’ll 
try to commit this soon if there are no objections.

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



[issue27014] maximum recursion depth when using typing options

2016-05-13 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +gvanrossum

___
Python tracker 

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



[issue15786] IDLE code completion window can hang or misbehave with mouse

2016-05-13 Thread paul czyzewski

paul czyzewski added the comment:

>If you use the arrow keys to select and copy as you go, you still have
> to hit tab twice to close the box (or click elsewhere).

Not for me.  If i use arrow keys then I just type "()" and the box disappears.  
So there's two(?) fewer keystrokes needed if you use the arrow keys.

But anyway, I'll quit looking for additional minor bugs in this thread. :D
thanks
  Paul

--

___
Python tracker 

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



[issue27014] maximum recursion depth when using typing options

2016-05-13 Thread Guido van Rossum

Guido van Rossum added the comment:

Ow, that's bad. :-(

Great job reducing this to a  minimal repro!

I'm guessing it's got to do with registration.  I'll try to figure out how to 
fix it; the fix should appear in Python 3.5.2.

--
assignee:  -> gvanrossum

___
Python tracker 

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



[issue26848] asyncio.subprocess's communicate() method mishandles empty input bytes

2016-05-13 Thread Berker Peksag

Changes by Berker Peksag :


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



[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-05-13 Thread Colm Buckley

Colm Buckley added the comment:

@haypo - new version of patch attached with comments and references per your 
request.

--
Added file: http://bugs.python.org/file42842/getrandom-nonblocking-v2.patch

___
Python tracker 

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



[issue27016] BlockingIOError not raised inside function.

2016-05-13 Thread padraic cunningham

New submission from padraic cunningham:

When the following code snippets are run from two separate shells, the code 
inside the function does not raise any error on the second call while the 
second snippet successfully raises a BlockingIOError on the second run: 


# No error raised.
def func():
lockfile = open('lockfile', 'w')
fcntl.flock(lockfile, fcntl.LOCK_EX | fcntl.LOCK_NB)
input() # no error raised, can be sleep etc..


func()

# Error raised.
lockfile = open('lockfile', 'w')
fcntl.flock(lockfile, fcntl.LOCK_EX | fcntl.LOCK_NB)
input() # no error raised

--
components: IO
messages: 265501
nosy: pcunningha...@gmail.com
priority: normal
severity: normal
status: open
title: BlockingIOError not raised inside function.
type: behavior
versions: Python 3.4

___
Python tracker 

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



[issue27016] BlockingIOError not raised inside function.

2016-05-13 Thread padraic cunningham

padraic cunningham added the comment:

When the following code snippets are run from two separate shells, the code 
inside the function does not raise any error on the second call while the 
second snippet successfully raises a BlockingIOError on the second run: 


# No error raised.
def func():
lockfile = open('lockfile', 'w')
fcntl.flock(lockfile, fcntl.LOCK_EX | fcntl.LOCK_NB)
input() # no error raised, can be sleep etc..


func()

# Error raised.
lockfile = open('lockfile', 'w')
fcntl.flock(lockfile, fcntl.LOCK_EX | fcntl.LOCK_NB)
input()

--

___
Python tracker 

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



[issue27016] BlockingIOError not raised inside function.

2016-05-13 Thread Ned Deily

Ned Deily added the comment:

What platform are you running this on and can you give a more detailed 
procedure for reproducing the problem you see?

--
nosy: +ned.deily

___
Python tracker 

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



[issue26168] Py_BuildValue may leak 'N' arguments on PyTuple_New failure

2016-05-13 Thread Martin Panter

Martin Panter added the comment:

Patch 3 looks good to me

--

___
Python tracker 

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



[issue27017] Python3.5.1: type().startswith()

2016-05-13 Thread Ray

New submission from Ray:

This doesn't look like proper functionality

Python 3.5.1 (v3.5.1:37a07cee5969, Dec  6 2015, 01:54:25) [MSC v.1900 64 
bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> type('')

>>> type('').startswith('s')
Traceback (most recent call last):
  File "", line 1, in 
TypeError: startswith() takes at least 1 argument (0 given)
>>> type('').startswith('s', 's')
True

--
components: Windows
messages: 265505
nosy: VertigoRay, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Python3.5.1: type().startswith()
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