[issue27611] test_tix cannot import _default_root after test_idle

2016-08-15 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
assignee:  -> terry.reedy
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



[issue27611] test_tix cannot import _default_root after test_idle

2016-08-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset cddd633b959f by Terry Jan Reedy in branch '2.7':
Issue #27611: Don't import volatile attribute.
https://hg.python.org/cpython/rev/cddd633b959f

New changeset a4295897 by Terry Jan Reedy in branch '3.5':
Issue #27611: Don't import volatile attribute.
https://hg.python.org/cpython/rev/a4295897

--

___
Python tracker 

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



[issue27771] Add a clear screen button or menu choice for IDLE

2016-08-15 Thread Terry J. Reedy

Terry J. Reedy added the comment:

This is essentially a duplicate of your #17632, which proposed Clear Screen + 
Restart, which was closed as a duplicate of #6143, which has some patches.

--
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> IDLE - an extension to clear the shell window

___
Python tracker 

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



[issue27734] Memory leaks at Python35-32

2016-08-15 Thread Филипп Пономарев

Филипп Пономарев added the comment:

And one more thing.
Is there python version exist without leaks? 
Or all of them have those leaks?
thank you!

--

___
Python tracker 

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



[issue27734] Memory leaks at Python35-32

2016-08-15 Thread Филипп Пономарев

Филипп Пономарев added the comment:

I understand and totally agree, but if u're working on it, can u give me a 
reference to open issue, or should I use Stefan link?
I should report to my сhief :)
After that you can close it immideatly.

--
status: closed -> open

___
Python tracker 

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



[issue6143] IDLE - an extension to clear the shell window

2016-08-15 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Python 3.6 just got a patch to squeeze duplicate traceback lines, as with 
recursion-depth errors.

--

___
Python tracker 

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



[issue27774] Py_DECREF on a non-owned object in _sre

2016-08-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4ca84a3e37d7 by Benjamin Peterson in branch '2.7':
do not decref value borrowed from list (closes #27774)
https://hg.python.org/cpython/rev/4ca84a3e37d7

New changeset cbf2a05648b3 by Benjamin Peterson in branch '3.3':
do not decref value borrowed from list (closes #27774)
https://hg.python.org/cpython/rev/cbf2a05648b3

New changeset 2e404ac88e0e by Benjamin Peterson in branch '3.4':
merge 3.3 (#27774)
https://hg.python.org/cpython/rev/2e404ac88e0e

New changeset 424cb9482974 by Benjamin Peterson in branch '3.5':
merge 3.4 (#27774)
https://hg.python.org/cpython/rev/424cb9482974

New changeset 64b0e0a29874 by Benjamin Peterson in branch 'default':
merge 3.5 (#27774)
https://hg.python.org/cpython/rev/64b0e0a29874

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



[issue26331] Tokenizer: allow underscores for grouping in numeric literals

2016-08-15 Thread Georg Brandl

Georg Brandl added the comment:

@Serhiy/anyone: can I get another review, so that we can commit this in time 
for beta? Thanks!

--

___
Python tracker 

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



[issue12916] Add inspect.splitdoc

2016-08-15 Thread Ben Finney

Ben Finney added the comment:

Am I right that this:

> pydoc doesn't have public API other than its CLI and the help() function.
> […] On the other hand, there are already functions related to splitdoc()
> in the inspect module […].

> There is no rush to make splitdoc() public. We can improve pydoc in 3.5
> and 3.6 timeline and then decide what's should be part of the public API.

represents the latest on this issue?

We now have the alpha phase of Python 3.6. Can we get a resolution that makes 
‘splitdoc’ public somewhere?

--

___
Python tracker 

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



[issue27774] Py_DECREF on a non-owned object in _sre

2016-08-15 Thread Benjamin Peterson

New submission from Benjamin Peterson:

Thomas E Hybel reports:

This vulnerability exists in the function _sre_SRE_Match_groupdict_impl which
resides in the /Modules/_sre.c file.

The problem is that the code calls Py_DECREF(key); without having done a
corresponding Py_INCREF on the key.

Here's the relevant code:

static PyObject *
_sre_SRE_Match_groupdict_impl(MatchObject *self, PyObject *default_value)
{
...
for (index = 0; index < PyList_GET_SIZE(keys); index++) {
...
PyObject* key;
...
key = PyList_GET_ITEM(keys, index);
...
value = match_getslice(self, key, default_value);
if (!value) {
Py_DECREF(key);
goto failed;
}
...
}
...
}

We initialize the "key" variable via PyList_GET_ITEM(keys, index) which simply
takes keys->ob_item[index]. There is no increase in reference count.

If match_getslice fails, we then call Py_DECREF(key). This is simply wrong. It
will result in the key object getting freed prematurely, leading to
use-after-free scenarios.

Here's a script which reproduces this:

--- begin script ---

import _sre
import time

p = _sre.compile(
"A",# pattern
0,  # flags
[1],# code
1,  # groups
{0xdeadbeef: 0},# groupindex
0   # indexgroup
)  

m = p.match("")

for _ in range(5):
# each call to m.groupdict decreases the refcount of 0xdeadbeef once
try:
m.groupdict()
except IndexError:
pass
   
--- end script ---

Running the script crashes python on my machine:

(gdb) r ./poc7.py
Starting program: /home/xx/Python-3.5.2/python ./poc7.py

Program received signal SIGSEGV, Segmentation fault.
0x00567d71 in match_getindex (self=self@entry=0x77e2da18, 
index=index@entry=0x76d582c0)
at ./Modules/_sre.c:2055
2055if (PyLong_Check(index))
(gdb) bt
#0  0x00567d71 in match_getindex (self=self@entry=0x77e2da18, 
index=index@entry=0x76d582c0)
at ./Modules/_sre.c:2055
#1  0x00568946 in match_getslice (self=self@entry=0x77e2da18, 
index=index@entry=0x76d582c0,
def=def@entry=0x8831c0 <_Py_NoneStruct>) at ./Modules/_sre.c:2076
#2  0x00568a99 in _sre_SRE_Match_groupdict_impl 
(self=self@entry=0x77e2da18,
default_value=0x8831c0 <_Py_NoneStruct>) at ./Modules/_sre.c:2198
#3  0x00568bc5 in _sre_SRE_Match_groupdict (self=0x77e2da18, 
args=,
kwargs=) at ./Modules/clinic/_sre.c.h:518

--
messages: 272831
nosy: benjamin.peterson
priority: normal
severity: normal
status: open
title: Py_DECREF on a non-owned object in _sre
type: security
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



[issue27773] Excessive Py_XDECREF in the ssl module:

2016-08-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 98c86d5a6655 by Benjamin Peterson in branch '3.5':
fix corner cases in the management of server_hostname (closes #27773)
https://hg.python.org/cpython/rev/98c86d5a6655

New changeset a8cd67e80ed3 by Benjamin Peterson in branch 'default':
merge 3.5 (#27773)
https://hg.python.org/cpython/rev/a8cd67e80ed3

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



[issue27773] Excessive Py_XDECREF in the ssl module:

2016-08-15 Thread Benjamin Peterson

New submission from Benjamin Peterson:

Thomas E. Hybel reports:

This vulnerability exists in the function newPySSLSocket in /Modules/_ssl.c. The
problem is that Py_XDECREF is called on an object, self->server_hostname, which
isn't owned anymore.

The code looks like this:

static PySSLSocket *
newPySSLSocket(PySSLContext *sslctx, PySocketSockObject *sock,
   enum py_ssl_server_or_client socket_type,
   char *server_hostname,
   PySSLMemoryBIO *inbio, PySSLMemoryBIO *outbio)
{
PySSLSocket *self;
...
if (server_hostname != NULL) {
hostname = PyUnicode_Decode(server_hostname, 
strlen(server_hostname),
   "idna", "strict");
...
self->server_hostname = hostname;
}
...
if (sock != NULL) {
self->Socket = PyWeakref_NewRef((PyObject *) sock, NULL);
if (self->Socket == NULL) {
Py_DECREF(self);
Py_XDECREF(self->server_hostname);
return NULL;
}
}
}

We're initializing the "self" variable. If a hostname was given as an argument,
we call PyUnicode_Decode to initialize self->server_hostname = hostname. At this
point both "self" and "self->server_hostname" have a reference count of 1.

Later on we set self->Socket to be a new weakref. However if the call to
PyWeakref_NewRef fails (the object cannot be weakly referenced) then we run
Py_DECREF(self). Since the reference count of "self" drops to 0, PySSL_dealloc
is called, which runs this line:

Py_XDECREF(self->server_hostname);

Now self->server_hostname's refcount drops to 0 and it is freed.

Then, back in newPySSLSocket, we run Py_XDECREF(self->server_hostname); which is
inappropriate both because "self" is now freed, and because
self->server_hostname's refcount was already dropped in PySSL_dealloc.

So this can be seen either as a use-after-free or as a double free
vulnerability.


Here's a reproducer:

--- begin script ---

import ssl, socket, _socket

s = ssl.wrap_socket(socket.socket(socket.AF_INET, socket.SOCK_STREAM))
s.context._wrap_socket(_socket.socket(), server_side=1)

--- end script ---

On my machine (Python-3.5.2, 64-bits, --with-pydebug) it crashes:

(gdb) r ./poc8.py
Starting program: /home/xx/Python-3.5.2/python ./poc8.py

Program received signal SIGSEGV, Segmentation fault.
0x767f7d9c in newPySSLSocket (sslctx=sslctx@entry=0x75ed15f8, 
sock=sock@entry=0x77e31dc0,
socket_type=socket_type@entry=PY_SSL_SERVER, server_hostname=, inbio=inbio@entry=0x0, outbio=outbio@entry=0x0)
at /home/xx/Python-3.5.2/Modules/_ssl.c:562
562Py_XDECREF(self->server_hostname);
(gdb) p self->server_hostname
$14 = (PyObject *) 0xdbdbdbdbdbdbdbdb


I believe this should be fixed by simply removing the line
"Py_XDECREF(self->server_hostname);"



While fixing this, you might want to fix another issue in newPySSLSocket which
I'll describe next.

The separate problem lies here:

if (server_hostname != NULL) {
hostname = PyUnicode_Decode(server_hostname, strlen(server_hostname),
   "idna", "strict");
if (hostname == NULL) {
Py_DECREF(self);
return NULL;
}
self->server_hostname = hostname;
}

As we can see, PyUnicode_Decode is called. If PyUnicode_Decode fails, we call
Py_DECREF(self). However the field self->server_hostname is an uninitialized
variable at this point! So the code in PySSL_dealloc which calls
Py_XDECREF(self->server_hostname) could actually be working with an arbitrary,
uninitialized pointer.

Technically this is a separate vulnerability from the first, but I couldn't find
a way to trigger it other than low-memory situations which aren't very
reliable.

This could be fixed by initializing self->server_hostname to NULL before calling
Py_DECREF(self).

--
messages: 272829
nosy: benjamin.peterson
priority: normal
severity: normal
status: open
title: Excessive Py_XDECREF in the ssl module:
type: crash
versions: 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



[issue27772] Refer to actual format string when creating “zero padding” error message

2016-08-15 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +eric.smith
versions: +Python 3.6 -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



[issue15660] Clarify 0 prefix for width specifier in str.format doc,

2016-08-15 Thread Ben Finney

Ben Finney added the comment:

Terry Reedy wrote:

> If the spec string is still available, it could be searched and the message 
> adjusted if '=' is not present.  That proposal should be a new issue if 
> someone wants to push it.

Done now, see Issue 27772.

--
nosy: +bignose

___
Python tracker 

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



[issue27772] Refer to actual format string when creating “zero padding” error message

2016-08-15 Thread Ben Finney

New submission from Ben Finney:

When using a format specifier with leading zero, the format spec mini-language 
(as documented at 
https://docs.python.org/3/library/string.html#format-specification-mini-language>)
 says:

> '=' […] becomes the default when ‘0’ immediately precedes the field width.

When the ‘=’ option is only implied, the error message “ValueError: '=' 
alignment not allowed in string format specifier” becomes surprising and 
incomprehensible to someone who does not know that implied behaviour.

In issue 15560, Terry Reedy says:

> If the spec string is still available, it could be searched and the message 
> adjusted if '=' is not present.  That proposal should be a new issue if 
> someone wants to push it.

This issue raises that proposal.

The error message should be changed so that:

* It makes sense whether or not the ‘=’ option is explicit in the format 
specifier.

Or:

* Different messages are produced when the ‘=’ option is explicit versus when 
it is implicit.

I think the former option is better, but either will satisfy this request.

--
messages: 272827
nosy: bignose
priority: normal
severity: normal
status: open
title: Refer to actual format string when creating “zero padding” error message
versions: Python 2.7, Python 3.2, Python 3.3, 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



[issue27771] Add a clear screen button or menu choice for IDLE

2016-08-15 Thread Raymond Hettinger

New submission from Raymond Hettinger:

Learners in my classes commonly request this feature.  Beyond just providing a 
cosmetic clean-up, this would be useful for recovering from IDLE's catastrophic 
slow-downs after trying to print a very wide line (i.e. the repr of a string 
containing a full webpage or text file, see http://bugs.python.org/issue1442493 
).

--
assignee: terry.reedy
components: IDLE
keywords: easy
messages: 272826
nosy: rhettinger, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: Add a clear screen button or menu choice for IDLE
type: enhancement
versions: Python 3.6

___
Python tracker 

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



[issue27736] repeated Py_Initialize/PyRun_SimpleString/Py_Finalize segfaults

2016-08-15 Thread Ned Deily

Ned Deily added the comment:

Excellent!  Thanks for digging into that.  Increasing the iterations seems to 
work fine within the (understandable) limitations of the existing embedded 
tests, e.g. only work from a source tree build (not an installed build nor from 
a separate build directory) etc.  Case closed.

--
resolution:  -> fixed
stage: test needed -> 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



[issue27736] repeated Py_Initialize/PyRun_SimpleString/Py_Finalize segfaults

2016-08-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4f69626fd923 by Ned Deily in branch 'default':
Issue #27736: Improve the existing embedded interpreter init/fini test
https://hg.python.org/cpython/rev/4f69626fd923

--

___
Python tracker 

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



[issue27611] test_tix cannot import _default_root after test_idle

2016-08-15 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Ned Deily noticed the same problem when running with test.regrtest #27714.

I cannot reproduce this issue when running both tests either with unittest or 
test.regrtest.

F:\Python\dev>36\pcbuild\win32\python_d.exe -m unittest test.test_tix 
test.test_idle test.test_tix
.
--
Ran 221 tests in 3.959s

OK
F:\Python\dev>36\pcbuild\win32\python_d.exe -m test -ugui test_tix test_idle 
test_tix
Run tests sequentially
0:00:00 [1/3] test_tix
0:00:00 [2/3] test_idle
0:00:03 [3/3] test_tix
All 3 tests OK.
 if __name__ == '__main__':
 unittest.main(verbosity=2, exit=False)
+tk._support_default_root = 1
+tk._default_root = None

Zach, I don't know of any way to get either unittest or test.regrtest to run 
anything in test_idle after it runs the test collector *and* the tests.  Do you?

The addition of tk.NoDefaultRoot() to both IDLE and its tests was suggested by 
Serhiy in #24137.  Doing so exposed several issues in htests but no real bugs 
in IDLE itself. My patch to restore tkinter module only works when test_idle is 
run as main.  So as far as that patch goes, tkinter should only changed when 
the test is run as main.  I will move the call.  I have already changed my 
check script to run test_idle this way.

Otherwise, the easiest way to leave tkinter as it was when testing ends is to 
not change it.  I am aware that tkinter tests avoid the  by defining a mixin 
class with class methods that call and undo the call.  It is used in 11 test 
classes within the tkinter and ttk tests.  However, this refactoring would be 
harder to apply to IDLE tests and not sufficient in itself.  It is at best a 
future project.

I added a guard to IDLE's NoDefaultRoot call for when pyshell.main is broken 
into multiple testable functions.

--

___
Python tracker 

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



[issue27611] test_tix cannot import _default_root after test_idle

2016-08-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a6a248479b66 by Terry Jan Reedy in branch 'default':
Issue #27611, #24137: Only change tkinter when easily restored.
https://hg.python.org/cpython/rev/a6a248479b66

--

___
Python tracker 

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



[issue24137] Force not using _default_root in IDLE

2016-08-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a6a248479b66 by Terry Jan Reedy in branch 'default':
Issue #27611, #24137: Only change tkinter when easily restored.
https://hg.python.org/cpython/rev/a6a248479b66

--

___
Python tracker 

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



[issue27736] repeated Py_Initialize/PyRun_SimpleString/Py_Finalize segfaults

2016-08-15 Thread Xiang Zhang

Xiang Zhang added the comment:

We don't have to change Lib/test/test_capi.py. It has already got a repeated 
init and fini test[1]. All we need to do is increase the loop number[2]. I have 
tried with 15, the test case fails reliably. And with the previous patch 
applied, it won't fail.

[1] https://hg.python.org/cpython/file/tip/Lib/test/test_capi.py#l386
[2] https://hg.python.org/cpython/file/tip/Programs/_testembed.c#l44

--

___
Python tracker 

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



[issue27714] some test_idle tests are not re-runnable, producing false failures with regrtest -w option

2016-08-15 Thread Ned Deily

Ned Deily added the comment:

"Ned, test_tix failing on some systems [...]"

Sorry, Terry! I had forgotten about Issue27611 and didn't do a proper search.

--

___
Python tracker 

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



[issue27767] Receive "A required privilege is not held by the Client" error message when Installing python on Windows 10 64 bit

2016-08-15 Thread Emanuel Barry

Changes by Emanuel Barry :


--
resolution:  -> not a bug
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



[issue27767] Receive "A required privilege is not held by the Client" error message when Installing python on Windows 10 64 bit

2016-08-15 Thread Ron Carr

Ron Carr added the comment:

Hi Nosy and Brett,

I worked it out, even though I turned off the virus checker it was still in
memory. I had to right click on the install file, then select allow
install, it then completed successfully.

Regards,

Ron

On Tue, Aug 16, 2016 at 2:44 AM, Brett Cannon 
wrote:

>
> Brett Cannon added the comment:
>
> 1. Is this pre- or post-Anniversary update?
>
> 2. Is the PC administered by anyone other than yourself (e.g. is it a work
> machine)?
>
> 3. Are you trying to do a system-wide install or a personal install?
>
> 4. For at least Python 3.5 the installer does work as I have done it
> myself multiple times.
>
> --
> nosy: +brett.cannon
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue27756] Add pyd icon for 3.6

2016-08-15 Thread Steve Dower

Steve Dower added the comment:

Can't promise there'll be a rocket, but the launcher icon will certainly be 
different from the source file icon.

--

___
Python tracker 

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



[issue27714] some test_idle tests are not re-runnable, producing false failures with regrtest -w option

2016-08-15 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Ned, test_tix failing on some systems (but not Windows) after test_idle, 
because test_idle calls tk.NoDefaultRoot() (added June 21 in #24137) is #27611. 
 Serhiy says there is a bug in tix, but no one has fix that yet.  Zach says I 
should restore tkinter module.  I will probably revert changing it in the first 
place except when running test_idle alone as main.

--

___
Python tracker 

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



[issue27756] Add pyd icon for 3.6

2016-08-15 Thread Eryk Sun

Eryk Sun added the comment:

> Maybe it's time for a whole new set :)

Please keep a rocket in the upper left-hand corner for the launcher icon. It 
distinguishes the launcher from other "Python" apps when modifying the shell's 
file association, since the shell doesn't show the command-line template to the 
user. Of course, it would also help if the description in py.exe were changed 
to "Python Launcher" instead of just "Python".

--
nosy: +eryksun

___
Python tracker 

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



[issue26823] Shrink recursive tracebacks

2016-08-15 Thread Nick Coghlan

Changes by Nick Coghlan :


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



[issue26823] Shrink recursive tracebacks

2016-08-15 Thread Nick Coghlan

Nick Coghlan added the comment:

Thanks again Emanuel - I incorporated your suggested changes along with some 
other ones I had already made locally.

--

___
Python tracker 

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



[issue27756] Add pyd icon for 3.6

2016-08-15 Thread Steve Dower

Steve Dower added the comment:

It's certainly very easy to add an icon for pyd files. The tricky part is 
getting an icon we can redistribute - fairly sure one derived from a Windows 
icon is not redistributable.

Let me see if I can get one of the designers at work to put something together. 
Maybe it's time for a whole new set :)

--

___
Python tracker 

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



[issue26823] Shrink recursive tracebacks

2016-08-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 86d062edb6ab by Nick Coghlan in branch 'default':
Issue #26823: fix traceback abbreviation docs
https://hg.python.org/cpython/rev/86d062edb6ab

--

___
Python tracker 

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



[issue27770] remove run_until_complete

2016-08-15 Thread Guido van Rossum

Guido van Rossum added the comment:

This sounds like you're overreacting -- just because you were bit by some code 
that used run_until_complete() incorrectly that doesn't mean we should break 
everybody's code that is using it (most I'm sure are using it correctly).

If you want help understanding what went wrong, use the 
python-tu...@googlegroups.com mailing list.

--
resolution:  -> wont fix
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



[issue27038] Make os.DirEntry exist

2016-08-15 Thread Brendan Moloney

Brendan Moloney added the comment:

The functions were all written around DirEntry objects since that is what they 
will be processing 99% of the time and I want to do that as efficiently as 
possible. Converting a DirEntry object into a str representation doesn't help 
me with my use case at all. I want to be able to do it the other way around: 
str -> DirEntry

--

___
Python tracker 

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



[issue27770] remove run_until_complete

2016-08-15 Thread Decorater

New submission from Decorater:

I use a library that uses run_until_complete that is used for HTTP connections. 
However it does not work well when you want to reconnect anything that makes it 
start via recursion. So, I am suggesting the removal of run_until_complete and 
then tell everyone that uses it to replace their code that had it with 
run_forever.
( and to have their start function to create a event loop so that way if the 
loop is closed recursing to restart it after closed would make it not throw a 
RuntimeError)

run_forever seems to be almost exactly alike run_until_complete except it can 
run forever.

Pros with removing run_until_complete:
+ A lot easier to handle.
+ No pain from run_until_complete.
+ Cleanup some *code* in asyncio.
+ Helps with heavy http load for reconnecting websockets if they use 
run_forever instead.

Cons:
- Existing code from libs or anyone that uses run_until_complete will break.
- run_forever can still throw a RuntimeError if you try to use run_forever 
after closing a event loop.
- Event Loop would have to be recreated or reopened after being closed.

--
components: asyncio
messages: 272809
nosy: Decorater, gvanrossum, haypo, yselivanov
priority: normal
severity: normal
status: open
title: remove run_until_complete
type: enhancement
versions: Python 3.6

___
Python tracker 

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



[issue27038] Make os.DirEntry exist

2016-08-15 Thread Brett Cannon

Brett Cannon added the comment:

If all you want is to extract the path representation from an os.DirEntry 
instance and continue to work with strings/bytes then you can use os.fspath() 
which is new in Python 3.6 to get the representation: 
https://docs.python.org/3.6/library/os.html#os.fspath .

--

___
Python tracker 

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



[issue27181] Add geometric mean to `statistics` module

2016-08-15 Thread Ned Deily

Ned Deily added the comment:

FTR, multiple platforms are failing in various ways, not just PPC64, so 
Issue27761 was expanded to cover them and has been marked as a "release 
blocker".

--
nosy: +ned.deily

___
Python tracker 

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



[issue27761] Private _nth_root function loses accuracy

2016-08-15 Thread Ned Deily

Ned Deily added the comment:

Since test_NTh_Root is failing on so many different buildbot platforms and in 
different ways, I'm marking this as a "release blocker".  It would be very 
helpful to get this resolved prior to 3.6.0b1 next month.  Suggest checking the 
test results outputs of the various 3x build slaves to ensure all the cases 
have been addressed.

https://www.python.org/dev/buildbot/

--
nosy: +ned.deily
priority: normal -> release blocker
stage:  -> needs patch

___
Python tracker 

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



[issue27714] some test_idle tests are not re-runnable, producing false failures with regrtest -w option

2016-08-15 Thread Ned Deily

Ned Deily added the comment:

I just noticed another similar test dependency, this time between test_idle and 
test_tix.  If run with -j set, the problem is not seen.  This is still present 
in 3.6.0a4:

$ python3.6 -m test -uall -w test_idle test_tix
Run tests sequentially
0:00:00 [1/2] test_idle
can't invoke "event" command:  application has been destroyed
while executing
"event generate $w <>"
(procedure "ttk::ThemeChanged" line 6)
invoked from within
"ttk::ThemeChanged"
0:00:02 [2/2] test_tix
test test_tix crashed -- Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/test/libregrtest/runtest.py",
 line 167, in runtest_inner
the_module = importlib.import_module(abstest)
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/importlib/__init__.py",
 line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 996, in _gcd_import
  File "", line 979, in _find_and_load
  File "", line 968, in _find_and_load_unlocked
  File "", line 673, in _load_unlocked
  File "", line 667, in exec_module
  File "", line 222, in _call_with_frames_removed
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/test/test_tix.py",
 line 11, in 
from tkinter import tix, TclError
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/tkinter/tix.py",
 line 30, in 
from tkinter import _cnfmerge, _default_root
ImportError: cannot import name '_default_root'

test_tix failed
1 test OK.
1 test failed:
test_tix
Re-running failed tests in verbose mode
Re-running test 'test_tix' in verbose mode
test test_tix crashed -- Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/test/libregrtest/runtest.py",
 line 167, in runtest_inner
the_module = importlib.import_module(abstest)
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/importlib/__init__.py",
 line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 996, in _gcd_import
  File "", line 979, in _find_and_load
  File "", line 968, in _find_and_load_unlocked
  File "", line 673, in _load_unlocked
  File "", line 667, in exec_module
  File "", line 222, in _call_with_frames_removed
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/test/test_tix.py",
 line 11, in 
from tkinter import tix, TclError
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/tkinter/tix.py",
 line 30, in 
from tkinter import _cnfmerge, _default_root
ImportError: cannot import name '_default_root'

1 test failed again:
test_tix
Total duration: 0:00:03

--

___
Python tracker 

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



[issue27038] Make os.DirEntry exist

2016-08-15 Thread Brendan Moloney

Brendan Moloney added the comment:

The pathlib Path class is different enough from the DirEntry class that it 
doesn't really help my goal of allowing a function to work with either a 
DirEntry or a plain (str) path.

These functions are going to be working with DirEntry objects generated by 
scandir 99% of the time so that we can leverage the improved performance, but I 
want to allow users to pass in plain paths as well. If the stdlib doesn't allow 
me to create my own DirEntry object from a plain path I will probably end up 
creating some sort of FakeDirEntry class that mimics a DirEntry, and that seems 
a bit silly and not a great use of time and effort.

If the constructor currently "requires low-level data coming from
readdir() or FindFirstFile()" then why not a class method that just takes a 
path and calls stat on it? You could document the fact that it calls stat and 
that it doesn't have any of the performance benefits of using scandir. 
Consenting adults and all that...

--

___
Python tracker 

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



[issue27723] Document typing.Text and typing.AnyStr

2016-08-15 Thread Guido van Rossum

Guido van Rossum added the comment:

Committed and merged to 3.6.

changeset:   102670:d5872d0863c8
branch:  3.5
parent:  102663:27a99a722828
user:Guido van Rossum 
date:Mon Aug 15 15:06:38 2016 -0700
summary: Add docs for typing.AnyStr and typing.Text. By Michael Lee.

changeset:   102672:705416c5909e
tag: tip
parent:  102671:247ecbae325c
parent:  102670:d5872d0863c8
user:Guido van Rossum 
date:Mon Aug 15 15:08:11 2016 -0700
summary: Add docs for typing.AnyStr and typing.Text. By Michael Lee. (Merge 
3.5->3.6)

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



[issue12345] Add math.tau

2016-08-15 Thread Guido van Rossum

Guido van Rossum added the comment:

Thanks, fixed.

--

___
Python tracker 

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



[issue25958] Implicit ABCs have no means of "anti-registration"

2016-08-15 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

Oops, sorry, forgot one import, all tests pass with the corrected patch.

--
Added file: http://bugs.python.org/file44123/abarnert_rebased2.diff

___
Python tracker 

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



[issue25958] Implicit ABCs have no means of "anti-registration"

2016-08-15 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

I have manually "rebased" the patch taking into account that part of the work 
has been done in http://bugs.python.org/issue25987

Serhiy, Martin could you please review the latest patch and check that 
everything is OK?

Andrew did a really good job and I would like this to land in 3.6

--
Added file: http://bugs.python.org/file44122/abarnert_rebased.diff

___
Python tracker 

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



[issue23591] Add Flags and IntFlags

2016-08-15 Thread Ethan Furman

Ethan Furman added the comment:

The values used in Flags are an implementation detail.  The expected, and 
supported, use is naming the flags:

class Color(Flags):
Red, Green, Blue

even custom names can be set using this method:

>>> class Color(enum.Flags):
...   red, green, blue
...   black = red & green & blue
... 
>>> list(Color)
[, , , ]

>>> class Color(enum.Flags):
...   red, green, blue
...   purple = red | blue
... 
>>> list(Color)
[, , , ]
>>> Color(5)

>>> Color(3)


I'll have to think about ensuring each bit is named -- it's only a (potential) 
problem if the values are specified manually.

--

___
Python tracker 

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



[issue23591] Add Flags and IntFlags

2016-08-15 Thread Vedran Čačić

Vedran Čačić added the comment:

I suppose you'll also forbid adding new members to Flags, just like Enum does, 
right? 
(https://docs.python.org/3/library/enum.html#restricted-subclassing-of-enumerations)
 Otherwise cropping -1 at a fixed number of bits might be very counterintuitive.

But still, your "simple algorithm" seems too simple. You might easily produce 
values you won't be able to interpret.

class ThirdBitMustBeSet(Flags):
FIRST = 5
SECOND = 6

>>> ThirdBitMustBeSet.FIRST | ThirdBitMustBeSet.SECOND

produces error when printing, but otherwise works completely fine. A debugging 
nightmare. :-/ I'd at least ensure each bit has a separate name if you're going 
to use that scheme.

--

___
Python tracker 

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



[issue23591] Add Flags and IntFlags

2016-08-15 Thread Ethan Furman

Ethan Furman added the comment:

'.0' does not have a name unless the user defines it; similarly, '.-1' does not 
have a name unless the user defines it.

For Flags, negative numbers are supported in order to specify which flags are 
desired, but the final representation will be zero or positive:

>>> class Hah(enum.Flags):
...   this, that, these, those, thuse
... 
>>> Hah(0)

>>> Hah(-1)


The algorithm is simple: start with the biggest Flag and mask off matching bits 
until all bits are are matched.  If any unmatched bits remain an error is 
raised.

If a user does horrible things like your Weird class then any breakage is on 
them.

As it stands, Weird(7) would be , and if A was not defined an 
error would be raised.

--

___
Python tracker 

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



[issue23591] Add Flags and IntFlags

2016-08-15 Thread Vedran Čačić

Vedran Čačić added the comment:

I think I have written about all the options in detail in 
http://bugs.python.org/msg272732. If I see it right, your ".0" corresponds to 
what I called ".__NONE__". It is a "right way" to do it, but for it to be 
complete, you also have to add ".__ALL__", representing -1, as its complement. 
If you do both of these, I'm fine with it, and we can discuss further 
problems... :-)

... like inverting representation. If you have non-powers of 2 named, how do 
you know which exact flags a value consists of?

class Weird(Flags):
AB = 3
C = 4
BC = 6
A = 1

what is Weird(7)? Weird.(AB|C) or Weird.(A|BC)? What if you don't have C (or A) 
as a name? Are you going to employ a minimal exact cover algorithm? :-O

--

___
Python tracker 

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



[issue23591] Add Flags and IntFlags

2016-08-15 Thread Ethan Furman

Ethan Furman added the comment:

The zero value is special in that it represents a flag with nothing set.  
Excluding it has its own problems, but if you have an argument for that 
behavior I'm listening.

Any other non-Flag value is not allowed, and will raise an error (IntFlags 
won't share this behavior).

--

___
Python tracker 

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



[issue27736] repeated Py_Initialize/PyRun_SimpleString/Py_Finalize segfaults

2016-08-15 Thread Ned Deily

Ned Deily added the comment:

I've applied the patch for 3.6.0a4 so the immediate issue is fixed.  I wonder 
if it would be worthwhile adapting Simon's test case to add to the embedding 
test cases in Lib/test/test_capi.py.  I'm going to leave the issue open for a 
while in case someone is interested in doing that.

--
assignee: ned.deily -> 
priority: release blocker -> 
stage: commit review -> test needed

___
Python tracker 

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



[issue23591] Add Flags and IntFlags

2016-08-15 Thread Vedran Čačić

Vedran Čačić added the comment:

So, in fact, your Flags are simply an overlayed namespace over int (the way to 
give some ints sticky names), and any int is accessible from any Flags, no 
matter whether it has a name or not? I must say that to me it seems radically 
different than (Int)Enum philosophy.

class MyIntEnum(IntEnum):
A = 1

>>> MyIntEnum(0)
ValueError: 0 is not a valid MyIntEnum

So, flags are not enums, nor they share the same principles (identity, 
exclusiveness). Why are they in the enum module at all?

--

___
Python tracker 

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



[issue27769] IDLE: Replace All up, no wrap replaces one up, all down

2016-08-15 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Edited title to fit in the box.  Minimal reproducer, which can become a test.  
File as follows, where '|' represent the cursor, not the character.

a
a|
a

Cntl-H, enter search for 'a', replace with 'b', check 'up', uncheck 'wrap', 
click Replace All.  Result matches what you said.

a
b
b

Thanks for the report. This is definitely a bug.  In the future, try to post a 
minimal example, such as the above, as well as a description.   Whether I 
backport a fix depends on how easy it would be.

--
stage:  -> needs patch
title: IDLE's "Replace All" with up direction and no wrapping replaces one 
upward and all downward entries instead of replacing all upward entries. -> 
IDLE: Replace All up, no wrap replaces one up, all down
versions: +Python 3.6 -Python 3.5

___
Python tracker 

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



[issue27736] repeated Py_Initialize/PyRun_SimpleString/Py_Finalize segfaults

2016-08-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a95d98086621 by Ned Deily in branch 'default':
Issue #27736: Prevent segfault after interpreter re-initialization due
https://hg.python.org/cpython/rev/a95d98086621

--
nosy: +python-dev

___
Python tracker 

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



[issue27038] Make os.DirEntry exist

2016-08-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a95d98086621 by Ned Deily in branch 'default':
Issue #27736: Prevent segfault after interpreter re-initialization due
https://hg.python.org/cpython/rev/a95d98086621

--

___
Python tracker 

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



[issue23968] rename the platform directory from plat-$(MACHDEP) to plat-$(PLATFORM_TRIPLET)

2016-08-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ddc4bdae5e41 by Ned Deily in branch 'default':
Issue #23968: Make OS X installer build script aware of renamed platform
https://hg.python.org/cpython/rev/ddc4bdae5e41

--

___
Python tracker 

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



[issue23591] Add Flags and IntFlags

2016-08-15 Thread Ethan Furman

Ethan Furman added the comment:

Serhiy's patch is only for IntFlags, and my patch hasn't yet fully incorporated 
his (many thanks for decompose!)

For IntFlags I do not expect to have very many instances alive at once, 
especially since not-bitwise operators will lose the IntFlag class and become 
plain ints.

Flags are closed.  If the zero value is not specified the repr and str are:

>>> Hah(0)

>>> str(Hah(0))
'Hah.0'

(An RGB class might be:  )

A question I have about IntFlags:

If a third-party lib specifies that certain bits are reserved and should always 
be zero (or at least not changed), do we want to add some easy support for that?

--

___
Python tracker 

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



[issue1442493] IDLE shell window gets very slow when displaying long lines

2016-08-15 Thread Terry J. Reedy

Terry J. Reedy added the comment:

manual_wrap.patch patches OutputWindow (2.7) to arbitrarily and blindly wrap at 
80 chars.  OutputWindow is used directly for grep output, as well as the base 
for PyShell.  The grep output format is currently "'{}: {}: 
{}'.format(filepath, linenum, codeline)".  Output lines are typically (for me) 
> 80 chars and I would not want a fixed-column wrap.  With a right click, one 
can go to the file and line and this should not be disabled.  Ditto for 
tracebacks, where code lines are pre-wrapped (with an added indent) onto a 
second physical line. Wrap at 80 would wrap lines that were originally 80 
before having the traceback indent added.  Autowrap should only be applied to 
user stdout sent to Shell.

Perhaps wrapping should have a window (80-100?) within which we look for a 
space.  I have about concluded that we should add horizontal scrollbars anyway, 
since Python and IDLE output lines longer than 80 chars.

To evaluate the patch further, I want to look at how the socket stream is being 
read.

As long as we are modifying user output before inserting into the text widget, 
astral chars should be expanded into their unicode escapes. (There are multiple 
issue for astral chars.  Tk 8.7 reportedly will handle them.) The replacement 
text should be tagged and colored as such.  Wrapping should not break 
replacements.  The same could be done for control chars to make them visible.  
(Astral char handling is needed for paths also!).

--

___
Python tracker 

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



[issue26415] Excessive peak memory consumption by the Python parser

2016-08-15 Thread A. Skrobov

A. Skrobov added the comment:

Xavier, the big picture description of my patch is in 
http://bugs.python.org/file43665/devguide_patch

The heap fragmentation was observed by Victor, not by myself.

Victor, could you please create a new ticket for your python_memleak.py 
reproducer?

--

___
Python tracker 

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



[issue18844] allow weights in random.choice

2016-08-15 Thread Raymond Hettinger

Raymond Hettinger added the comment:

FWIW, I have four full days set aside for the upcoming pre-feature release 
sprint which is dedicated to taking time to thoughtfully evaluate pending 
feature requests.  In the meantime, I'm contacting Alan Downey for a 
consultation for the best API for this.  As mentioned previously, the generator 
version isn't compatible with the design of the rest of the module that allows 
streams to have their state saved and restored at arbitrary points in the 
sequence.  One API would be to create a list all at once (like random.sample 
does).  Another would be to have two steps (like str.maketrans and 
str.translate).  Ideally, the API should integrate neatly with 
collections.Counter as a possible input for the weighting.  Hopefully, Alan can 
also comment on the relative frequency of small integer weightings versus the 
general case (the former benefits from a design using random.choice() applied 
to Counter.elements() and the latter benefits from a design with accumulate() 
and bisect()).  Note, this
  is a low priority feature (no real demonstrated need, there is already a 
recipe for it in the docs, and once the best API have been determined, the code 
is so simple that any of us could implement it in only a few minutes).

--

___
Python tracker 

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



[issue27761] Private _nth_root function loses accuracy

2016-08-15 Thread Mark Dickinson

Mark Dickinson added the comment:

> for positive finite floats

... assuming IEEE 754 binary64 format, of course.

--

___
Python tracker 

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



[issue27723] Document typing.Text and typing.AnyStr

2016-08-15 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

Looks good to me.
15 Сер 2016 18:57 "Michael Lee"  пише:

>
> Michael Lee added the comment:
>
> Second revision attached below.
>
> --
> Added file: http://bugs.python.org/file44121/document-text-and-
> anystr-2.patch
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue27761] Private _nth_root function loses accuracy

2016-08-15 Thread Mark Dickinson

Mark Dickinson added the comment:

Just for fun, here's a recipe for a correctly-rounded nth root operation for 
positive finite floats. I'm not suggesting using this in the business logic: 
it's likely way too slow (especially for large n), but it may have a use in the 
tests. The logic for the Newton iteration in floor_nroot follows that outlined 
in this Stack Overflow answer: http://stackoverflow.com/a/35276426

from math import frexp, ldexp

def floor_nroot(x, n):
""" For positive integers x, n, return the floor of the nth root of x. """

# Initial guess: here we use the smallest power of 2 that exceeds the nth
# root. But any value greater than or equal to the target result will do.
a = 1 << -(-x.bit_length() // n)
while True:
d = x // a**(n-1)
if a <= d:
return a
a = ((n-1) * a + d) // n

def nroot(x, n):
"""
Correctly-rounded nth root (n >= 2) of x, for a finite positive float x.
"""
if not (x > 0 and n >= 2):
raise ValueError("x should be positive; n should be at least 2")

m, e = frexp(x)
rootm = floor_nroot(int(m * 2**53) << (53*n + (e-1)%n - 52), n)
return ldexp(rootm + rootm % 2, (e-1)//n - 53)

--

___
Python tracker 

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



[issue27723] Document typing.Text and typing.AnyStr

2016-08-15 Thread Michael Lee

Michael Lee added the comment:

Second revision attached below.

--
Added file: http://bugs.python.org/file44121/document-text-and-anystr-2.patch

___
Python tracker 

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



[issue26823] Shrink recursive tracebacks

2016-08-15 Thread Emanuel Barry

Emanuel Barry added the comment:

Doc patch.

--
stage: resolved -> patch review
status: closed -> open
Added file: http://bugs.python.org/file44120/short_tracebacks_doc_1.patch

___
Python tracker 

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



[issue27767] Receive "A required privilege is not held by the Client" error message when Installing python on Windows 10 64 bit

2016-08-15 Thread Brett Cannon

Changes by Brett Cannon :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
versions: +Python 2.7, Python 3.5

___
Python tracker 

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



[issue27767] Receive "A required privilege is not held by the Client" error message when Installing python on Windows 10 64 bit

2016-08-15 Thread Brett Cannon

Brett Cannon added the comment:

1. Is this pre- or post-Anniversary update?

2. Is the PC administered by anyone other than yourself (e.g. is it a work 
machine)?

3. Are you trying to do a system-wide install or a personal install?

4. For at least Python 3.5 the installer does work as I have done it myself 
multiple times.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue27492] Enhance bytearray_repr with bytes_repr's logic

2016-08-15 Thread Xiang Zhang

Xiang Zhang added the comment:

> It can be more efficient is make bytes.__repr__ accepting not only bytes, but 
> objects supporting the buffer protocol.

I like this idea. v2 implements this.

--
Added file: http://bugs.python.org/file44119/bytearray_repr_v2.patch

___
Python tracker 

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



[issue12345] Add math.tau

2016-08-15 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

There is a typo in the NEWS entry:

"Issue #12345: Add *mathemathcal* constant tau to math ..."

--

___
Python tracker 

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



[issue27736] repeated Py_Initialize/PyRun_SimpleString/Py_Finalize segfaults

2016-08-15 Thread Brett Cannon

Brett Cannon added the comment:

Patch LGTM.

--
assignee: brett.cannon -> ned.deily
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



[issue12345] Add math.tau

2016-08-15 Thread Guido van Rossum

Changes by Guido van Rossum :


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



[issue12345] Add math.tau

2016-08-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 68f2d6098be1 by Guido van Rossum in branch 'default':
Issue #12345: Add mathemathcal constant tau to math and cmath.
https://hg.python.org/cpython/rev/68f2d6098be1

--

___
Python tracker 

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



[issue24379] Add operator.subscript as a convenience for creating slices

2016-08-15 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

It looks like namedtuple suffers the same issue with empty __slots__:

test_collections leaked [0, 0, 2, 0] references, sum=2

--

___
Python tracker 

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



[issue24379] Add operator.subscript as a convenience for creating slices

2016-08-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Raymond, adding a stub element to __slots__ fixes a leak. Is this enough to 
push the patch again?

We should open a separate issue for leaks in objects with empty __slots__.

--

___
Python tracker 

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



[issue26415] Excessive peak memory consumption by the Python parser

2016-08-15 Thread Xavier Combelle

Xavier Combelle added the comment:

Looks that there is two bug as partial solution of the main bug which is reduce 
memory consumption of the parser:
- The compression thing
- the reducing of heap fragmentation
Could each sub bug have it's own bug tracker and mark them blocking for the 
main bug ?

A. Skrobov Can you describe the big picture of your patch, without I don't 
understand the logic of your modifications.

--
nosy: +xcombelle

___
Python tracker 

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



[issue27506] make bytes/bytearray delete a keyword argument

2016-08-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Technically the patch looks correct to me. Added just few minor comments on 
Rietveld. I don't think there is a large need in adding the support of keyword 
argument. But since the overhead is small and somebody needs this, adding this 
doesn't do a harm. Left it on you Martin.

--
assignee: serhiy.storchaka -> martin.panter

___
Python tracker 

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



[issue12345] Add math.tau

2016-08-15 Thread Guido van Rossum

Guido van Rossum added the comment:

Lisa, this LGTM. I'll commit it so we can put this behind us!

--

___
Python tracker 

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



[issue27769] IDLE's "Replace All" with up direction and no wrapping replaces one upward and all downward entries instead of replacing all upward entries.

2016-08-15 Thread Qwert225

Qwert225 added the comment:

EDIT: IDLE's "Replace All" with up direction and no wrapping replaces one 
upward matching entry and all downward matching entries even though it is set 
to replace all upward entries.

--
title: "Replace All" with up direction and no wrapping replaces only the 
bottommost of all matching upward entries -> IDLE's "Replace All" with up 
direction and no wrapping replaces one upward and all downward entries instead 
of replacing all upward entries.

___
Python tracker 

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



[issue27769] "Replace All" with up direction and no wrapping replaces only the bottommost of all matching upward entries

2016-08-15 Thread Qwert225

New submission from Qwert225:

IDLE's "Replace All" option with up direction and disabled "Wrap around" 
replaces only the bottommost of all matching upward entries instead of 
replacing all matching upward entries.

--
assignee: terry.reedy
components: IDLE
messages: 272768
nosy: Qwert225, terry.reedy
priority: normal
severity: normal
status: open
title: "Replace All" with up direction and no wrapping replaces only the 
bottommost of all matching upward entries
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



[issue18844] allow weights in random.choice

2016-08-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Raymond, any chance to get weighted random choices generator in 3.6? Less than 
month is left to feature code freeze.

--

___
Python tracker 

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



[issue17394] Add slicing support to collections.deque

2016-08-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Raymond, do you still have an interest in this issue? If no, you can just close 
it.

--

___
Python tracker 

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



[issue25628] Make namedtuple "verbose" and "rename" parameters into keyword only arguments

2016-08-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ping again.

--

___
Python tracker 

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



[issue27734] Memory leaks at Python35-32

2016-08-15 Thread R. David Murray

R. David Murray added the comment:

Филипп: As Stefan said, we know there are problems with initialize/finalize, 
but the problems are deep and the project to correct them is ongoing.  So, this 
is an example of an already identified leak that we are working on, and 
consequently I'll close this issue.  (If you disagree with Stefan's diagnosis, 
please let us know with supporting info about why.)

--
resolution:  -> duplicate
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



[issue27766] Add ChaCha20 Poly1305 to SSL ciphers

2016-08-15 Thread Christian Heimes

Changes by Christian Heimes :


--
dependencies: +Make OpenSSL module compatible with OpenSSL 1.1.0, ssl: add 
public API for IA-32 processor capabilities vector

___
Python tracker 

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



[issue27768] ssl: add public API for IA-32 processor capabilities vector

2016-08-15 Thread Christian Heimes

New submission from Christian Heimes:

OpenSSL has a function called OPENSSL_ia32cap_loc() to get the processor's 
capability vector in X86 and X86_64 systems. The information is useful to 
decide which cipher suite to prefer. For example on machines without AES-NI and 
CLMUL CPU instructions, ChaCha20 should be prefered over AES-GCM. 

https://www.openssl.org/docs/man1.0.2/crypto/OPENSSL_ia32cap_loc.html

#27766 just exposes the plain OPENSSL_ia32cap_loc(). A richer API should parse 
the bit field and expose the bits as structure.

--
components: Extension Modules
messages: 272763
nosy: alex, christian.heimes, dstufft, giampaolo.rodola, janssen
priority: normal
severity: normal
status: open
title: ssl: add public API for IA-32 processor capabilities vector
type: enhancement
versions: Python 3.6

___
Python tracker 

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



[issue27766] Add ChaCha20 Poly1305 to SSL ciphers

2016-08-15 Thread Alex Gaynor

Alex Gaynor added the comment:

Exposing it in some way would be good, but we can make that a seperate issue.

--

___
Python tracker 

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



[issue27766] Add ChaCha20 Poly1305 to SSL ciphers

2016-08-15 Thread Cory Benfield

Cory Benfield added the comment:

Christian: Certainly I'd like to be able to use that API from within urllib3 
and Twisted. Having something public would be really convenient. Of course, 
it'd be good if OpenSSL exposed something useful here, but in the absence of 
that Python would be convenient.

--

___
Python tracker 

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



[issue27766] Add ChaCha20 Poly1305 to SSL ciphers

2016-08-15 Thread Christian Heimes

Christian Heimes added the comment:

Cory, Alex:

Do you like to have a public API for CPU feature discovery? I don't mind to 
make OPENSSL_ia32cap_loc() a public API or even expose the bit set as structure 
with nice field names.

Decorater:

This ticket is not a vote on favorite packages. Please keep it on topic.

--

___
Python tracker 

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



[issue27766] Add ChaCha20 Poly1305 to SSL ciphers

2016-08-15 Thread Decorater

Decorater added the comment:

tbh I personally perfer aiohttp over requests.

--
nosy: +Decorater

___
Python tracker 

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



[issue27766] Add ChaCha20 Poly1305 to SSL ciphers

2016-08-15 Thread Cory Benfield

Cory Benfield added the comment:

Update for Requests+urllib3 is here: https://github.com/shazow/urllib3/pull/947

Update for Twisted is here: https://twistedmatrix.com/trac/ticket/8760

--

___
Python tracker 

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



[issue11566] hypot define in pyconfig.h clashes with g++'s cmath

2016-08-15 Thread Pas

Changes by Pas :


--
nosy: +pas

___
Python tracker 

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



[issue27755] Retire DynOptionMenu with a ttk Combobox

2016-08-15 Thread Justin Foo

Justin Foo added the comment:

I wasn't sure if the ongoing work in #24781 essentially rendered my patch 
obsolete, so I keenly await Mark's response.

Upon reflection, I think my patch is a cheap win even if it's later overhauled 
by other improvements.

--
status: closed -> open

___
Python tracker 

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



[issue27450] bz2: BZ2File should expose compression level as an attribute

2016-08-15 Thread Xiang Zhang

Xiang Zhang added the comment:

If you don't want to manually parse it, the lib has to. Currently, bz2 
delegates all the raw data parsing (compression/decompression) to the 
underlying C library. Unfortunately the bzip2 library doesn't expose the header 
info which means to get compression level, we have to do some raw data parsing 
in the lib.

Actually I wonder if it's worth though this seems not hard to implement.

--
nosy: +martin.panter, xiang.zhang

___
Python tracker 

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



[issue27767] Receive "A required privilege is not held by the Client" error message when Installing python on Windows 10 64 bit

2016-08-15 Thread Decorater

Decorater added the comment:

Why are you trying to install 3.6? when you can make it the embeded version as 
it is still in alpha and then use it. Not only that but you can use 
\Tools\msi\make_zip.py to learn more.

--
nosy: +Decorater

___
Python tracker 

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



[issue26526] In parsermodule.c, replace over 2KLOC of hand-crafted validation code, with a DFA

2016-08-15 Thread A. Skrobov

A. Skrobov added the comment:

Thanks Xavier! Yes, this is the same DFA that's used by the main Python parser. 
For some reason, parsermodule didn't previously reuse it, but instead did its 
own thing.

Any volunteers to review the other patch for Python parser, at 
http://bugs.python.org/issue26415 ?

--

___
Python tracker 

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



[issue27766] Add ChaCha20 Poly1305 to SSL ciphers

2016-08-15 Thread Christian Heimes

Christian Heimes added the comment:

On 2016-08-15 13:09, Alex Gaynor wrote:
> 
> Alex Gaynor added the comment:
> 
> So, for servers really what we care about is if the _client_ has 
> PCLMULQDQ/AESNI, not whether the server itself does. Unfortunately, there's 
> no sane way to do this.

For servers we want to prefer CHACHA20 over AESGCM iff both sides have
AES-NI and CLMUL. A server on a device such as a RPi benefits from
CHACHA20, too. For that reason I also changed the server side cipher string.

As you already said, there is no way to express this with OpenSSL cipher
suite string.

--

___
Python tracker 

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



[issue27767] Receive "A required privilege is not held by the Client" error message when Installing python on Windows 10 64 bit

2016-08-15 Thread Ron Carr

New submission from Ron Carr:

Hi,

I am unable to install Python 3.6.0, 3.5.2 and 2.7.12, on my Windows 10 64 bit 
system, receive error message "A required privilege is not held by the client". 
I have turned UAC, and changed registry setting to zero. Also have ensured my 
Administrator has full access rights, but still get the same error. I have also 
turned off my virus checker.

Any help would be greatly appeciated.

Regards,

Ballterrier

--
components: Installation
messages: 272752
nosy: ballterrier
priority: normal
severity: normal
status: open
title: Receive "A required privilege is not held by the Client" error message 
when Installing python on Windows 10 64 bit
type: security
versions: Python 3.6

___
Python tracker 

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



[issue27766] Add ChaCha20 Poly1305 to SSL ciphers

2016-08-15 Thread Alex Gaynor

Alex Gaynor added the comment:

Simply doing AES-GCM before ChaCha20 is probably the simplest thing to start 
with, can always get fancier later.

--

___
Python tracker 

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



[issue27766] Add ChaCha20 Poly1305 to SSL ciphers

2016-08-15 Thread Cory Benfield

Cory Benfield added the comment:

Yup. So for Requests at least, the fix is easy: because OpenSSL kindly just 
quietly ignores cipher suites it doesn't know about we can unconditionally add 
it to the requests/urllib3 cipher string. In the first instance we'll just do 
it statically, and then we can consider down the road whether 
Python/cryptography could give us a way to ask whether we should prefer 
ChaCha20 over AES-GCM.

In the short term, my expectation is that we'd still want to prioritise AES-GCM 
over ChaCha20 in Requests: is there any reason to think that I'm wrong there?

--

___
Python tracker 

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



[issue27766] Add ChaCha20 Poly1305 to SSL ciphers

2016-08-15 Thread Alex Gaynor

Alex Gaynor added the comment:

So, for servers really what we care about is if the _client_ has 
PCLMULQDQ/AESNI, not whether the server itself does. Unfortunately, there's no 
sane way to do this.

Haven't reviewed this patch in terribly much detail, but conceptually fine. 
Cory, we should make sure this type of change propogates its way through 
requests, urllib3, hynek's blog post, and whatever else has a copy-pasted 
ciphersuite string.

--
nosy: +hynek

___
Python tracker 

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



[issue27763] Add complex case to test_builtin abs()

2016-08-15 Thread Mark Dickinson

Mark Dickinson added the comment:

> in looking through test_cmath, it appears that only the two numeric
> argument form of complex(i, j) is tested for any of the functions, not the
> complex('i+nj') string form.

We're testing the cmath functions on complex number inputs; I don't think it 
matters much how those complex numbers are created. The string form of the 
constructor can't create any complex numbers that the two-argument `complex(x, 
y)` form can't, so we're not losing test coverage by only using the `complex(x, 
y)` form.

The complex number creation from both strings and pairs of floats should be 
tested independently, of course.

--
nosy: +mark.dickinson

___
Python tracker 

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



  1   2   >