[issue32136] Move embedding tests to their own test module

2017-11-26 Thread STINNER Victor

STINNER Victor  added the comment:

What about a shorter name like test_embed?

--

___
Python tracker 

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



[issue32137] Stack overflow in repr of deeply nested dicts

2017-11-26 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

repr() of deeply nested dicts and dictviews can cause a stack overflow.

>>> x = {}
>>> for i in range(10):
... x = {1: x}
... 
>>> repr(x)
Segmentation fault

>>> x = {}
>>> for i in range(10):
... x = {1: x}
... 
>>> repr(x.values())
Segmentation fault

repr() of virtually all other deeply nested collections are guarded by using 
Py_EnterRecursiveCall().

>>> x = ()
>>> for i in range(10):
... x = (x,)
... 
>>> repr(x)
Traceback (most recent call last):
  File "", line 1, in 
RecursionError: maximum recursion depth exceeded while getting the repr of a 
tuple

>>> x = []
>>> for i in range(10):
... x = [x]
... 
>>> repr(x)
Traceback (most recent call last):
  File "", line 1, in 
RecursionError: maximum recursion depth exceeded while getting the repr of a 
list

>>> x = frozenset()
>>> for i in range(10):
... x = frozenset({x})
... 
>>> repr(x)
Traceback (most recent call last):
  File "", line 1, in 
RecursionError: maximum recursion depth exceeded while getting the repr of a 
list

>>> from collections import OrderedDict
>>> x = {}
>>> for i in range(10):
... x = OrderedDict({1: x})
... 
>>> repr(x)
Traceback (most recent call last):
  File "", line 1, in 
RecursionError: maximum recursion depth exceeded while getting the repr of a 
list

>>> from collections import deque
>>> x = deque()
>>> for i in range(10):
... x = deque([x])
... 
>>> repr(x)
Traceback (most recent call last):
  File "", line 1, in 
RecursionError: maximum recursion depth exceeded while getting the repr of a 
list

But the case of infinite recursion already is handled:

>>> x = {}
>>> x[1] = x
>>> repr(x)
'{1: {...}}'

Only finite but very deep recursion causes a crash.

The one possible solution -- add Py_EnterRecursiveCall() in the implementation 
of dict.__repr__(), like it already is added in list.__repr__() and 
tuple.__repr__().

The more general solution -- add Py_EnterRecursiveCall() in PyObject_Repr(). In 
any case it is called before calling PyObject_Repr() for every item in the repr 
of most collections except dict. And it is already added in PyObject_Str(). 
Therefore adding it will not add much overhead, but can handle more corner 
cases.

See also issue18533 and issue25240.

--
components: Interpreter Core
messages: 306997
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Stack overflow in repr of deeply nested dicts
type: crash
versions: Python 2.7, Python 3.6, Python 3.7

___
Python tracker 

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



[issue32126] [asyncio] test failure when the platform lacks a functional sem_open()

2017-11-26 Thread Xavier de Gaye

Change by Xavier de Gaye :


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



[issue32126] [asyncio] test failure when the platform lacks a functional sem_open()

2017-11-26 Thread Xavier de Gaye

Xavier de Gaye  added the comment:


New changeset a6fba9b827e395fc9583c07bc2d15cd11f684439 by xdegaye in branch 
'master':
bpo-32126: Skip asyncio test when sem_open() is not functional (GH-4559)
https://github.com/python/cpython/commit/a6fba9b827e395fc9583c07bc2d15cd11f684439


--

___
Python tracker 

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



[issue32138] android: test_faulthandler fails also on API 24

2017-11-26 Thread Xavier de Gaye

New submission from Xavier de Gaye :

Issue 26934 skipped some tests of test_faulthandler on Android API < 24 to fix 
the problem that python does not crash upon _sigsegv(). But the same problem 
occurs on API 24 except randomly, you need to run test_faulthandler many times 
before reproducing it, see below few results in that case.

I propose to skip those tests whatever the value of the Android API level.
In that case the test.support.requires_android_level decorator is not used 
anymore and should be removed.


1 test failed:
  test_faulthandler

generic_x86_64:/data/local/tmp/python $ python -m test test_faulthandler
Run tests sequentially
0:00:00 [1/1] test_faulthandler
test test_faulthandler failed -- Traceback (most recent call last):
  File "/sdcard/org.python/lib/python3.7/test/test_faulthandler.py", line 
265, in test_enable_file
filename=filename)
  File "/sdcard/org.python/lib/python3.7/test/test_faulthandler.py", line 
114, in check_fatal_error
self.check_error(code, line_number, fatal_error, **kw)
  File "/sdcard/org.python/lib/python3.7/test/test_faulthandler.py", line 
107, in check_error
output, exitcode = self.get_output(code, filename=filename, fd=fd)
  File "/sdcard/org.python/lib/python3.7/test/test_faulthandler.py", line 
67, in get_output
self.assertEqual(output, '')
AssertionError: "sys:1: ResourceWarning: unclosed file <_[49 chars]c3'>" != 
''
- sys:1: ResourceWarning: unclosed file <_io.BufferedWriter 
name='/data/local/tmp/tmp17fv9xc3'>
+ 

==
FAIL: test_disable (test.test_faulthandler.FaultHandlerTests)
--
Traceback (most recent call last):
  File "/sdcard/org.python/lib/python3.7/test/test_faulthandler.py", line 307, 
in test_disable
self.assertNotEqual(exitcode, 0)
AssertionError: 0 == 0

==
FAIL: test_gil_released (test.test_faulthandler.FaultHandlerTests)
--
Traceback (most recent call last):
  File "/sdcard/org.python/lib/python3.7/test/test_faulthandler.py", line 252, 
in test_gil_released
'Segmentation fault')
  File "/sdcard/org.python/lib/python3.7/test/test_faulthandler.py", line 114, 
in check_fatal_error
self.check_error(code, line_number, fatal_error, **kw)
  File "/sdcard/org.python/lib/python3.7/test/test_faulthandler.py", line 110, 
in check_error
self.assertNotEqual(exitcode, 0)
AssertionError: 0 == 0

--
components: Tests
messages: 306999
nosy: vstinner, xdegaye
priority: normal
severity: normal
stage: needs patch
status: open
title: android: test_faulthandler fails also on API 24
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



[issue32139] android: locale is modified by test_strftime

2017-11-26 Thread Xavier de Gaye

New submission from Xavier de Gaye :

Test results:

1 test altered the execution environment:
  test_strftime

Warning -- locale was modified by test_strftime
  Before: [(6, 'C.UTF-8'), (3, 'C.UTF-8'), (0, 'C.UTF-8'), (5, 'C.UTF-8'), 
(4, 'C.UTF-8'), (1, 'C.UTF-8'), (2, 'C.UTF-8')]
  After:  [(6, 'C'), (3, 'C'), (0, 'C'), (5, 'C'), (4, 'C'), (1, 'C'), (2, 
'C')] 
test_strftime failed (env changed)


It seems that the tests indeed modify the environment. To understand the above 
results one must be aware that the implementation of setlocale() is broken on 
Android:

generic_x86_64:/data/local/tmp/python $ python
Python 3.7.0a2+ (heads/bpo-30386:ebb493ac4e, Nov 25 2017, 18:58:20) 
[Clang 3.8.275480 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from locale import setlocale, LC_TIME, LC_ALL
>>> setlocale(LC_TIME)
'C.UTF-8'
>>> setlocale(LC_ALL)
'C.UTF-8'
>>> setlocale(LC_TIME, 'C')
'C'
>>> setlocale(LC_TIME)
'C'
>>> setlocale(LC_ALL)
'C'
>>> setlocale(LC_TIME, 'C.UTF-8')
'C.UTF-8'
>>> setlocale(LC_ALL)
'C.UTF-8'

--
components: Tests
messages: 307000
nosy: xdegaye
priority: normal
severity: normal
stage: needs patch
status: open
title: android: locale is modified by test_strftime
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



[issue32139] android: locale is modified by test_strftime

2017-11-26 Thread Xavier de Gaye

Change by Xavier de Gaye :


--
keywords: +patch
pull_requests: +4497
stage: needs patch -> patch review

___
Python tracker 

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



[issue32140] Probable bug in all python3 / idle3 debugger

2017-11-26 Thread Camion

New submission from Camion :

Hello all,

I have been investigating a bug with a generator, which crashed, reporting that 
"TypeError: 'Fraction' object is not iterable".

Then I have tried to find it with the debugger and/or to reproduce it with a 
simpler program, but, I have not managed to reproduce the bug in my test 
program and I have been stopped by the fact that the debugger crashes with 
another error:

I have reproduced it on version 3.4.2 ans 3.6.3, BUT NOT on version 2.7.9. So I 
suspect it has been introduced with version 3.

Here is how to reproduce it : 

1/ Open Idle
2/ create and save this text program (or open if you already did - or don't do 
anything if it's already opened X-D)

from fractions import Fraction
U=Fraction(1)

def test(x):
for i in range(1, x.denominator):
x*=x
yield i, i*x

for m, n in test(U*3/5):
print (m, n)

3/ Run/check module (F5) in Idle editors window : it works perfectly
4/ start the debugger from Idle menus
5/ activate the "source" checkbox
6/ Run/check module (F5) in Idle editors window
7/ Click 3 times on [over] to get to the "for m, n in test(U*3/5):" line
8/ Click 6 times on [step], to get to the line 116 ("for m, n in test(U*3/5):") 
in the fractions.py files
9/ Click a seventh time on [step] and your program will crash with the folowing 
error (here with 3.6.3)

Traceback (most recent call last):
  File "/raid/ArcFolder/Mes documents/Mes Textes/Mes 
programmes/Machin/Test_itérateur_et_fractions.py", line 12, in 
for m, n in test(U*3/5):
  File "/usr/local/lib/python3.6/fractions.py", line 376, in forward
return monomorphic_operator(a, b)
  File "/usr/local/lib/python3.6/fractions.py", line 419, in _mul
return Fraction(a.numerator * b.numerator, a.denominator * b.denominator)
  File "/usr/local/lib/python3.6/fractions.py", line 117, in __new__
if denominator is None:
  File "/usr/local/lib/python3.6/fractions.py", line 117, in __new__
if denominator is None:
  File "/usr/local/lib/python3.6/bdb.py", line 48, in trace_dispatch
return self.dispatch_line(frame)
  File "/usr/local/lib/python3.6/bdb.py", line 66, in dispatch_line
self.user_line(frame)
  File "/usr/local/lib/python3.6/idlelib/debugger.py", line 24, in user_line
self.gui.interaction(message, frame)
AttributeError: _numerator5/ Run/check module (F5) in Idle editors window

I have observed once 3.4.2 that the same operation without activating the 
source checkbox, lead to a full idle freeze, but I have not been able to 
reproduce it.

--
assignee: terry.reedy
components: IDLE
messages: 307001
nosy: Camion, terry.reedy
priority: normal
severity: normal
status: open
title: Probable bug in all python3 / idle3 debugger
type: crash
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



[issue31937] Add the term "dunder" to the glossary

2017-11-26 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

The term "dunder" is used in PEPs: PEP 8, PEP 408, PEP 435, PEP 505, PEP 520, 
PEP 526, and in the enum module documentation.

--

___
Python tracker 

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



[issue29670] argparse: does not respect required args pre-populated into namespace

2017-11-26 Thread Antonio Valentino

Change by Antonio Valentino :


--
nosy: +avalentino

___
Python tracker 

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



[issue32136] Move embedding tests to their own test module

2017-11-26 Thread Nick Coghlan

Nick Coghlan  added the comment:

I guess the shorted name would also better match the naming scheme used for the 
C API test module:

Modules/_testcapi.c -> Lib/test/test_capi.py
Progams/_testembed.c -> Lib/test/test_embed.py

--

___
Python tracker 

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



[issue32141] configure with Spaces in Directory Name on macOS

2017-11-26 Thread Phil Thompson

New submission from Phil Thompson :

When configure searches for a C compiler on macOS it fails to handle spaces in 
directory name on PATH. The fix is to enclose $as_dir in quotes.

--
components: Build
messages: 307004
nosy: philthompson10
priority: normal
severity: normal
status: open
title: configure with Spaces in Directory Name on macOS
type: behavior
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



[issue32137] Stack overflow in repr of deeply nested dicts

2017-11-26 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue10231] SimpleHTTPRequestHandler directory bugs

2017-11-26 Thread Berker Peksag

Berker Peksag  added the comment:

Note that the macpath module has been deprecated in Python 3.7 in issue 9850 
and it's going to be removed in Python 3.8 (and Python 3.6 is the only Python 3 
release that accepts bug fixes at the moment) Perhaps it's not worth to fix the 
macpath case at all.

--
nosy: +berker.peksag

___
Python tracker 

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



[issue32142] heapq.heappop - documentation misleading or doesn't work

2017-11-26 Thread Scott Queen

New submission from Scott Queen :

The documentation for heapq.heappop(heap) says:
"Pop and return the smallest item from the heap, maintaining the heap 
invariant. If the heap is empty, IndexError is raised. To access the smallest 
item without popping it, use heap[0]."

yet, in the following code, the resultant heap doesn't reflect the heap 
invariant:

import heapq
li = [5, 7, 9, 1, 4, 3]
heapq.heapify(li)
#change a couple values in the heap
li[3] = 16
li[4] = 2
print (heapq.heappop(li))
print ("The heap after pop is : ",end="")
print (list(li))

This prints: The heap after pop is : [3, 4, 9, 16, 2]

The documentation implies to me that heapify would be called internally after 
heappop, but I may be misreading. Perhaps heappop could say that the heap 
invariant is maintained if the heap is properly sorted before the heappop 
invocation.

--
assignee: docs@python
components: Documentation
messages: 307006
nosy: docs@python, scooter4j
priority: normal
severity: normal
status: open
title: heapq.heappop - documentation misleading or doesn't work
type: behavior
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



[issue32143] os.statvfs lacks f_fsid

2017-11-26 Thread Giuseppe Scrivano

New submission from Giuseppe Scrivano :

the os.statvfs() function doesn't return f_fsid.  The POSIX definition of 
statvfs() has f_fsid:

http://pubs.opengroup.org/onlinepubs/009604599/basedefs/sys/statvfs.h.html

--
components: Library (Lib)
messages: 307007
nosy: gscrivano
priority: normal
severity: normal
status: open
title: os.statvfs lacks f_fsid
type: enhancement

___
Python tracker 

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



[issue32143] os.statvfs lacks f_fsid

2017-11-26 Thread Giuseppe Scrivano

Change by Giuseppe Scrivano :


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

___
Python tracker 

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



[issue32142] heapq.heappop - documentation misleading or doesn't work

2017-11-26 Thread Eric V. Smith

Eric V. Smith  added the comment:

The heap invariant is also required in order to even meet the documented 
behavior of returning the smallest item.

>>> import heapq
>>> li = [5, 7, 9, 1, 4, 3]
>>> heapq.heapify(li)
>>> li
[1, 4, 3, 7, 5, 9]
>>> li[2] = 0
>>> heapq.heappop(li)
1
>>> li
[0, 4, 9, 7, 5]
>>>

I guess the argument could be made that docs say "from the heap", and by 
modifying the list yourself it's no longer a heap.

--
nosy: +eric.smith

___
Python tracker 

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



[issue32107] test_uuid uses the incorrect bitmask

2017-11-26 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

If I understand correctly, the original problem was that tests failed in some 
environments, right? In that case we should either change the environment or 
just remove this check. I had added it in assumption that it is never failed 
for addresses obtained from network cards. If my assumption is wrong, it should 
be just removed.

--

___
Python tracker 

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



[issue32107] test_uuid uses the incorrect bitmask

2017-11-26 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

On Nov 26, 2017, at 12:40, Serhiy Storchaka  wrote:
> 
> Serhiy Storchaka  added the comment:
> 
> If I understand correctly, the original problem was that tests failed in some 
> environments, right? In that case we should either change the environment or 
> just remove this check. I had added it in assumption that it is never failed 
> for addresses obtained from network cards. If my assumption is wrong, it 
> should be just removed.

I think your assumption is generally true in that *real* network cards (i.e. 
ethernet ports or wireless adapters) will always have universally administered 
MAC addresses.  But what you probably didn’t expect is that certain 
environments can also have locally administered MAC addresses (e.g. MBP’s Touch 
Bar interfaces - that one surprised me too!) and some may *only* have local 
MACs (e.g. Travis).

We can fix the first assumption by preferentially returning universal MACs, and 
only return local MACs if there are no other interfaces available.  My latest 
changes do this.  (Remember, I only started seeing the failures on my 2017 MBP 
with Touch Bar.)

I can’t think of any way of solving the second one, short of just skipping 
those tests on Travis.  I think any reasonable machine with real interfaces 
will have at least one universal MAC, so it’s just Travis being weird.  My 
latest commit adds a skip for Travis.  (That test is still running, so we’ll 
see.)

The original problem really was that the test for universal vs. local MAC 
address was using the incorrect bitmask.  The comment was also wrong, so my 
changes fix both the comment and the bitmask.

Another problem I found was that the UUID1 spec says that if a random MAC is 
used as a fallback, then the multicast bit must be set, so my changes also do 
this.

For now, I’d prefer to take the narrower approach of enabling the tests 
everywhere but Travis.  What I don’t know is whether any of the buildbots will 
fail in a similar way, but I’m hoping they’ll be okay.  If we see buildbot 
failures because they also lack universal MACs, then yes, we’ll have to 
reevaluate whether the tests make sense, or whether we should mock out the 
environment at a lower level.

--

___
Python tracker 

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



[issue32142] heapq.heappop - documentation misleading or doesn't work

2017-11-26 Thread abcdef

abcdef  added the comment:

>  Perhaps heappop could say that the heap invariant is maintained if the heap 
> is properly sorted before the heappop invocation.

Honestly I like this wording less. "Properly sorted" would suggest sorted in 
the sense of heap.sort() [as the docs refer to this earlier], but the array 
doesn't have to be sorted; it's enough if it's a heap. The function always 
maintains the invariant - this means that if the invariant is true as a 
precondition, it will be true as a postcondition. Maybe you have a different 
idea?

--
nosy: +abcdef

___
Python tracker 

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



[issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5

2017-11-26 Thread Zachary Ware

Zachary Ware  added the comment:


New changeset be1faabeef0821f188a28dd7cc6b744b89e85e94 by Zachary Ware in 
branch '2.7':
bpo-30855: Bump Tcl/Tk to 8.5.19 on Windows (GH-4550)
https://github.com/python/cpython/commit/be1faabeef0821f188a28dd7cc6b744b89e85e94


--

___
Python tracker 

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



[issue10544] yield expression inside generator expression does nothing

2017-11-26 Thread Guido van Rossum

Guido van Rossum  added the comment:

To clarify, the outermost iterator is marked here:

[func(x, y) for x in  for y in ]

and it is evaluated before the comprehension proper is started. This is
just part of how the language works (it's a similar rule as "in an
assignment the RHS is evaluated before it is assigned to the LHS").

I see no benefit in banning `yield` in .

On Sat, Nov 25, 2017 at 10:22 PM, Guido van Rossum 
wrote:

>
> Guido van Rossum  added the comment:
>
> No.
>
> On Nov 25, 2017 18:01, "Nick Coghlan"  wrote:
>
> >
> > Nick Coghlan  added the comment:
> >
> > Serhiy's PR now implements the "Prohibit yield & yield from in generator
> > expressions and comprehensions" approach discussed on python-dev
> (currently
> > as a hard SyntaxError, but it could be amended to be a warning instead
> > without too much difficulty).
> >
> > The PR does highlight an interesting subtlety though: the easiest way to
> > implement this still allows yield expressions in the outermost iterator,
> > since that gets compiled in a different scope from the rest of the
> > comprehension body (it's evaluated eagerly and passed in to the implicit
> > nested function).
> >
> > I'm thinking we probably don't want to expose that detail to end users,
> > and will instead want to include a second check that prohibits yield
> > expressions in the outermost iterator as well. However, I'm not entirely
> > sure how we could implement such a check, short of adding a new "yield
> > expression prohibited" counter in the AST generation and/or symbol
> analysis
> > pass.
> >
> > --
> >
> > ___
> > Python tracker 
> > 
> > ___
> >
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue32107] test_uuid uses the incorrect bitmask

2017-11-26 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Universally/locally administered MAC addresses doesn't have relation to this 
issue. My assumption was about the multicast bit (1<<40).

If my assumption was correct, the test is correct, and only the comment should 
be fixed. If it was wrong, the test should be removed. That's all.

--

___
Python tracker 

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



[issue32107] test_uuid uses the incorrect bitmask

2017-11-26 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

On Nov 26, 2017, at 14:07, Serhiy Storchaka  wrote:
> 
> Universally/locally administered MAC addresses doesn't have relation to this 
> issue. My assumption was about the multicast bit (1<<40).

AFAICT, the multicast bit is only required to be set on random MAC.

> If my assumption was correct, the test is correct, and only the comment 
> should be fixed. If it was wrong, the test should be removed. That's all.

I don’t understand.  Are you saying that _find_mac() should return whatever 
random MAC is found first, as the original code does?  That doesn’t seem right 
either, since as the MacBook Pro case shows, it’s entirely possible to get a 
MAC address that is the same on every single laptop.

--

___
Python tracker 

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



[issue32107] test_uuid uses the incorrect bitmask

2017-11-26 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

This is a different issue.

--

___
Python tracker 

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



[issue32142] heapq.heappop - documentation misleading or doesn't work

2017-11-26 Thread Eric V. Smith

Eric V. Smith  added the comment:

By "sorted" I meant "sorted by the heap functions so as to maintain their 
invariants".

I don't have any suggestion for the actual specific language to use.

--

___
Python tracker 

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



[issue28046] Remove the concept of platform-specific directories

2017-11-26 Thread Zachary Ware

Change by Zachary Ware :


--
resolution:  -> fixed
stage: commit review -> resolved
status: pending -> closed

___
Python tracker 

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



[issue30487] DOC: automatically create a venv and install Sphinx when running make

2017-11-26 Thread Zachary Ware

Zachary Ware  added the comment:


New changeset d8d6b9122134f040cd5a4f15f40f6c9e3386db4d by Zachary Ware (Caleb 
Hattingh) in branch 'master':
bpo-30487: automatically create a venv and install Sphinx when running make 
(GH-4346)
https://github.com/python/cpython/commit/d8d6b9122134f040cd5a4f15f40f6c9e3386db4d


--

___
Python tracker 

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



[issue30487] DOC: automatically create a venv and install Sphinx when running make

2017-11-26 Thread Zachary Ware

Change by Zachary Ware :


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



[issue32107] test_uuid uses the incorrect bitmask

2017-11-26 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

PR 4572 removes the wrong check.

--
type:  -> behavior
versions: +Python 2.7, Python 3.6

___
Python tracker 

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



[issue29879] typing.Text not available in python 3.5.1

2017-11-26 Thread Ivan Levkivskyi

Change by Ivan Levkivskyi :


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

___
Python tracker 

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



[issue32107] test_uuid uses the incorrect bitmask

2017-11-26 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +4500

___
Python tracker 

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



[issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5

2017-11-26 Thread STINNER Victor

STINNER Victor  added the comment:

Cool, thanks Zach!

--

___
Python tracker 

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



[issue32143] os.statvfs lacks f_fsid

2017-11-26 Thread Martin Panter

Martin Panter  added the comment:

The doc string for the result object, and the main Python 2 documentation, both 
say that the result is a 10-tuple. So perhaps any new field should only be an 
attribute, and the tuple should stay the same size, to maintain compatibility. 
This was done in other cases, e.g. struct_time and stat_result.

--
nosy: +martin.panter

___
Python tracker 

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



[issue29879] typing.Text not available in python 3.5.1

2017-11-26 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:


New changeset 0cd2e81bea639828d7c9a7afc61fb1da9699492c by Mariatta (Ivan 
Levkivskyi) in branch 'master':
bpo-29879: Update typing documentation. (GH-4573)
https://github.com/python/cpython/commit/0cd2e81bea639828d7c9a7afc61fb1da9699492c


--
nosy: +Mariatta

___
Python tracker 

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



[issue29879] typing.Text not available in python 3.5.1

2017-11-26 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4502

___
Python tracker 

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



[issue29879] typing.Text not available in python 3.5.1

2017-11-26 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:


New changeset cceb0f8d7b3451fb8de03651c979f5ac639b68c0 by Mariatta (Miss 
Islington (bot)) in branch '3.6':
bpo-29879: Update typing documentation. (GH-4573) (GH-4574)
https://github.com/python/cpython/commit/cceb0f8d7b3451fb8de03651c979f5ac639b68c0


--

___
Python tracker 

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



[issue29879] typing.Text not available in python 3.5.1

2017-11-26 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:

This has been fixed in the 3.7 and 3.6 branches.
Thanks all!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.6, Python 3.7

___
Python tracker 

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



[issue23033] Disallow support for a*.example.net, *a.example.net, and a*b.example.net in certificate wildcard handling.

2017-11-26 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:


New changeset ede2ac913eba47131ee1bbc37a9aea344d678576 by Mariatta (Mandeep 
Singh) in branch 'master':
bpo-23033:  Improve SSL Certificate handling (GH-937)
https://github.com/python/cpython/commit/ede2ac913eba47131ee1bbc37a9aea344d678576


--

___
Python tracker 

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



[issue23033] Disallow support for a*.example.net, *a.example.net, and a*b.example.net in certificate wildcard handling.

2017-11-26 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:

I merged the PR, this is now in 3.7.
Thanks all!

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



[issue32140] IDLE debugger fails with non-trivial __new__ super call

2017-11-26 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

This is not a crash because IDLE does not crash.  It does not even exit with a 
traceback.  Some crash and freeze bugs have been fixed since 3.4.2.

I verified with 3.7.0a2 on Win10.  The failing example can be simplified to the 
first two lines.  Step over the import and into the Fraction call to get to 
fractions.Fraction.__new__, line 115
self = super(Fraction, cls).__new__(cls)
(Step 8 in the report above has the wrong code.)  Step 2 gives this simplified 
traceback:

Traceback (most recent call last):
  File "F:\Python\a\tem2.py", line 3, in 
U=Fraction(1)
  File "C:\Programs\Python37\lib\fractions.py", line 117, in __new__
if denominator is None:
  File "C:\Programs\Python37\lib\fractions.py", line 117, in __new__
if denominator is None:
  File "C:\Programs\Python37\lib\bdb.py", line 86, in trace_dispatch
return self.dispatch_line(frame)
  File "C:\Programs\Python37\lib\bdb.py", line 110, in dispatch_line
self.user_line(frame)
  File "C:\Programs\Python37\lib\idlelib\debugger.py", line 24, in user_line
self.gui.interaction(message, frame)
AttributeError: _numerator

If I replace the line above with
new = super(Fraction, cls)  # resolves to object.__new__
self = new(cls)
stepping the first works.  For the new call, hitting 'step' or 'over' gives 
essentially the same traceback as above.  Hitting 'go' runs the code to 
completion.

If I add 'print('') after the new call, the print call shows up in the 
traceback, twice, but is not executed.

If I simplify the code to

class C():
def __new__(cls):
self = object.__new__(cls)
return self
c = C()

and step into the C() code the the __new__ code, there is no problem.  Hence 
the revised title.

If I add slots make C, as with Fraction, there is still no problem.

class C():
__slots__ = ('a',)
def __new__(cls, a):
self = object.__new__(cls)
self.a = a
return self
c = C(1)

Puzzles:
1. Why does the next line, 'if denominator...' show up in the traceback?  It 
does not have a function call.  Why is it printed twice?
2. Where does the _numerator error happen?  It is only set, never accessed.  
Setting should work because _numerator is one of the two slots.
3. What extra feature of Fraction results in the failure.

If I leave IDLE's debugger off and invoke pdb by adding
import pdb; pbd.set_trace()
as line 2, before the Fraction call, stepping with s works on the line where 
Debugger failed.  Until a fix is released, use this (and/or print) as a 
workaround for code that makes debugger croak.

I do not now know how to write a fully automated unittest for debugger.  But it 
does not now even have a human-driven htest, and it should.

--
stage:  -> test needed
title: Probable bug in all python3 / idle3 debugger -> IDLE debugger fails with 
non-trivial __new__ super call
type: crash -> 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



[issue31650] implement PEP 552

2017-11-26 Thread Benjamin Peterson

Change by Benjamin Peterson :


--
keywords: +patch
pull_requests: +4503
stage: needs patch -> patch review

___
Python tracker 

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



[issue32107] test_uuid uses the incorrect bitmask

2017-11-26 Thread Barry A. Warsaw

Change by Barry A. Warsaw :


--
pull_requests: +4504

___
Python tracker 

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



[issue32107] test_uuid uses the incorrect bitmask

2017-11-26 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

PR #4576 includes all related changes.

--

___
Python tracker 

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



[issue32144] email.policy.SMTP and SMTPUTF8 doesn't honor linesep's value

2017-11-26 Thread Abhilash Raj

New submission from Abhilash Raj :

According to the documentation, email.policy.SMTP and .SMTPUTF8  should have 
CRLF (`\r\n`) as line endings for text/plain parts.

However, a new message parsed using message_from_binary_file with 
policy.SMTPUTF8 has `\n` as line endings for text/plain parts. This happens 
when I use get_content() on the new EmailMessage API.

Just to mention, in Python 2.7, the old `get_payload(decode=True)` returns the 
body with CRLF as line endings. However, in Python 3, `get_payload()` also 
returns '\n' as line endings.

Am I reading the documentation wrong?

--
components: email
messages: 307029
nosy: barry, maxking, r.david.murray
priority: normal
severity: normal
status: open
title: email.policy.SMTP and SMTPUTF8 doesn't honor linesep's value
type: behavior
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



[issue32051] Possible issue in multiprocessing doc

2017-11-26 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4505

___
Python tracker 

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



[issue32051] Possible issue in multiprocessing doc

2017-11-26 Thread Berker Peksag

Berker Peksag  added the comment:


New changeset c172fc5031a4035986bef0b2fcef906706d7abf3 by Berker Peksag (Jason 
Yang) in branch 'master':
bpo-32051: Fix name shadowing in multiprocessing docs (GH-4469)
https://github.com/python/cpython/commit/c172fc5031a4035986bef0b2fcef906706d7abf3


--

___
Python tracker 

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



[issue32051] Possible issue in multiprocessing doc

2017-11-26 Thread Berker Peksag

Berker Peksag  added the comment:


New changeset 8a957534f5182022ee8ac2dbaac4b4900dc98159 by Berker Peksag (Miss 
Islington (bot)) in branch '3.6':
bpo-32051: Fix name shadowing in multiprocessing docs (GH-4469)
https://github.com/python/cpython/commit/8a957534f5182022ee8ac2dbaac4b4900dc98159


--

___
Python tracker 

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



[issue32051] Possible issue in multiprocessing doc

2017-11-26 Thread Berker Peksag

Berker Peksag  added the comment:

Thanks!

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



[issue10544] yield expression inside generator expression does nothing

2017-11-26 Thread Nick Coghlan

Nick Coghlan  added the comment:

Cool, if you're OK with that behaviour, it actually makes this a lot easier, 
since it means:

1. Serhiy's patch is already sufficient for the final hard compatibility break
2. It can be readily adapted to emit either DeprecationWarning or SyntaxWarning 
for 3.7

--

___
Python tracker 

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



[issue32142] heapq.heappop - documentation misleading or doesn't work

2017-11-26 Thread Scott Queen

Scott Queen  added the comment:

Fair statement. "Properly sorted" was a poor choice. Seems that "if the
invariant is true as a precondition, it will be true as a postcondition" is
accurate and descriptive -  maybe with a caution that modifying the list
(heap) values by means other than the heapq functions are likely to render
the invariant false (the latter phrase being for somewhat newbies like me
who wouldn't realize this truth without having to learn it in the debugger).

On Sun, Nov 26, 2017 at 10:51 AM, abcdef  wrote:

>
> abcdef  added the comment:
>
> >  Perhaps heappop could say that the heap invariant is maintained if the
> heap is properly sorted before the heappop invocation.
>
> Honestly I like this wording less. "Properly sorted" would suggest sorted
> in the sense of heap.sort() [as the docs refer to this earlier], but the
> array doesn't have to be sorted; it's enough if it's a heap. The function
> always maintains the invariant - this means that if the invariant is true
> as a precondition, it will be true as a postcondition. Maybe you have a
> different idea?
>
> --
> nosy: +abcdef
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue10544] yield expression inside generator expression does nothing

2017-11-26 Thread Guido van Rossum

Guido van Rossum  added the comment:

Great. It should be a DeprecationWarning, since we're planning to disallow
it completely, right? IIRC SyntaxWarning is for syntax that we can't
deprecate.

--

___
Python tracker 

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



[issue32144] email.policy.SMTP and SMTPUTF8 doesn't honor linesep's value

2017-11-26 Thread Mark Sapiro

Change by Mark Sapiro :


--
nosy: +msapiro

___
Python tracker 

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



[issue32107] test_uuid uses the incorrect bitmask

2017-11-26 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Currently PR 4576 combines a bug fix and a new feature.

1. Removes wrong check and adds a verbose clarifying comment. This part should 
be backported to maintained versions.

2. Adds multiple explicit "return None". This is a minor improvement the 
quality of the code. Too minor for separate PR.

3. Makes methods for getting the address of the real network card preferring 
universally administered addresses and falling back to locally  administered 
address only if universally administered addresses are not found. This is a new 
feature. But are there computers that have both universally and locally 
administered addresses (and with locally administered addresses enumerated 
first)?

--

___
Python tracker 

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



[issue10544] yield expression inside generator expression does nothing

2017-11-26 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +4506

___
Python tracker 

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