[issue34812] [EASY] support.args_from_interpreter_flags() doesn't inherit -I (isolated) flag

2018-10-07 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

>> The only thing here is that '-I' returns '-s -E -I' unlike other options 
>> where args can be used for comparison logic in check_options.

> Karthikeyan, do you happen to have a use case where this might come into 
> action?

I don't have a use case in mind. The comment was that returning '-s -E -I' 
would need the helper function used in the test to be changed.

Thanks

--

___
Python tracker 

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



[issue34925] 25% speed-up to common case for bisect()

2018-10-07 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
title: 25% speed-up to common case bisect() -> 25% speed-up to common case for 
bisect()

___
Python tracker 

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



[issue34893] Add 2to3 fixer to change send and recv methods of socket object.

2018-10-07 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Benjamin, I'm dubious about this going forward, but it is up to you.

--
assignee:  -> benjamin.peterson

___
Python tracker 

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



[issue34751] Hash collisions for tuples

2018-10-07 Thread Tim Peters


Tim Peters  added the comment:

Here's htest.py output from

git pull https://github.com/jdemeyer/cpython.git bpo34751

and a variation.  The number of collisions in the variation appear in square 
brackets at the end of each line.

32-bit build:

range(100) by 3; 32-bit hash codes; mean 116.42 got 0 [0]
-10 .. 8 by 4; 32-bit hash codes; mean 1.28 got 0 [0]
-50 .. 50 less -1 by 3; 32-bit hash codes; mean 116.42 got 0 [0]
0..99 << 60 by 3; 32-bit hash codes; mean 116.42 got 0 [0]
[-3, 3] by 20; 32-bit hash codes; mean 128.00 got 140 [108]
[0.5, 0.25] by 20; 32-bit hash codes; mean 128.00 got 99 [154]
old tuple test; 32-bit hash codes; mean 7.43 got 4 [2]
new tuple test; 32-bit hash codes; mean 13.87 got 19 [21]

64-bit build:

range(100) by 3; 64-bit hash codes; mean 0.00 got 0 [0]
range(100) by 3; 32-bit lower hash codes; mean 116.42 got 130 [0]
range(100) by 3; 32-bit upper hash codes; mean 116.42 got 94 [6]
-10 .. 8 by 4; 64-bit hash codes; mean 0.00 got 0 [0]
-10 .. 8 by 4; 32-bit lower hash codes; mean 1.28 got 1 [0]
-10 .. 8 by 4; 32-bit upper hash codes; mean 1.28 got 1 [0]
-50 .. 50 less -1 by 3; 64-bit hash codes; mean 0.00 got 0 [0]
-50 .. 50 less -1 by 3; 32-bit lower hash codes; mean 116.42 got 128 [0]
-50 .. 50 less -1 by 3; 32-bit upper hash codes; mean 116.42 got 116 [8]
0..99 << 60 by 3; 64-bit hash codes; mean 0.00 got 0 [0]
0..99 << 60 by 3; 32-bit lower hash codes; mean 116.42 got 123 [258]
0..99 << 60 by 3; 32-bit upper hash codes; mean 116.42 got 121 [0]
[-3, 3] by 20; 64-bit hash codes; mean 0.00 got 0 [0]
[-3, 3] by 20; 32-bit lower hash codes; mean 128.00 got 129 [117]
[-3, 3] by 20; 32-bit upper hash codes; mean 128.00 got 137 [115]
[0.5, 0.25] by 20; 64-bit hash codes; mean 0.00 got 0 [0]
[0.5, 0.25] by 20; 32-bit lower hash codes; mean 128.00 got 126 [131]
[0.5, 0.25] by 20; 32-bit upper hash codes; mean 128.00 got 137 [130]
old tuple test; 64-bit hash codes; mean 0.00 got 0 [0]
old tuple test; 32-bit lower hash codes; mean 7.43 got 12 [5]
old tuple test; 32-bit upper hash codes; mean 7.43 got 54 [52]
new tuple test; 64-bit hash codes; mean 0.00 got 0 [0]
new tuple test; 32-bit lower hash codes; mean 13.87 got 10 [6]
new tuple test; 32-bit upper hash codes; mean 13.87 got 20 [30]

They're all fine by me.  This is what the variation does:

1. Removes all "final mix" code after the loop ends.
2. Changes initialization to add in the length:

Py_uhash_t acc = _PyHASH_XXPRIME_5 + (Py_uhash_t)len;

The vast bulk of the "final mix" code applies a chain of tuple-agnostic 
permutations.  The only exception is adding in the length, which #2 moves to 
the start instead.

Applying permutations after the loop ends changes nothing about the number of 
full-width hash collisions, which is Python's _primary_ concern.  Two 
full-width hash codes are the same after the final mix if and only if they're 
the same before the final mix starts.

In xxHash they're concerned about getting close to "avalanche" perfection (each 
input bit affects all final output bits with probability about 0.5 for each).  
There aren't enough permutations _inside_ the loop to achieve that for the last 
input or two, so they pile up more permutations after the loop.

While we do care about "propagate left" and "propagate right" to mix up very 
regular and/or sparse hash codes, "avalanche perfection" is of no particular 
value to us.  To the contrary, in _typical_ cases like `product(range(100), 
repeat=3)` it's better for us _not_ to destroy all the regularity:

range(100) by 3; 32-bit lower hash codes; mean 116.42 got 130 [0]
range(100) by 3; 32-bit upper hash codes; mean 116.42 got 94 [6]

"Avalanche perfection" is what drives the number of collisions up with the 
final mix code intact.  Without it, we get "waaay better than random" 
numbers of collisions.

The other reason it's attractive to drop it:  the final mix code is one long 
critical path (no instruction-level parallelism), adding 8 serialized machine 
instructions including two multiplies.  That's a real expense for 
typically-short tuples used as dict keys or set elements.

Nothing is anywhere near disaster territory either way, although "worse than 
random" remains quite possible, especially when cutting a 64-bit hash in half 
(do note that, either way, there are no collisions in any test when retaining 
the full 64-bit hash code).

--

___
Python tracker 

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



[issue34812] [EASY] support.args_from_interpreter_flags() doesn't inherit -I (isolated) flag

2018-10-07 Thread Danish Prakash


Danish Prakash  added the comment:

You're right Karthikeyan, although I personally think that returning ['-s', 
'-E', '-I'] should be a plausible solution here since it has been stated 
explicitly that it implies '-s' and '-E' but I'm still waiting for what Victor 
has to say on this. 

> The only thing here is that '-I' returns '-s -E -I' unlike other options 
> where args can be used for comparison logic in check_options.

Karthikeyan, do you happen to have a use case where this might come into action?

--

___
Python tracker 

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



[issue34925] 25% speed-up to common case bisect()

2018-10-07 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
keywords: +patch
pull_requests: +9139
stage:  -> patch review

___
Python tracker 

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



[issue34925] 25% speed-up to common case bisect()

2018-10-07 Thread Raymond Hettinger


New submission from Raymond Hettinger :

The common case for bisect calls is to have two positional arguments and no 
keyword arguments.  For this case, PyArg_ParseTupleAndKeywords() is 
unnecessarily expensive.

Timings
---

$ pytime -r 11 -s 'from bisect import bisect' -s 'arr=list(range(5))' 
'bisect(arr, 2)'
200 loops, best of 11: 152 nsec per loop
$ pytime -r 11 -s 'from bisect import bisect' -s 'arr=list(range(5))' 
'bisect(arr, 2)'
200 loops, best of 11: 152 nsec per loop
$ pytime -r 11 -s 'from bisect import bisect' -s 'arr=list(range(5))' 
'bisect(arr, 2)'
200 loops, best of 11: 152 nsec per loop

--- patched 
$ pytime -r 11 -s 'from bisect import bisect' -s 'arr=list(range(5))' 
'bisect(arr, 2)'
200 loops, best of 11: 112 nsec per loop
$ pytime -r 11 -s 'from bisect import bisect' -s 'arr=list(range(5))' 
'bisect(arr, 2)'
200 loops, best of 11: 113 nsec per loop
$ pytime -r 11 -s 'from bisect import bisect' -s 'arr=list(range(5))' 
'bisect(arr, 2)'
200 loops, best of 11: 113 nsec per loop

--
components: Extension Modules
messages: 327317
nosy: rhettinger
priority: normal
severity: normal
status: open
title: 25% speed-up to common case bisect()
type: performance
versions: Python 3.8

___
Python tracker 

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



[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-07 Thread Ned Deily


Ned Deily  added the comment:

Both 3.7.1rc2 and 3.6.7rc2

--

___
Python tracker 

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



[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-07 Thread Yury Selivanov


Yury Selivanov  added the comment:

Closing it now, Ned, thanks!  I assume it will make it into 3.7.1rc2, right?

--
priority: release blocker -> normal
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



[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-07 Thread Ned Deily


Ned Deily  added the comment:

Is there any reason this issue needs to remain open?  Or can we at least remove 
the "release blocker" priority?

--

___
Python tracker 

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



[issue34924] inspect.signature isn't aware that types.MethodType can wrap any callable

2018-10-07 Thread Dan Snider


New submission from Dan Snider :

I actually noticed this due to it confusingly breaking IDLE call tips and code 
completion.

>>> import inspect
>>> from types import MethodType

>>> bound_len = MethodType(len, 'abc')
>>> bound_len()
3

>>> inspect.signature(bound_len)


>>> inspect.signature(len)


--
components: Library (Lib)
messages: 327313
nosy: bup
priority: normal
severity: normal
status: open
title: inspect.signature isn't aware that types.MethodType can wrap any callable
versions: Python 3.7

___
Python tracker 

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



[issue34922] hashlib segmentation fault

2018-10-07 Thread shuoz


shuoz  added the comment:

I send this to secur...@python.org.
Victor Stinner response me. 
"import hashlib; hashlib.shake_128().hexdigest((-1)&2**64-1)" can crash 
python3.7 and master


```
fan@fan:~/github/new$ ./py3.7/bin/python3
Python 3.7.1rc1+ (heads/3.7:c59e75c, Oct  8 2018, 08:53:13) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import hashlib; hashlib.shake_128().hexdigest((-1)&2**64-1)
ASAN:SIGSEGV
=
==29245==ERROR: AddressSanitizer: SEGV on unknown address 0x7f3a50713000 (pc 
0x7f3a537994c1 bp 0x7ffd978e27f0 sp 0x7ffd978e1f78 T0)
#0 0x7f3a537994c0  (/lib/x86_64-linux-gnu/libc.so.6+0x1564c0)
#1 0x7f3a543df5d0 in __asan_memcpy 
(/usr/lib/x86_64-linux-gnu/libasan.so.2+0x8c5d0)
#2 0x7f3a4f5a8603 in memcpy /usr/include/x86_64-linux-gnu/bits/string3.h:53
#3 0x7f3a4f5a8603 in _PySHA3_KeccakP1600_ExtractLanes 
/home/fan/github/new/cpython3.7/Modules/_sha3/kcp/KeccakP-1600-opt64.c:342
#4 0x7f3a4f5a877b in _PySHA3_KeccakP1600_ExtractBytes 
/home/fan/github/new/cpython3.7/Modules/_sha3/kcp/KeccakP-1600-opt64.c:375
#5 0x7f3a4f5a8965 in _PySHA3_KeccakWidth1600_SpongeSqueeze 
/home/fan/github/new/cpython3.7/Modules/_sha3/kcp/KeccakSponge.inc:287
#6 0x7f3a4f5a92a2 in _SHAKE_digest 
/home/fan/github/new/cpython3.7/Modules/_sha3/sha3module.c:615
#7 0x465348 in _PyMethodDef_RawFastCallKeywords Objects/call.c:644
#8 0x74c83c in _PyMethodDescr_FastCallKeywords Objects/descrobject.c:288
#9 0x441c3b in call_function Python/ceval.c:4579
#10 0x441c3b in _PyEval_EvalFrameDefault Python/ceval.c:3110
#11 0x5a3b1f in _PyEval_EvalCodeWithName Python/ceval.c:3930
#12 0x5a40c2 in PyEval_EvalCodeEx Python/ceval.c:3959
#13 0x5a40c2 in PyEval_EvalCode Python/ceval.c:524
#14 0x605047 in run_mod Python/pythonrun.c:1035
#15 0x6097c4 in PyRun_InteractiveOneObjectEx Python/pythonrun.c:256
#16 0x609d65 in PyRun_InteractiveLoopFlags Python/pythonrun.c:120
#17 0x60ad2b in PyRun_AnyFileExFlags Python/pythonrun.c:78
#18 0x44d7c5 in pymain_run_file Modules/main.c:427
#19 0x44d7c5 in pymain_run_filename Modules/main.c:1537
#20 0x44d7c5 in pymain_run_python Modules/main.c:2626
#21 0x44d7c5 in pymain_main Modules/main.c:2787
#22 0x44e33b in _Py_UnixMain Modules/main.c:2822
#23 0x7f3a5366382f in __libc_start_main 
(/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
#24 0x442db8 in _start (/home/fan/github/new/py3.7/bin/python3.7+0x442db8)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV ??:0 ??
==29245==ABORTING
```


```
(venv) fan@fan:~/github/new$ python
Python 3.8.0a0 (heads/master:f6c8007, Sep 25 2018, 12:42:29) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import hashlib; hashlib.shake_128().hexdigest((-1)&2**64-1)
ASAN:SIGSEGV
=
==29347==ERROR: AddressSanitizer: SEGV on unknown address 0x7f6df36db000 (pc 
0x7f6df1a0a210 bp 0x7ffdc8f57a80 sp 0x7ffdc8f57208 T0)
#0 0x7f6df1a0a20f  (/lib/x86_64-linux-gnu/libc.so.6+0x15720f)
#1 0x7f6df264f5d0 in __asan_memcpy 
(/usr/lib/x86_64-linux-gnu/libasan.so.2+0x8c5d0)
#2 0x7f6ded528643 in memcpy /usr/include/x86_64-linux-gnu/bits/string3.h:53
#3 0x7f6ded528643 in _PySHA3_KeccakP1600_ExtractLanes 
/home/fan/github/new/cpython_a/Modules/_sha3/kcp/KeccakP-1600-opt64.c:342
#4 0x7f6ded5287bb in _PySHA3_KeccakP1600_ExtractBytes 
/home/fan/github/new/cpython_a/Modules/_sha3/kcp/KeccakP-1600-opt64.c:375
#5 0x7f6ded5289a5 in _PySHA3_KeccakWidth1600_SpongeSqueeze 
/home/fan/github/new/cpython_a/Modules/_sha3/kcp/KeccakSponge.inc:287
#6 0x7f6ded529312 in _SHAKE_digest 
/home/fan/github/new/cpython_a/Modules/_sha3/sha3module.c:609
#7 0x7f6ded529312 in _sha3_shake_128_hexdigest_impl 
/home/fan/github/new/cpython_a/Modules/_sha3/sha3module.c:658
#8 0x7f6ded529312 in _sha3_shake_128_hexdigest 
/home/fan/github/new/cpython_a/Modules/_sha3/clinic/sha3module.c.h:116
#9 0x46b389 in _PyMethodDef_RawFastCallKeywords Objects/call.c:644
#10 0x81403c in _PyMethodDescr_FastCallKeywords Objects/descrobject.c:288
#11 0x4416b1 in call_function Python/ceval.c:4600
#12 0x4416b1 in _PyEval_EvalFrameDefault Python/ceval.c:3186
#13 0x5ecfbb in PyEval_EvalFrameEx Python/ceval.c:536
#14 0x5ecfbb in _PyEval_EvalCodeWithName Python/ceval.c:3951
#15 0x5ed4d2 in PyEval_EvalCodeEx Python/ceval.c:3980
#16 0x5ed4d2 in PyEval_EvalCode Python/ceval.c:513
#17 0x68addd in run_mod Python/pythonrun.c:1031
#18 0x68addd in PyRun_InteractiveOneObjectEx Python/pythonrun.c:256
#19 0x68b3f5 in PyRun_InteractiveLoopFlags Python/pythonrun.c:120
#20 0x68b71b in PyRun_AnyFileExFlags Python/pythonrun.c:78
#21 0x44db6b in pymain_run_stdin Modules/main.c:1182
#22 0x44db6b in pymain_run_python 

[issue34849] Drop logging when asyncio waits in selector.select()

2018-10-07 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue34751] Hash collisions for tuples

2018-10-07 Thread Tim Peters


Tim Peters  added the comment:

Attaching htest.py so we have a common way to compare what various things do on 
the tests that have been suggested.  unittest sucks for that.  doctest too.  
Here's current code output from a 32-bit build; "ideally" we want "got" values 
not much larger than "mean" (these are counting collisions):

range(100) by 3; 32-bit hash codes; mean 116.42 got 0
-10 .. 8 by 4; 32-bit hash codes; mean 1.28 got 69,596
-50 .. 50 less -1 by 3; 32-bit hash codes; mean 116.42 got 708,066
0..99 << 60 by 3; 32-bit hash codes; mean 116.42 got 875,000
[-3, 3] by 20; 32-bit hash codes; mean 128.00 got 1,047,552
[0.5, 0.25] by 20; 32-bit hash codes; mean 128.00 got 1,048,568
old tuple test; 32-bit hash codes; mean 7.43 got 6
new tuple test; 32-bit hash codes; mean 13.87 got 102,922

And under a 64-bit build, where the full hash code is considered, and also its 
lowest and highest 32 bits.  Note, e.g., that the old tuple test is an utter 
disaster if we only look at the high 32 bits.  Which is actually fine by me - 
the point of this is to show what happens.  Judging is a different (albeit 
related) issue ;-)

range(100) by 3; 64-bit hash codes; mean 0.00 got 0
range(100) by 3; 32-bit lower hash codes; mean 116.42 got 0
range(100) by 3; 32-bit upper hash codes; mean 116.42 got 989,670
-10 .. 8 by 4; 64-bit hash codes; mean 0.00 got 69,596
-10 .. 8 by 4; 32-bit lower hash codes; mean 1.28 got 69,596
-10 .. 8 by 4; 32-bit upper hash codes; mean 1.28 got 101,438
-50 .. 50 less -1 by 3; 64-bit hash codes; mean 0.00 got 708,066
-50 .. 50 less -1 by 3; 32-bit lower hash codes; mean 116.42 got 708,066
-50 .. 50 less -1 by 3; 32-bit upper hash codes; mean 116.42 got 994,287
0..99 << 60 by 3; 64-bit hash codes; mean 0.00 got 500,000
0..99 << 60 by 3; 32-bit lower hash codes; mean 116.42 got 875,000
0..99 << 60 by 3; 32-bit upper hash codes; mean 116.42 got 989,824
[-3, 3] by 20; 64-bit hash codes; mean 0.00 got 1,047,552
[-3, 3] by 20; 32-bit lower hash codes; mean 128.00 got 1,047,552
[-3, 3] by 20; 32-bit upper hash codes; mean 128.00 got 1,047,552
[0.5, 0.25] by 20; 64-bit hash codes; mean 0.00 got 1,048,544
[0.5, 0.25] by 20; 32-bit lower hash codes; mean 128.00 got 1,048,575
[0.5, 0.25] by 20; 32-bit upper hash codes; mean 128.00 got 1,048,544
old tuple test; 64-bit hash codes; mean 0.00 got 0
old tuple test; 32-bit lower hash codes; mean 7.43 got 6
old tuple test; 32-bit upper hash codes; mean 7.43 got 128,494
new tuple test; 64-bit hash codes; mean 0.00 got 102,920
new tuple test; 32-bit lower hash codes; mean 13.87 got 102,922
new tuple test; 32-bit upper hash codes; mean 13.87 got 178,211

--
Added file: https://bugs.python.org/file47857/htest.py

___
Python tracker 

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



[issue34795] loop.sock_recv failure because of delayed callback handling

2018-10-07 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Looks like a hack but we have no choice

--

___
Python tracker 

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



[issue34795] loop.sock_recv failure because of delayed callback handling

2018-10-07 Thread Yury Selivanov


Yury Selivanov  added the comment:

yes

--

___
Python tracker 

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



[issue22232] str.splitlines splitting on non-\r\n characters

2018-10-07 Thread Neil Schemenauer


Neil Schemenauer  added the comment:

I too would prefer a new method name rather than overloading splitlines() with 
more keyword args (passed as hardcoded constants, usually).  Again, I think we 
want:

list(open(..).read().()) == list(open(..))

readlines() returns a list but I think this method should return an iterator 
(seems more Python 3 like to me, call list if you want a list).  In that case, 
iterlines() seems like the right name to me.  I think it should take a 
'newline' keyword that behaves the same as the open() version of the keyword.

--

___
Python tracker 

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



[issue34795] loop.sock_recv failure because of delayed callback handling

2018-10-07 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Yuri, do you mean `socket._io_refs` manipulations?

--

___
Python tracker 

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



[issue34922] hashlib segmentation fault

2018-10-07 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +vstinner

___
Python tracker 

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



[issue34922] hashlib segmentation fault

2018-10-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The original crash is nor reproducible in 3.7 and master, but Victor found 
other example that causes a crash in 3.7 and master.

import hashlib; hashlib.shake_128().hexdigest(2*64-10)

Use 2*32-10 on 32-bit platforms.

I suppose that passing 2**29 on 32-bit platforms will cause problems too. And 
this is just 512 MiB.

So this issue affects 3.6, 3.7 and master.

--

___
Python tracker 

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



[issue33729] Hashlib/blake2* missing 'data' keyword argument

2018-10-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Other variant of the crash in issue34922 still is reproducible in 3.7.

--

___
Python tracker 

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



[issue33729] Hashlib/blake2* missing 'data' keyword argument

2018-10-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I have reviewed PR 8346 yet one time. No documented working behavior was 
changed. Some documentation was updated to match the code, some code was 
updated to match the documentation, and other minor errors were fixed. I don't 
think this change breaks compatibility.

--

___
Python tracker 

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



[issue33729] Hashlib/blake2* missing 'data' keyword argument

2018-10-07 Thread Ned Deily


Ned Deily  added the comment:

The question remains if Christian's and Victor's concern with 3.7 compatibility 
have been satisfied by Serihy's response in msg322798. While there is plenty of 
time to resolve concerns about what was merged into master by PR 8346, we 
shouldn't release the PR 8581 changes in 3.7.1 if there are still valid 
compatibility concerns.  Since PR 9657 for 3.6 hasn't been reviewed or merged, 
the only pressing issue for 3.6.7 is ensuring the segfault documented in 
Issue34922 is blocked, correct?  And PR 8581 prevents the segfault for 3.7 so 
we would only need a similar fix for it if the PR were reverted, correct?

--

___
Python tracker 

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



[issue34922] hashlib segmentation fault

2018-10-07 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +9138
stage:  -> patch review

___
Python tracker 

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



[issue34921] NoReturn not allowed by get_type_hints when future import annotations is used

2018-10-07 Thread noah


noah  added the comment:

Is this a feature request? Because it doesn't look like a bug to me. Where 
NoReturn is defined it says it's supposed to fail in static type checkers.

Anyway, I'm not entirely sure on the whole process of contributing but here 
goes:

The code ultimately fails at _type_check.
According to _type_check, "special forms like Union are not valid, while 
Union[int, str] is OK, etc."

NoReturn isn't subscriptable.

So basically the code is getting to this point and executing

_type_check(NoReturn, msg)

which fails on any special form.

If you try to force NoReturn to have additional parameters it will fail at 
__getitem__ because NoReturn is not subscriptable.

Any is also not subscriptable, but it's specifically handled in the 
_type_check() function ala:

if (isinstance(arg, _SpecialForm) and arg is not Any or ...

if you wanted to add NoReturn you could do something like

if (isinstance(arg, _SpecialForm) and arg not in [Any, NoReturn] or ...

Tested it and it works fine on 3.7 and 3.8 for me!

I've submitted a pull request with my proposed fix

--
nosy: +ngwood111 -levkivskyi, xtreak
versions: +Python 3.8

___
Python tracker 

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



[issue34893] Add 2to3 fixer to change send and recv methods of socket object.

2018-10-07 Thread Pranav Devarakonda


Pranav Devarakonda  added the comment:

I am sorry. I got you completely wrong with this > "One possibility is to add a 
type check to the generated code"

I thought you were asking to check the type in the fixer itself.
I get it now. So you meant to add the type check for the changed/generate 
code.I think that is a good idea.
 
> but this has its own issues and isn't satisfying.
Why do you think this way? Can you please elaborate?

--

___
Python tracker 

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



[issue34921] NoReturn not allowed by get_type_hints when future import annotations is used

2018-10-07 Thread noah


Change by noah :


--
keywords: +patch
pull_requests: +9136
stage:  -> patch review

___
Python tracker 

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



[issue34893] Add 2to3 fixer to change send and recv methods of socket object.

2018-10-07 Thread Pranav Devarakonda


Pranav Devarakonda  added the comment:

> One possibility is to add a type check to the generated code, "send(x)" -> 
> send(x.encode() if type(x)==bytes else x)"

That would have solved the problem. However we cannot check the type of the 
object while the parsing is going on. For example, printing out the type(x) for 
the above example in any of the fixers would print "lib2to3.pytree.Node" (or 
"lib2to3.pytree.Leaf" depending on the object) but not the expected type() of 
the object like str or bytes.

I haven't found out any method that can actually find out the type of the 
object in the fixer. If that can be done, then writing the fixer is pretty much 
straight forward. 

The other fixers in lib2to3, for example fix_dict.py, would convert all 
instances of viewkeys() to keys() irrespective of the type of the object that 
has called the method. That is also the case with all other fixers as well. 
Would appreciate very much if somebody can suggest how to do this.

But since that is not the case, the fixer code has to handle these cases 
individually and I expect the current fixer to do a good job for the same.

--

___
Python tracker 

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



[issue34751] Hash collisions for tuples

2018-10-07 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

I updated PR 9471 with a tuple hash function based on xxHash. The only change 
w.r.t. the official xxHash specification is that I'm not using parallellism and 
just using 1 accumulator. Please have a look.

--

___
Python tracker 

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



[issue34901] Missing isolated (-I) flag in sys.flags table

2018-10-07 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

>> Also there will be no binary releases and only source releases for security 
>> only branches.

> Is there any particular reason as to why this happens? IS it just to make it 
> easier for the team to focus on the development of current versions or 
> something else?

Sorry, I don't have a better explanation over the workflow.

--

___
Python tracker 

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



[issue34922] hashlib segmentation fault

2018-10-07 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
components: +Extension Modules -Demos and Tools
type: security -> crash
versions: +Python 3.7, Python 3.8

___
Python tracker 

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



[issue34921] NoReturn not allowed by get_type_hints when future import annotations is used

2018-10-07 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks for the report. I am adding Ivan who might have a better explanation 
since this is related to typing and type(NoReturn) has  with __future__ import and  without 
__future__. Ivan, feel free to remove yourself if this irrelevant.

--
nosy: +levkivskyi, xtreak

___
Python tracker 

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



[issue34893] Add 2to3 fixer to change send and recv methods of socket object.

2018-10-07 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> I have tweaked that fixer to handle the pointed cases 
> and a few additional ones too

Playing whack-a-mole with a few cases will always fall short of being able to 
guarantee correct transformations and not break existing code that is working 
correctly.

One possibility is to add a type check to the generated code, "send(x)" -> 
send(x.encode() if type(x)==bytes else x)" but this has its own issues and 
isn't satisfying.

--

___
Python tracker 

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



[issue34923] Decimal Multiplication problems: Wrong solution

2018-10-07 Thread Mark Dickinson


Change by Mark Dickinson :


--
resolution:  -> not a bug

___
Python tracker 

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



[issue34922] hashlib segmentation fault

2018-10-07 Thread Ned Deily


Ned Deily  added the comment:

No problem; that's something to watch out for when you get an update conflict 
message from the bug tracker!  Regarding this issue, I believe Serhiy is going 
to do a PR but perhaps you can work with him on providing the test case.

--

___
Python tracker 

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



[issue34923] Decimal Multiplication problems: Wrong solution

2018-10-07 Thread Shadow Raven


Shadow Raven  added the comment:

Oh okay thanks

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



[issue34923] Decimal Multiplication problems: Wrong solution

2018-10-07 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks for the report. I think this a known limitation and not a bug. Please 
read more about floating point limitation at 
https://docs.python.org/3/tutorial/floatingpoint.html . I would propose closing 
this. Similar issue reported few days back : issue34907

--
nosy: +xtreak

___
Python tracker 

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



[issue34919] Crash caused by certain characters in a string

2018-10-07 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks for the report. Can you please try this with 3.7.0 RC1 to see if it's 
reproducible? I think this similar to issue34087 that was present only in 3.7 
and master which also has a Django project. There was a similar report with 
issue34241 with a similar Django project POC causing this in the templates 
layer.

3.7.0 RC1 : https://www.python.org/downloads/release/python-370rc1/

--
nosy: +xtreak

___
Python tracker 

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



[issue34923] Decimal Multiplication problems: Wrong solution

2018-10-07 Thread Shadow Raven


New submission from Shadow Raven :

Some decimals, when multiplied with others, give wrong solutions:

6.23*5 = 31.152
6.89*5 = 34.446

There are more but I can't list all.

--
messages: 327290
nosy: Shadow Raven
priority: normal
severity: normal
status: open
title: Decimal Multiplication problems: Wrong solution
versions: Python 3.7

___
Python tracker 

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



[issue34812] [EASY] support.args_from_interpreter_flags() doesn't inherit -I (isolated) flag

2018-10-07 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

> From what I understand, this can be done in one of two ways. First, we could 
> edit 
> https://github.com/python/cpython/blob/ad73a9cf97770023665a1bb1c6390a3c99478139/Modules/main.c#L430
>  and not incrementing -s and -E. But I believe this would have consequences 
> that I'm unable to think of right now, so I'd like some inputs on this. 

As in the docs for -I it implies -s and -E so removing the increment is not a 
good solution in my opinion and will break code. 

I don't know how this can be handled since -I sets -s and -E implicitly and 
_args_from_interpreted_flags just looks for the set flag. This could also get a 
little complex if we remove -s and -E based on -I since one might pass -I and 
-s. Maybe we can do an intersection of the command line arguments passes and 
the set bits in _args_from_interpreted_flags so that only -I remains? Victor 
prefers -I only and maybe has an approach to solve this?

--

___
Python tracker 

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



[issue34922] hashlib segmentation fault

2018-10-07 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Sorry Ned, my comment seems to have changed the priority while submitting the 
comment. I would also propose adding the attached report as a unit test.

--

___
Python tracker 

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



[issue33729] Hashlib/blake2* missing 'data' keyword argument

2018-10-07 Thread Ned Deily


Ned Deily  added the comment:

OK. This is now blocking the release of 3.7.1rc2 and 3.6.7rc2.  See also 
Issue34922.

--
priority: normal -> release blocker

___
Python tracker 

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



[issue34922] hashlib segmentation fault

2018-10-07 Thread Ned Deily


Change by Ned Deily :


--
priority: normal -> release blocker

___
Python tracker 

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



[issue34831] Asyncio Tutorial

2018-10-07 Thread Yury Selivanov


Yury Selivanov  added the comment:

> Yury, based on the file paths, you appear to be running a MacPorts python3.7. 
>  Like many other third-party distributors (but unlike the python.org 
> installers), MacPorts separates Tkinter support into a separately-installable 
> component.  Try:


Thanks, Ned!  Yeah, I know why my python37 doesn't have Tk and how to fix it.  
It's just I don't think the tutorial should require some component that we know 
is missing when python is installed through certain channels (with default 
flags/config).

--

___
Python tracker 

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



[issue34922] hashlib segmentation fault

2018-10-07 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks for the report. Interesting, this is not reproducible on master and 
latest 3.7 branches though both have different errors but reproducible in 
latest 3.6 and v3.7.0 . As Ned noted this seems to have been fixed with 
issue33729 but still there is no decision on reverting/keeping the commits made 
with the linked issue.

# master

./python.exe
Python 3.8.0a0 (heads/master:7dfbd49671, Oct  7 2018, 16:00:31)
[Clang 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import hashlib
>>> hashlib.shake_128().hexdigest(-10)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: value must be positive

# upstream/3.7

./python.exe
Python 3.7.1rc1+ (remotes/upstream/3.7:3b699932e5, Oct  7 2018, 21:44:03)
[Clang 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import hashlib
>>> hashlib.shake_128().hexdigest(-10)
Traceback (most recent call last):
  File "", line 1, in 
OverflowError: can't convert negative value to unsigned int

# 3.7.0 segfaults

./python.exe
Python 3.7.0 (tags/v3.7.0:1bf9cc5093, Oct  7 2018, 21:51:43)
[Clang 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import hashlib
>>> hashlib.shake_128().hexdigest(-10)
[1]67585 bus error  ./python.exe

# upstream/3.6 segfaults

./python.exe
Python 3.6.7rc1+ (remotes/upstream/3.6:177254c96f, Oct  7 2018, 21:42:19)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import hashlib
>>> hashlib.shake_128().hexdigest(-10)
[1]49096 bus error  ./python.exe

Thanks

--
priority: release blocker -> normal

___
Python tracker 

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



[issue34831] Asyncio Tutorial

2018-10-07 Thread Ned Deily


Ned Deily  added the comment:

Yury, based on the file paths, you appear to be running a MacPorts python3.7.  
Like many other third-party distributors (but unlike the python.org 
installers), MacPorts separates Tkinter support into a separately-installable 
component.  Try:

port install py37-tkinter

--
nosy: +ned.deily

___
Python tracker 

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



[issue34922] hashlib segmentation fault

2018-10-07 Thread Ned Deily


Ned Deily  added the comment:

See also Issue33729.  We need this addressed for 3.6.7.

--
nosy: +christian.heimes, ned.deily, serhiy.storchaka
priority: normal -> release blocker

___
Python tracker 

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



[issue34901] Missing isolated (-I) flag in sys.flags table

2018-10-07 Thread miss-islington


miss-islington  added the comment:


New changeset c59e75ccf0ea8d882738214e0385f41eed51e3c7 by Miss Islington (bot) 
in branch '3.7':
bpo-34901: add isolated (-I) flag to sys.flags (GH-9708)
https://github.com/python/cpython/commit/c59e75ccf0ea8d882738214e0385f41eed51e3c7


--
nosy: +miss-islington

___
Python tracker 

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



[issue34901] Missing isolated (-I) flag in sys.flags table

2018-10-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9135

___
Python tracker 

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



[issue34922] hashlib segmentation fault

2018-10-07 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue28716] Fractions instantiation revisited

2018-10-07 Thread Steven D'Aprano


Change by Steven D'Aprano :


--
nosy: +steven.daprano

___
Python tracker 

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



[issue33084] Computing median, median_high an median_low in statistics library

2018-10-07 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

I want to revisit this for 3.8.

I agree that the current implementation-dependent behaviour when there are NANs 
in the data is troublesome. But I don't think that there is a single right 
answer.

I also agree with Mark that if we change median, we ought to change the other 
functions so that people can get consistent behaviour. It wouldn't be good for 
median to ignore NANs and mean to process them.

I'm inclined to add a parameter to the statistics functions to deal with NANs, 
that allow the caller to select from:

- implementation-dependent, i.e. what happens now;
  (for speed, and backwards compatibility, this would be the default)

- raise an exception;

- return a NAN;

- skip any NANs (treat them as missing values to be ignored).

I think that raise/return/ignore will cover most use-cases for NANs, and the 
default will be suitable for the "easy cases" where there are no NANs, without 
paying any performance penalty if you already know your data has no NANs.

Thoughts?

I'm especially looking for ideas on what to call the first option.

--
assignee:  -> steven.daprano
versions: +Python 3.8 -Python 3.6

___
Python tracker 

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



[issue34812] [EASY] support.args_from_interpreter_flags() doesn't inherit -I (isolated) flag

2018-10-07 Thread Danish Prakash


Danish Prakash  added the comment:

> I expect to get: ['-I'] instead of ['-s', '-E', '-I']

>From what I understand, this can be done in one of two ways. First, we could 
>edit 
>https://github.com/python/cpython/blob/ad73a9cf97770023665a1bb1c6390a3c99478139/Modules/main.c#L430
> and not incrementing -s and -E. But I believe this would have consequences 
>that I'm unable to think of right now, so I'd like some inputs on this. 

Secondly, we could handle this condition in `_args_from_interpreted_flags()` 
itself but that might be looked upon as bad practice.

--

___
Python tracker 

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



[issue34861] Improve cProfile standard output

2018-10-07 Thread Anders Hovmöller

Anders Hovmöller  added the comment:

Output before this patch:

 3666 function calls (3556 primitive calls) in 0.005 seconds

   Ordered by: standard name

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
20.0000.0000.0020.001 :1009(_handle_fromlist)
70.0000.0000.0000.000 :103(release)
50.0000.0000.0000.000 :143(__init__)
50.0000.0000.0000.000 :147(__enter__)
50.0000.0000.0000.000 :151(__exit__)
70.0000.0000.0000.000 :157(_get_module_lock)
50.0000.0000.0000.000 :176(cb)
20.0000.0000.0000.000 :194(_lock_unlock_module)
  7/10.0000.0000.0030.003 :211(_call_with_frames_removed)
   530.0000.0000.0000.000 :222(_verbose_message)
50.0000.0000.0000.000 :307(__init__)
50.0000.0000.0000.000 :311(__enter__)
50.0000.0000.0000.000 :318(__exit__)
   200.0000.0000.0000.000 :321()
40.0000.0000.0000.000 :35(_new_module)
50.0000.0000.0000.000 :369(__init__)
90.0000.0000.0000.000 :403(cached)
70.0000.0000.0000.000 :416(parent)
50.0000.0000.0000.000 :424(has_location)
50.0000.0000.0000.000 :504(_init_module_attrs)
50.0000.0000.0000.000 :576(module_from_spec)
50.0000.0000.0000.000 :58(__init__)
  5/10.0000.0000.0040.004 :663(_load_unlocked)
50.0000.0000.0000.000 :719(find_spec)
70.0000.0000.0000.000 :78(acquire)
50.0000.0000.0000.000 :792(find_spec)
   150.0000.0000.0000.000 :855(__enter__)
   150.0000.0000.0000.000 :859(__exit__)
50.0000.0000.0010.000 :882(_find_spec)
  5/10.0000.0000.0040.004 :948(_find_and_load_unlocked)
  5/10.0000.0000.0040.004 :978(_find_and_load)
10.0000.0000.0000.000 :1072(__init__)
10.0000.0000.0000.000 :1083(create_module)
10.0000.0000.0000.000 :1091(exec_module)
10.0000.0000.0000.000 :1233(_path_hooks)
   120.0000.0000.0000.000 :1246(_path_importer_cache)
50.0000.0000.0010.000 :1283(_get_spec)
50.0000.0000.0010.000 :1315(find_spec)
10.0000.0000.0000.000 :1362(__init__)
80.0000.0000.0000.000 :1368()
50.0000.0000.0000.000 :1394(_get_spec)
   100.0000.0000.0010.000 :1399(find_spec)
10.0000.0000.0000.000 :1447(_fill_cache)
10.0000.0000.0000.000 :1476()
10.0000.0000.0000.000 :1488(path_hook_for_FileFinder)
80.0000.0000.0000.000 :282(cache_from_source)
   100.0000.0000.0000.000 :36(_relax_case)
50.0000.0000.0000.000 :412(_get_cached)
40.0000.0000.0000.000 :444(_check_name_wrapper)
40.0000.0000.0000.000 :481(_classify_pyc)
   120.0000.0000.0000.000 :51(_r_long)
40.0000.0000.0000.000 :514(_validate_timestamp_pyc)
   510.0000.0000.0000.000 :56(_path_join)
40.0000.0000.0000.000 :566(_compile_bytecode)
   510.0000.0000.0000.000 :58()
50.0000.0000.0000.000 :617(spec_from_file_location)
80.0000.0000.0000.000 :62(_path_split)
   230.0000.0000.0000.000 :74(_path_stat)
40.0000.0000.0000.000 :762(create_module)
  4/10.0000.0000.0040.004 :765(exec_module)
40.0000.0000.0010.000 :836(get_code)
90.0000.0000.0000.000 :84(_path_is_mode_type)
40.0000.0000.0000.000 :927(__init__)
80.0000.0000.0000.000 :93(_path_isfile)
40.0000.0000.0000.000 :952(get_filename)
40.0000.0000.0000.000 :957(get_data)
10.0000.0000.0000.000 :98(_path_isdir)
40.0000.0000.0000.000 :994(path_stats)
  1000.0000.0000.0010.000 __init__.py:183(dumps)
10.0000.0000.0030.003 __init__.py:97()
10.0000.0000.0020.002 decoder.py:2()
10.0000.0000.0000.000 decoder.py:20(JSONDecodeError)
10.0000.0000.0000.000 decoder.py:254(JSONDecoder)
10.0000.0000.0000.000 

[issue34624] -W option and PYTHONWARNINGS env variable does not accept module regexes

2018-10-07 Thread Nikolaus Rath


Change by Nikolaus Rath :


--
nosy: +nikratio
title: -W option does not accept module regexes -> -W option and PYTHONWARNINGS 
env variable does not accept module regexes

___
Python tracker 

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



[issue34920] PYTHONWARNINGS entries are escaped

2018-10-07 Thread Nikolaus Rath


Nikolaus Rath  added the comment:

yes, this is a duplicate.

--

___
Python tracker 

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



[issue34922] hashlib segmentation fault

2018-10-07 Thread shuoz

New submission from shuoz :

python hashlib a signd overflow maybe cause a memory over read.

python version:
Python 3.6.7rc1+ (heads/3.6:cb0bec3, Oct  1 2018, 02:19:39)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

```
[--registers---]
RAX: 0x0
RBX: 0x7fffd5f0 --> 0x41b58ab3
RCX: 0x0
RDX: 0x1ff6
RSI: 0x735ae880 --> 0x0
RDI: 0x7fffd650 --> 0x7d828fe8a42b9c7f
RBP: 0xabe --> 0x0
RSP: 0x7fffd5c8 --> 0x72a5f793 (<_sha3_shake_128_hexdigest+627>:
test   eax,eax)
RIP: 0x72a5ec60 (<_PySHA3_KeccakWidth1600_SpongeSqueeze>:   push   r15)
R8 : 0x65fc7ba985946aff
R9 : 0xefbdaa140b587a16
R10: 0x50573373c9b2b8dc
R11: 0xfba4d93abbdabffc
R12: 0x7fffd770 --> 0x7fffd7d0 --> 0xb00 --> 0x0
R13: 0x7fffd650 --> 0x7d828fe8a42b9c7f
R14: 0x735ae880 --> 0x0
R15: 0xfff6
EFLAGS: 0xa06 (carry PARITY adjust zero sign trap INTERRUPT direction OVERFLOW)
[-code-]
   0x72a5ec50 <_PySHA3_KeccakP1600_ExtractBytes+160>:   jmp
0x72a54d10 <_PySHA3_KeccakP1600_ExtractBytesInLane@plt>
   0x72a5ec55:  nop
   0x72a5ec56:  nopWORD PTR cs:[rax+rax*1+0x0]
=> 0x72a5ec60 <_PySHA3_KeccakWidth1600_SpongeSqueeze>:  push   r15
   0x72a5ec62 <_PySHA3_KeccakWidth1600_SpongeSqueeze+2>:push   r14
   0x72a5ec64 <_PySHA3_KeccakWidth1600_SpongeSqueeze+4>:push   r13
   0x72a5ec66 <_PySHA3_KeccakWidth1600_SpongeSqueeze+6>:push   r12
   0x72a5ec68 <_PySHA3_KeccakWidth1600_SpongeSqueeze+8>:movr13,rdx
[stack-]
| 0x7fffd5c8 --> 0x72a5f793 (<_sha3_shake_128_hexdigest+627>:   
test   eax,eax)
0008| 0x7fffd5d0 --> 0x7fffd5f0 --> 0x41b58ab3
0016| 0x7fffd5d8 --> 0xefdb33b --> 0x0
0024| 0x7fffd5e0 --> 0x77ed99d8 --> 0x0
0032| 0x7fffd5e8 --> 0x73606910 --> 0x619096e5 --> 
0x90982800
0040| 0x7fffd5f0 --> 0x41b58ab3
0048| 0x7fffd5f8 --> 0x72a68c08 ("2 32 8 6 length 96 224 4 temp ")
0056| 0x7fffd600 --> 0x72a5f520 (<_sha3_shake_128_hexdigest>:   push   
r15)
[--]
Legend: code, data, rodata, value

Breakpoint 2, _PySHA3_KeccakWidth1600_SpongeSqueeze (instance=0x7fffd650, 
data=0x735ae880 "", dataByteLen=0x1ff6) at 
/home/test/cpython/Modules/_sha3/kcp/KeccakSponge.inc:272
```
dataByteLen=0x1ff6

```
RAX: 0x73615f90 --> 0xfffa
RBX: 0xa8
RCX: 0x73616028 --> 0xf93801a4
RDX: 0x18
RSI: 0x7fffd6e0 --> 0x6ab2a5fe4fe8efd
RDI: 0x73615fe0 --> 0x44b6a41dfdc1a3df
RBP: 0x7fffd510 --> 0xa8
RSP: 0x7fffcc78 --> 0x76e936cf (movrcx,QWORD PTR [rbp-0x38])
RIP: 0x76120786 (<__memmove_sse2_unaligned_erms+614>:   movntdq XMMWORD 
PTR [rdi+0x20],xmm2)
R8 : 0xfff0
R9 : 0x10007e6bac07 --> 0x0
R10: 0x73616038 --> 0x0
R11: 0x73615f90 --> 0xfffa
R12: 0x73615f90 --> 0xfffa
R13: 0x7fffd650 --> 0xa35bf3e9cd13e78e
R14: 0x73615f90 --> 0xfffa
R15: 0x0
EFLAGS: 0x10206 (carry PARITY adjust zero sign trap INTERRUPT direction 
overflow)
[-code-]
   0x76120779 <__memmove_sse2_unaligned_erms+601>:  subrdx,0x40
   0x7612077d <__memmove_sse2_unaligned_erms+605>:  movntdq XMMWORD PTR 
[rdi],xmm0
   0x76120781 <__memmove_sse2_unaligned_erms+609>:  movntdq XMMWORD PTR 
[rdi+0x10],xmm1
=> 0x76120786 <__memmove_sse2_unaligned_erms+614>:  movntdq XMMWORD PTR 
[rdi+0x20],xmm2
   0x7612078b <__memmove_sse2_unaligned_erms+619>:  movntdq XMMWORD PTR 
[rdi+0x30],xmm3
   0x76120790 <__memmove_sse2_unaligned_erms+624>:  addrdi,0x40
   0x76120794 <__memmove_sse2_unaligned_erms+628>:  cmprdx,0x40
   0x76120798 <__memmove_sse2_unaligned_erms+632>:  ja 0x76120758 
<__memmove_sse2_unaligned_erms+568>
[stack-]
| 0x7fffcc78 --> 0x76e936cf (movrcx,QWORD PTR [rbp-0x38])
0008| 0x7fffcc80 --> 0x7fffccf0 --> 0x41b58ab3
0016| 0x7fffcc88 --> 0x7fffcd90 --> 0x6
0024| 0x7fffcc90 --> 0x99e --> 0x0
0032| 0x7fffcc98 --> 0x7fffcd50 --> 0x0
0040| 0x7fffcca0 --> 0x0
0048| 0x7fffcca8 --> 0x73616038 --> 0x0
0056| 0x7fffccb0 --> 0x7358a068 --> 0x1
[--]
Legend: code, data, rodata, value
Stopped reason: SIGSEGV
__memmove_sse2_unaligned_erms () at 
../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:492
492 ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S: No such file 
or directory.

[issue34920] PYTHONWARNINGS entries are escaped

2018-10-07 Thread Martin Panter

Martin Panter  added the comment:

Déjà vu. Maybe duplicate of Issue 34624?

--
nosy: +martin.panter
superseder:  -> -W option does not accept module regexes

___
Python tracker 

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



[issue34831] Asyncio Tutorial

2018-10-07 Thread Caleb Hattingh


Caleb Hattingh  added the comment:

I tested the Python 3.7.0 release version for Mac, the download called "macOS 
64-bit installer" with checksum ae0717a02efea3b0eb34aadc680dc498 on this page:

https://www.python.org/downloads/release/python-370/

I downloaded, installed that on a mac, and the chat client app launched no 
problem. (I added a screenshot to my github repo readme).

Your error "ModuleNotFoundError: No module named '_tkinter'" suggests that the 
python you were using is a different one, because in the release download, Tk 
8.6.8 is bundled and the _tkinter module was built against it and must exist.

Anyway, I just wanted to check that it does work on mac :)

--

___
Python tracker 

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



[issue34921] NoReturn not allowed by get_type_hints when future import annotations is used

2018-10-07 Thread Ismo Toijala


New submission from Ismo Toijala :

The following example should work but does not.
Note that it does work without the future import.

from __future__ import annotations

import typing

def f() -> typing.NoReturn:
pass

typing.get_type_hints(f)

Traceback (most recent call last):
  File "foo.py", line 8, in 
typing.get_type_hints(f)
  File "/usr/lib/python3.7/typing.py", line 1001, in get_type_hints
value = _eval_type(value, globalns, localns)
  File "/usr/lib/python3.7/typing.py", line 260, in _eval_type
return t._evaluate(globalns, localns)
  File "/usr/lib/python3.7/typing.py", line 466, in _evaluate
is_argument=self.__forward_is_argument__)
  File "/usr/lib/python3.7/typing.py", line 135, in _type_check
raise TypeError(f"Plain {arg} is not valid as type argument")
TypeError: Plain typing.NoReturn is not valid as type argument

--
components: Library (Lib)
messages: 327274
nosy: itoijala
priority: normal
severity: normal
status: open
title: NoReturn not allowed by get_type_hints when future import annotations is 
used
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue34901] Missing isolated (-I) flag in sys.flags table

2018-10-07 Thread Danish Prakash


Danish Prakash  added the comment:

Thanks for the concise explanation, that makes sense.

> Also there will be no binary releases and only source releases for security 
> only branches.

Is there any particular reason as to why this happens? IS it just to make it 
easier for the team to focus on the development of current versions or 
something else?

--

___
Python tracker 

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



[issue34920] PYTHONWARNINGS entries are escaped

2018-10-07 Thread Nikolaus Rath


New submission from Nikolaus Rath :

According to 
https://docs.python.org/3/library/warnings.html#describing-warning-filters:

"The meaning of each of these fields [of PYTHONWARNINGS] is as described in 
."

The description of the "The Warnings filter" says

"module is a string containing a regular expression that the module name must 
match."

However, when parsing PYTHONWARNINGS, the warnings module explicitly escapes 
the module field.

--
components: Library (Lib)
messages: 327272
nosy: nikratio
priority: normal
severity: normal
status: open
title: PYTHONWARNINGS entries are escaped
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue34831] Asyncio Tutorial

2018-10-07 Thread Caleb Hattingh


Caleb Hattingh  added the comment:

I set up a basic structure under "Doc/library/asyncio-tutorial" as suggested, 
and opened a PR to show you how that looks. When I make
more progress on a section, I'll post an update here.

--

___
Python tracker 

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



[issue34831] Asyncio Tutorial

2018-10-07 Thread Caleb Hattingh


Change by Caleb Hattingh :


--
keywords: +patch
pull_requests: +9134
stage:  -> patch review

___
Python tracker 

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



[issue34919] Crash caused by certain characters in a string

2018-10-07 Thread cwickens


New submission from cwickens :

Clone the following repo and follow the repro steps described in the readme: 
https://github.com/oTree-org/py37bug

It seems that using certain non-ASCII characters in parts of a string crashes 
Python. In the README I listed the strings that are OK and those that crash.

Also attaching the repo.

--
components: Windows
files: py37bug-master.zip
messages: 327270
nosy: cwickens, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Crash caused by certain characters in a string
type: crash
versions: Python 3.7
Added file: https://bugs.python.org/file47856/py37bug-master.zip

___
Python tracker 

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



[issue22232] str.splitlines splitting on non-\r\n characters

2018-10-07 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

I don't like the idea of adding a second bool parameter to splitlines. Guido 
has a rough rule of thumb (which I agree with) of "no constant bool 
parameters". If people will typically call a function with some sort of "mode" 
parameter using a hard-coded bool, then we should usually prefer to split the 
two modes into distinct functions.

As an example, we have statistics.stdev and pstdev rather than stdev(data, 
population=False).

Obviously this is a guideline, not a hard rule, and there are exceptions. Such 
as str.splitlines :-)

In any case, I suggest a separate string method. Even though the name is 
slightly inaccurate, I suggest "ascii_splitlines" which I think is accurate 
enough to capture the spirit of what we intend (split on *only* \n \r and \r\n) 
and we can leave the details in the docs.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue30588] Missing documentation for codecs.escape_decode

2018-10-07 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

-1
Internal function means: you can use it on your risk but the function can be 
changed or even removed in any Python release.
I see no point in documenting and making it public.

--
nosy: +asvetlov

___
Python tracker 

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



[issue34898] add mtime argument to gzip.compress

2018-10-07 Thread Sergey Fedoseev


Change by Sergey Fedoseev :


--
nosy: +sir-sigurd

___
Python tracker 

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



[issue6721] Locks in the standard library should be sanitized on fork

2018-10-07 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset 3b699932e5ac3e76031bbb6d700fbea07492641d by Gregory P. Smith 
(Miss Islington (bot)) in branch '3.7':
bpo-6721: Hold logging locks across fork() (GH-4071) (#9291)
https://github.com/python/cpython/commit/3b699932e5ac3e76031bbb6d700fbea07492641d


--

___
Python tracker 

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



[issue34903] strptime %d handling of single digit day of month

2018-10-07 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
pull_requests: +9133
stage:  -> patch review

___
Python tracker 

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