[issue30345] test_gdb fails on Python 3.6 when built with LTO+PGO

2017-06-15 Thread Kubilay Kocak

Changes by Kubilay Kocak :


--
nosy: +koobs

___
Python tracker 

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



[issue30642] Fix leaks in idlelib

2017-06-15 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
resolution:  -> fixed
stage: needs patch -> 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



[issue30541] Add restricted mocks to the python unittest mocking framework

2017-06-15 Thread Berker Peksag

Berker Peksag added the comment:

I personally never need this feature before so I will add Michael and Robert to 
nosy list to take their opinions.

--
nosy: +berker.peksag, michael.foord, rbcollins
stage:  -> patch review

___
Python tracker 

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



[issue30176] curses attribute constants list is incomplete

2017-06-15 Thread Xiang Zhang

Changes by Xiang Zhang :


--
stage: patch review -> backport needed

___
Python tracker 

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



[issue30523] unittest: add --list-tests option to only display the list of test names, don't run tests

2017-06-15 Thread Louie Lu

Louie Lu added the comment:

Serhiy and Victor suggest moving this option to regrtest. open a new PR 2238 
addressed this.

Also, because moving into regrtest, some test that used `requires` will need to 
pass option when using it. e.g.:

  $ ./python -m test test.test_curses --list-cases -ucurses

otherwise, it will just passout and do nothing (maybe it should warn user?)

--
nosy: +louielu

___
Python tracker 

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



[issue30450] Pull Windows dependencies from GitHub rather than svn.python.org

2017-06-15 Thread Zachary Ware

Changes by Zachary Ware :


--
pull_requests: +2282

___
Python tracker 

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



[issue30523] unittest: add --list-tests option to only display the list of test names, don't run tests

2017-06-15 Thread Louie Lu

Changes by Louie Lu :


--
pull_requests: +2283

___
Python tracker 

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



[issue30450] Pull Windows dependencies from GitHub rather than svn.python.org

2017-06-15 Thread Zachary Ware

Zachary Ware added the comment:


New changeset cb8c0485ab1e3aeb4f64e76177aabbc6eba5a0ef by Zachary Ware in 
branch 'master':
bpo-30450: Add NEWS and whatsnew (GH-2236)
https://github.com/python/cpython/commit/cb8c0485ab1e3aeb4f64e76177aabbc6eba5a0ef


--

___
Python tracker 

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



[issue30450] Pull Windows dependencies from GitHub rather than svn.python.org

2017-06-15 Thread Zachary Ware

Changes by Zachary Ware :


--
pull_requests: +2281

___
Python tracker 

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



[issue30671] dict: simplify and improve lookup function

2017-06-15 Thread Tim Peters

Tim Peters added the comment:

Whatever the iteration, accept that it's necessary it reach every value in 
range(2**i) eventually.  The current scheme does that, for reasons already 
documented.  You seem to be overlooking the importance of this part:

"""
Note that because perturb is unsigned, if the recurrence is executed often 
enough perturb eventually becomes and remains 0.  At that point (very rarely 
reached) the recurrence is on (just) 5*j+1 again, and that's certain to find an 
empty slot eventually (since it generates every int in range(2**i), and we make 
sure there's always at least one empty slot).
"""

5 is the smallest multiplier (besides the degenerate 1) for which that's true 
for every power-of-2 modulus.  It doesn't matter how rare collisions are if you 
switch to a scheme for which it's _not_ always true:  then you risk an infinite 
loop failing to find an empty slot.

Also note that testing was not just done on "random" cases, but "on both normal 
and pathological cases".  For example, integer keys all of which have lots of 
trailing zero bits (there's a specific example of that too in the comments).  
The smaller PERTURB_SHIFT, the longer it takes to get the high-order bits into 
play - and the longer it takes to fall back to a pure "5*j+1" iteration, which 
is the part that's necessary for _correctness_.

--
nosy: +tim.peters

___
Python tracker 

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



[issue30176] curses attribute constants list is incomplete

2017-06-15 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 116dd5eba60a940b35db6aaf4e8c998ac30ad440 by Mariatta (Xiang 
Zhang) in branch 'master':
bpo-30176: Add missing curses cell attributes constants (GH-1302)
https://github.com/python/cpython/commit/116dd5eba60a940b35db6aaf4e8c998ac30ad440


--
nosy: +Mariatta

___
Python tracker 

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



[issue30681] email.utils.parsedate_to_datetime() should return None when date cannot be parsed

2017-06-15 Thread Tim Bell

Tim Bell added the comment:

My proposed solution (in https://github.com/python/cpython/pull/2229) is 
two-part:

1. change parsedate_to_datetime() to return None rather than raising an 
exception; and

2. change headerregistry.DateHeader.parse() to check for None being returned 
from parsedate_to_datetime(), and to add a defect; the datetime attribute is 
set to None (as if the Date header were missing), but the header still 
evaluates as a string to the supplied header value.

I'm not sure what the use case is for distinguishing between a missing Date 
header and an invalid date value, but can't that be distinguished by the 
different defects added to the header?

In any case, if I'm not fully grasping the context and parsedate_to_datetime() 
should continue to throw exceptions, then a slightly different modification to 
DateHeader to catch those exceptions would seem sensible, and would address my 
use case.

--

___
Python tracker 

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



[issue30681] email.utils.parsedate_to_datetime() should return None when date cannot be parsed

2017-06-15 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

I'm not sure it would be any better, but what about defining something like a 
DateFormatDefect and returning that?

--

___
Python tracker 

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



[issue30631] Warnings in VS2015 Update 3 32-Bit

2017-06-15 Thread Zachary Ware

Zachary Ware added the comment:

Thanks for the patch!

--
components: +Build
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue30631] Warnings in VS2015 Update 3 32-Bit

2017-06-15 Thread Zachary Ware

Zachary Ware added the comment:


New changeset c9318853bbe8d62cb72ed853b0ffb75311ea474c by Zachary Ware (Segev 
Finer) in branch 'master':
bpo-30631: Silence MSVC warnings in third-party code (GH-1963)
https://github.com/python/cpython/commit/c9318853bbe8d62cb72ed853b0ffb75311ea474c


--

___
Python tracker 

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



[issue30450] Pull Windows dependencies from GitHub rather than svn.python.org

2017-06-15 Thread Zachary Ware

Zachary Ware added the comment:


New changeset 51599e2bdd10ab77212a7cbb41a13ea70ee13da8 by Zachary Ware in 
branch 'master':
bpo-30450: Pull Windows dependencies from GitHub rather than svn (GH-1783)
https://github.com/python/cpython/commit/51599e2bdd10ab77212a7cbb41a13ea70ee13da8


--

___
Python tracker 

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



[issue28837] 2to3 does not wrap zip correctly

2017-06-15 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Backported to 3.6.

--
resolution:  -> fixed
stage: backport needed -> resolved
status: open -> closed
versions:  -Python 2.7

___
Python tracker 

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



[issue28837] 2to3 does not wrap zip correctly

2017-06-15 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 292b421d48ab91b0c68ea4040fc7371e7d6d610e by Mariatta in branch 
'3.6':
bpo-28837: Fix lib2to3 handling of map/zip/filter calls when followed with a 
'trailer', e.g. zip()[x] (GH-24) (GH-2235)
https://github.com/python/cpython/commit/292b421d48ab91b0c68ea4040fc7371e7d6d610e


--
nosy: +Mariatta

___
Python tracker 

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



[issue30671] dict: simplify and improve lookup function

2017-06-15 Thread Dmitry Rubanovich

Dmitry Rubanovich added the comment:

Yes, I do understand it.  

But the statement in lines 166, 167: "For any initial j in range(2**i), 
repeating that 2**i times generates each int in range(2**i) exactly once" does 
not hold when the perturb is added.  2**i times will not be enough to generate 
all elements of the ring when some of multipliers are zero-divisors.  

Specifically, if you use j=((5*j) + P + 1) mod 2**i, you are effectively 
multiplying by a zero divisors every time P = j mod 2.  And I don't mean "mod 
2**i."  I do mean "mod 2."  Which means anytime P (which changes a few times 
and eventually becomes 0), has the same parity as j, you are multiplying by a 
zero-divisor.  Because P is eventually 0, you will go through all the values 
**eventually**.  But for all values of P for which there is a P' such that 
P=/=P' and ((5*j) + P + 1) = ((5*j) + P' + 1) mod 2**i, the number of times 
you'll need to apply the function will be higher than 2**i.  And that's in the 
worst case scenario.

In the best case scenario, the collision probability can be gathered from 
looking at the values of my script printed by 
print_collision_counts(py3_6_1_lookdict_perturb).  It can be as low as ~1/20 
and as high as ~1/3 depending on the value of i.

The main speed up we are seeking is to avoid a collision early on.  And we are 
less concerned about collisions later on.  Anecdotally, if your dict has 256 
buckets, then the chance of collision is 1 in ~3.5.  Which is an improvement 
over 1 in 2, but still pretty high.  

Ok, how about this: to avoid the edge cases, unroll the 1st secondary hash key 
to use j = 2*j + P + 1.  So try to test for it before the loop.  But leave 5*j 
+ P + 1 in the loop as is.  

Although, to be honest if PERTURB_SHIFT is changed to 1 and we have a dict with 
a key that causes 64 collisions, this may be a good time to resize even if we 
are still sparse.  On the other hand, this might create an attack vector with 
some magic value which causes resizes of near empty dict's.  So maybe not...  
Certainly not without further analysis.

BTW, and it's mostly stylistic, but except for the "*hashpos = i & mask;" line 
in "find_empty_slot()", applying of the mask can be moved to "dk_get_index()".  
Again, I am looking at the released 3.6.1 code, so if this is already done, 
then never mind.

As another note, changing PERTURB_SHIFT to 1 causes a near-universal reduction 
in collisions (for all strategies).  So if nothing else, that's probably an 
improvement.

--
Added file: http://bugs.python.org/file46956/fewer_collisions_count.py

___
Python tracker 

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



[issue29478] email.policy.Compat32(max_line_length=None) not as documented

2017-06-15 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 820b71464c2c0e8cca1abfb5dfe47fa7f7ffec75 by Mariatta in branch 
'3.5':
[email] bpo-29478: Fix passing max_line_length=None from Compat32 policy 
(GH-595) (GH-2234)
https://github.com/python/cpython/commit/820b71464c2c0e8cca1abfb5dfe47fa7f7ffec75


--

___
Python tracker 

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



[issue28837] 2to3 does not wrap zip correctly

2017-06-15 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +2280

___
Python tracker 

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



[issue30620] textwrap: dedent contains logic that can never execute

2017-06-15 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


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



[issue30603] textwrap: declining indent level has no test case

2017-06-15 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


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

___
Python tracker 

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



[issue30620] textwrap: dedent contains logic that can never execute

2017-06-15 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 7a801839e9a88bdcac5aaab494b532230fcf7caa by Mariatta (Jonathan 
Eunice) in branch 'master':
bpo-30620: Remove dead lines from textwrap.dedent (GH-2064)
https://github.com/python/cpython/commit/7a801839e9a88bdcac5aaab494b532230fcf7caa


--
nosy: +Mariatta

___
Python tracker 

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



[issue30603] textwrap: declining indent level has no test case

2017-06-15 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 214f7eed7640f873223427c02a95a70775d2b396 by Mariatta (Jonathan 
Eunice) in branch 'master':
bpo-30603: add tests to textwrap.dedent (GH-2206)
https://github.com/python/cpython/commit/214f7eed7640f873223427c02a95a70775d2b396


--

___
Python tracker 

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



[issue30192] hashlib module breaks with 64-bit kernel and 32-bit user space

2017-06-15 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
resolution:  -> fixed
stage: backport needed -> resolved
status: open -> closed

___
Python tracker 

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



[issue29478] email.policy.Compat32(max_line_length=None) not as documented

2017-06-15 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +2279

___
Python tracker 

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



[issue29478] email.policy.Compat32(max_line_length=None) not as documented

2017-06-15 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +2278

___
Python tracker 

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



[issue30656] typo in PyModule_New documentation

2017-06-15 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
resolution:  -> fixed
stage: backport needed -> resolved
status: open -> closed

___
Python tracker 

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



[issue30656] typo in PyModule_New documentation

2017-06-15 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 0b13f58497d3a36d062c3b3b827abb05db5afbc1 by Mariatta in branch 
'3.5':
bpo-30656: Fix Python C API Module Objects documentation (GH-2170) (GH-2231)
https://github.com/python/cpython/commit/0b13f58497d3a36d062c3b3b827abb05db5afbc1


--

___
Python tracker 

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



[issue30656] typo in PyModule_New documentation

2017-06-15 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 6a90a124706b73824aebf5c2bd7b27daf82b2342 by Mariatta in branch 
'3.6':
bpo-30656: Fix Python C API Module Objects documentation (GH-2170) (GH-2230)
https://github.com/python/cpython/commit/6a90a124706b73824aebf5c2bd7b27daf82b2342


--

___
Python tracker 

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



[issue30529] Incorrect error messages for invalid whitespaces in f-string subexpressions

2017-06-15 Thread Eric V. Smith

Changes by Eric V. Smith :


--
pull_requests: +2277

___
Python tracker 

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



[issue30681] email.utils.parsedate_to_datetime() should return None when date cannot be parsed

2017-06-15 Thread R. David Murray

R. David Murray added the comment:

The problem is that if it returns None on parse failure, then you can't tell 
the difference between the header not existing and the date not being 
parseable.  I don't have a solution for this problem.  Suggestions welcome.  
(Note that this is only a problem in the new policy, where the parsing is done 
automatically; in the compat32 policy you have to apply parsedate yourself, so 
you can tell the difference between a non-existent header and a failed date 
parse).

--

___
Python tracker 

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



[issue30656] typo in PyModule_New documentation

2017-06-15 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +2276

___
Python tracker 

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



[issue30656] typo in PyModule_New documentation

2017-06-15 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +2275

___
Python tracker 

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



[issue30681] email.utils.parsedate_to_datetime() should return None when date cannot be parsed

2017-06-15 Thread Tim Bell

Changes by Tim Bell :


--
pull_requests: +2274

___
Python tracker 

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



[issue30671] dict: simplify and improve lookup function

2017-06-15 Thread INADA Naoki

INADA Naoki added the comment:

Firstly, do you understand the lookup without perturb?
It's documented here:
https://github.com/python/cpython/blob/258bfc462b1e58689b43f662a10e44ece3a10bef/Objects/dictobject.c#L161-L182

>>> n = 0; L = []
>>> for i in range(16):
...   L.append(n)
...   n = (n*5+1)%8
... 
>>> L
[0, 1, 6, 7, 4, 5, 2, 3, 0, 1, 6, 7, 4, 5, 2, 3]

>>> n = 0; L = []
>>> for i in range(16):
...   L.append(n)
...   n = (n*2+1)%8
... 
>>> L
[0, 1, 3, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7]

So you can't use 2.

--

___
Python tracker 

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



[issue694339] IDLE: Dedenting with Shift+Tab

2017-06-15 Thread Terry J. Reedy

Terry J. Reedy added the comment:

<> is a predefined virtual event. 
https://www.tcl.tk/man/tcl8.6/TkCmd/event.htm
I can't find <> listed there. I don't remember if I actually saw it 
before mentioning it.  While I like mimicking smart_indent, I don't know if we 
can dismiss Roger Serwy's concern in msg150059.

Tk on Ubuntu may report key name ISO_Left_Tab msg150059, but it is not 
cross-platform.  On Win 10 with either tk 8.5.15 (2.7) or 8.6.6 (3.6):
  _tkinter.TclError: bad event type or keysym "ISO_Left_Tab"
I don't think we need to use the only sometimes valid synonym.

As Sean Wolfe reported msg212906, Shift-Tab already dedents a single line by 
treating it as a region.  This issue is about removing the extra behavior we 
don't want, and blocking Control-[ from doing simplefied non-region single line 
dedents.  Smart_indent does this by intercepting Tab (which I believe need not 
be bound to <>.

When there is a selection within a line, smart_indent does not call 
dedent_region but deletes the selection and insert \t or spaces, but in the 
latter case, the cursor may not be left on a multiple of indent spaces.  This 
does not seem very useful. It is even less so because if the selection is 
within a word, tab invokes autocomplete instead of smart_indent.  This needs 
discussion on another issue.
---

Text editing tests: how to we do them both thoroughly and efficiently (in terms 
of both human writing and machine execution time)?

White box approach: Set up a class test fixture that defines cls.text = 
; put text in known state (content, cursor position, 
selection); call edit function (smart_indent, proposed smart dedent, etc); 
check resulting state (content, cursor, selection.  Repeat for multiple input 
state - output state pairs.  These tests break if the function name is changed 
and only test the function, which is, however, the main thing to be tested. 

Gray-box approach: Replace function calls with pseudoevents generated on the 
text widget.  Such tests would survive function name changes, break on 
pseudoevent name changes, and add a test of pseudoevent -- function binding. A 
black-box approach replaces pseudoevents with concrete events -- simulated key 
presses, mouse clicks, and menu selections.  These tests survive pseudoevent 
name changes and add a test of concrete -- pseudo event linkage.  They should 
only break if we change the user visible interface, which we seldom do. 

I think we should use all approaches in two sets of tests.  The first set would 
test multiple before and after states in subtests with a function call.  This 
would define and test the intended behavior of the function.  The second set 
would test one before and after state successively with a function call, 
pseudoevent generation, and concrete event generations, in this order.  (If the 
function call fails, the event tests are bound to fail.)  This would test the 
user interface and the links to the underlying function.

There are over 30 editing functions to test, and writing the above for all 
would be tedious.  After writing tests for a couple, we should write helper 
functions that embody the repetitive boilerplate.

An additional factor: The text edit functions, properly bound with a 
pseudoevent to the text instance, are not methods of the text instance (though 
they should be), but of the EditorWindow that also contains a Toplevel; Menu 
hierarchy; and a Frame that contains Scrollbars and a StatusBar, along with, 
finally, the MultiCall(Text) instance.  So the fixture setup must also provide 
provide an attribute for the method container.  Let us call it cls.widget.

In order to put EditFrames (a new subclass of Frame) on tabs, the Text methods 
will have to at least be transferred to the EditFrame.  It would be even better 
to transfer them to an IdleText subclass of MultiCall(Text) or possibly of 
Text.  (See Mark Roseman's suggestion of a MultiCall alternative in msg272070.) 
 After the setup code is changed to assign the new method container to 
cls.widget, the test methods should still run as they are.

--
assignee:  -> terry.reedy
priority: low -> normal
stage: patch review -> test needed
versions: +Python 3.6 -Python 2.7, Python 3.4, Python 3.5, Python 3.7

___
Python tracker 

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



[issue30671] dict: simplify and improve lookup function

2017-06-15 Thread Dmitry Rubanovich

Dmitry Rubanovich added the comment:

I am looking at the 3.6.1 code.  I am not trying to simulate the index lookup 
as the lookup function would do it.  

There is no point in that.  The point of the script is to detect collisions 
among perturbed secondary indexes rather than between primary hashes and 
secondary.  To that end, it applies the perturbed secondary hash function to 
**all** primary indexes and stores the results.  This allows to judge the 
quality of the secondary hash function.  The "old" one was bad because it 
automatically created collisions by multiplying by zero-divisors of the 2^k 
ring.  The one used in 3.6.1 is better because it  doesn't always do that, but 
it still multiplies by zero-divisors of the ring when h mod 2^k is equal to (h 
>> 5) mod 2^k.  This multiplication by zero-divisors of the 2^k ring is what 
produces collisions.  The script simply counts them.  

The later iterations of the loop are not very relevant.  They will almost 
certainly produce further collisions, but that's unavoidable.  

By the way, just as a test, I just changed the value of PERTURB_SHIFT to 1 and, 
in my proposed solution, it produced lower collision counts, after 3 runs of 
the loop, in virtually all rings (ie, mod all values of 2^k for k from 8 to 
20).  Intuitively it makes sense because there is less information loss.  But I 
don't have a formal proof as to why that should be.

--

___
Python tracker 

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



[issue30681] email.utils.parsedate_to_datetime() should return None when date cannot be parsed

2017-06-15 Thread Tim Bell

New submission from Tim Bell:

Python 3.6 documentation for email.utils.parsedate_to_datetime() says "Performs 
the same function as parsedate(), but on success returns a datetime." The docs 
for parsedate() say "If it succeeds in parsing the date...; otherwise None will 
be returned." By implication, parsedate_to_datetime() should return None when 
the date can't be parsed.

There are two different failure modes for parsedate_to_datetime():

1. When _parsedate_tz() fails to parse the date and returns None:

>>> from email.utils import parsedate_to_datetime
>>> parsedate_to_datetime('0')
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.6/email/utils.py", line 210, in parsedate_to_datetime
*dtuple, tz = _parsedate_tz(data)
TypeError: 'NoneType' object is not iterable


2. When _parsedate_tz() succeeds, but conversion to datetime.datetime fails:

>>> parsedate_to_datetime('Tue, 06 Jun 2017 27:39:33 +0600')
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.6/email/utils.py", line 214, in parsedate_to_datetime
tzinfo=datetime.timezone(datetime.timedelta(seconds=tz)))
ValueError: hour must be in 0..23


Note that this second case is the one that led me to this issue. I am using the 
email package to parse spam emails for subsequent analysis, and a certain group 
of spam emails contain invalid hour fields in their Date header. I don't 
require the invalid Date header to be converted to a datetime.datetime, but 
accessing email_message['date'] to access the header value as a string triggers 
the ValueError exception. I can work around this with a custom email policy, 
but the observed behaviour does seem to contradict the documented behaviour.

Also, in relation to https://bugs.python.org/issue15925, r.david.murray 
commented "Oh, and I'm purposely allowing parsedate_to_datetime throw 
exceptions.  I suppose that should be documented, but that's a separate issue." 
However, no argument for why parsedate_to_datetime throwing exceptions is 
desired was given.

--
components: email
messages: 296137
nosy: barry, r.david.murray, timb07
priority: normal
severity: normal
status: open
title: email.utils.parsedate_to_datetime() should return None when date cannot 
be parsed
type: behavior
versions: Python 3.5, Python 3.6

___
Python tracker 

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



[issue23890] assertRaises increases reference counter

2017-06-15 Thread STINNER Victor

Changes by STINNER Victor :


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



[issue23890] assertRaises increases reference counter

2017-06-15 Thread STINNER Victor

STINNER Victor added the comment:

Thank you Vjacheslav Fyodorov for your bug report! The bug should now be fixed 
in 3.5, 3.6 and master (future 3.7) branches.

Python 2.7 is not affected by the bug.

--

___
Python tracker 

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



[issue23890] assertRaises increases reference counter

2017-06-15 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 3dc573c8d19dc42ed786ca3237afdad183c41ca0 by Victor Stinner in 
branch '3.5':
Fix ref cycles in TestCase.assertRaises() (#193) (#2228)
https://github.com/python/cpython/commit/3dc573c8d19dc42ed786ca3237afdad183c41ca0


--

___
Python tracker 

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



[issue23890] assertRaises increases reference counter

2017-06-15 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2273

___
Python tracker 

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



[issue30673] Add -t option (timeout) to Tools/buildbot/test.bat for "AMD64 Windows8.1 Refleaks 3.x" buildbot

2017-06-15 Thread STINNER Victor

STINNER Victor added the comment:

Oh wait, it seems like I misunderstood how Tools/buildbot/test.bat works: 
unknown parameters as passed as if to regrtest. So it wasn't needed to add a 
new -t option, using --timeout should just work.

There were two bugs in the buildbot configuration:

* the default timeout was not set if no explicit timeout was configured per 
buildbot
* the timeout was not set on the class used by the "AMD64 Windows8.1 Refleaks 
3.x" buildbot

My following configuration change (already deployed on buildbot) fixes these 
two issues:
https://github.com/python/buildmaster-config/commit/cb5a90724c6a5e316f3b4f8c862bbda142cafc8d

--

___
Python tracker 

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



[issue30673] Add -t option (timeout) to Tools/buildbot/test.bat for "AMD64 Windows8.1 Refleaks 3.x" buildbot

2017-06-15 Thread STINNER Victor

STINNER Victor added the comment:

I added the -t options to 3.5, 3.6 and master (3.7) branches.

I have a small issue: in Python 2.7, regrtest has no --timeout option. In 
Python 3, the timeout was implemented using faulthandler, module which was 
added to Python 3.3.

I guess that we can handle 2.7 special case in the buildbot configuration.

--
versions: +Python 3.5, Python 3.6

___
Python tracker 

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



[issue23890] assertRaises increases reference counter

2017-06-15 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 50dbf577e10f806056d60ac956db0748d2cc8257 by Victor Stinner in 
branch '3.6':
bpo-23890: Fix ref cycle in TestCase.assertRaises (#858)
https://github.com/python/cpython/commit/50dbf577e10f806056d60ac956db0748d2cc8257


--

___
Python tracker 

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



[issue30675] test_zipfile leaks references on Python 3.5 on the wo Refleaks buildbots (Gentoo, Windows)

2017-06-15 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2272

___
Python tracker 

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



[issue30673] Add -t option (timeout) to Tools/buildbot/test.bat for "AMD64 Windows8.1 Refleaks 3.x" buildbot

2017-06-15 Thread STINNER Victor

STINNER Victor added the comment:


New changeset ab4ea09604ea7754a80e4fc36280f5772bf4a8b2 by Victor Stinner in 
branch '3.5':
bpo-30673: test.bat: add -t option (timeout) (#2211) (#2226)
https://github.com/python/cpython/commit/ab4ea09604ea7754a80e4fc36280f5772bf4a8b2


--

___
Python tracker 

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



[issue30673] Add -t option (timeout) to Tools/buildbot/test.bat for "AMD64 Windows8.1 Refleaks 3.x" buildbot

2017-06-15 Thread STINNER Victor

STINNER Victor added the comment:


New changeset e064d4dfeda09fd206653697b70b434e98cc1b57 by Victor Stinner in 
branch '3.6':
bpo-30673: test.bat: add -t option (timeout) (#2211) (#2225)
https://github.com/python/cpython/commit/e064d4dfeda09fd206653697b70b434e98cc1b57


--

___
Python tracker 

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



[issue30675] test_zipfile leaks references on Python 3.5 on the wo Refleaks buildbots (Gentoo, Windows)

2017-06-15 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 33cf0c4cd6e8abe138c3469ca9ec1502410945f0 by Victor Stinner in 
branch '3.5':
bpo-30675: Fix multiprocessing code in regrtest (#2220)
https://github.com/python/cpython/commit/33cf0c4cd6e8abe138c3469ca9ec1502410945f0


--

___
Python tracker 

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



[issue30675] test_zipfile leaks references on Python 3.5 on the wo Refleaks buildbots (Gentoo, Windows)

2017-06-15 Thread STINNER Victor

STINNER Victor added the comment:

Ok, using attached test_x.py, I'm able to reproduce this bug on Python 2.7.

--
Added file: http://bugs.python.org/file46955/test_x.py

___
Python tracker 

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




[issue30673] Add -t option (timeout) to Tools/buildbot/test.bat for "AMD64 Windows8.1 Refleaks 3.x" buildbot

2017-06-15 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2271

___
Python tracker 

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



[issue30673] Add -t option (timeout) to Tools/buildbot/test.bat for "AMD64 Windows8.1 Refleaks 3.x" buildbot

2017-06-15 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2270

___
Python tracker 

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



[issue30680] textwrap should treat Unicode em-dash like ASCII em-dash

2017-06-15 Thread Jonathan Eunice

Jonathan Eunice added the comment:

Agreed. It makes great sense that textwrap started as highly ASCII-centric. But 
in the Python 3, Unicode-friendly era, ASCII-biased isn't where we should leave 
things.

--

___
Python tracker 

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



[issue30680] textwrap should treat Unicode em-dash like ASCII em-dash

2017-06-15 Thread R. David Murray

R. David Murray added the comment:

This seems sensible to me (I haven't looked at the PR, I'm talking about adding 
the support).  When textwrap was written python was pretty ascii oriented, so 
it is not too much of a surprise that unicode em dashes were not supported.

--
nosy: +r.david.murray
stage:  -> patch review

___
Python tracker 

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



[issue30680] textwrap should treat Unicode em-dash like ASCII em-dash

2017-06-15 Thread Jonathan Eunice

Changes by Jonathan Eunice :


--
pull_requests: +2269

___
Python tracker 

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



[issue29606] urllib FTP protocol stream injection

2017-06-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Wouldn't be better to solve this issue on the level of the ftplib module or FTP 
handler in urllib.request instead of urllib.parse?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue30680] textwrap should treat Unicode em-dash like ASCII em-dash

2017-06-15 Thread Jonathan Eunice

New submission from Jonathan Eunice:

The textwrap module goes to great lengths to "do the right thing" when it finds 
the ASCII simulation of an em-dash (two or more consecutive hyphens), but it 
does nothing to recognize and similarly treat true (Unicode) em-dashes (aka 
'\N{EM DASH}', '\u2014', or U+2014). Real em-dashes should get at least as good 
a treatment as simulated em-dashes.

--
components: Library (Lib)
messages: 296124
nosy: jonathaneunice
priority: normal
severity: normal
status: open
title: textwrap should treat Unicode em-dash like ASCII em-dash
type: enhancement
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



[issue1360] Queue.get() can't be interrupted with Ctrl-C unless timed out

2017-06-15 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +2268

___
Python tracker 

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



[issue26491] Defer DECREFs until enum object is in a consistent state for re-entrancy

2017-06-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
status: open -> pending

___
Python tracker 

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



[issue30213] ZipFile from 'a'ppend-mode file generates invalid zip

2017-06-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This looks a duplicate of issue29094.

--
status: open -> pending
superseder:  -> Regression in zipfile writing in 2.7.13

___
Python tracker 

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



[issue30441] os.environ raises RuntimeError: dictionary changed size during iteration

2017-06-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See also issue24484. The solution depends on the assumption that list(dict) is 
atomic.

--

___
Python tracker 

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



[issue30626] "SystemError: returned NULL without setting an error" from open function

2017-06-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue30673] Add -t option (timeout) to Tools/buildbot/test.bat for "AMD64 Windows8.1 Refleaks 3.x" buildbot

2017-06-15 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 258bfc462b1e58689b43f662a10e44ece3a10bef by Victor Stinner in 
branch 'master':
bpo-30673: test.bat: add -t option (timeout) (#2211)
https://github.com/python/cpython/commit/258bfc462b1e58689b43f662a10e44ece3a10bef


--

___
Python tracker 

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



[issue30626] "SystemError: returned NULL without setting an error" from open function

2017-06-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 263dcc39daa74066c2b2fcb007a4bd4f7ec65073 by Serhiy Storchaka in 
branch '3.5':
[3.5] bpo-30626: Fix error handling in PyImport_Import(). (GH-2103) (#)
https://github.com/python/cpython/commit/263dcc39daa74066c2b2fcb007a4bd4f7ec65073


--

___
Python tracker 

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



[issue30626] "SystemError: returned NULL without setting an error" from open function

2017-06-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset fab05de21480fc54a5101cf813195cb32724b5ad by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-30626: Fix error handling in PyImport_Import(). (GH-2103) (#2221)
https://github.com/python/cpython/commit/fab05de21480fc54a5101cf813195cb32724b5ad


--

___
Python tracker 

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



[issue30626] "SystemError: returned NULL without setting an error" from open function

2017-06-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +2267

___
Python tracker 

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



[issue30626] "SystemError: returned NULL without setting an error" from open function

2017-06-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +2266

___
Python tracker 

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



[issue30626] "SystemError: returned NULL without setting an error" from open function

2017-06-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 145541cfa05394c38cfd64c0be2c5fb382860995 by Serhiy Storchaka in 
branch 'master':
bpo-30626: Fix error handling in PyImport_Import(). (#2103)
https://github.com/python/cpython/commit/145541cfa05394c38cfd64c0be2c5fb382860995


--

___
Python tracker 

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



[issue30676] [Windows] Potential for GIL deadlock on Windows in threadmodule acquire_lock

2017-06-15 Thread Stephan R.A. Deibel

Stephan R.A. Deibel added the comment:

I think I misunderstood the implementation of EnterNonRecursiveMutex -- the 
mutex that could block there is the internal 'cs' mutex, which would only be 
held only briefly while Enter/LeaveNonRecursiveMutex are running, and it looks 
like the 'cs' mutex is released before doing anything that blocks (in the two 
impls of PyCOND_WAIT and PyCOND_TIMEDWAIT).

So my report is invalid and I'm closing it.  Sorry about that!

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue30625] Documentation is unclear how "y*" and "y#" format units vary

2017-06-15 Thread Gregory Szorc

Gregory Szorc added the comment:

IMO I don't find the 3.2 docs more useful. Specifically, the behavior for 
memoryview is still unclear.

--

___
Python tracker 

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



[issue30465] FormattedValue expressions have wrong lineno and col_offset information

2017-06-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
Removed message: http://bugs.python.org/msg296115

___
Python tracker 

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



[issue30465] FormattedValue expressions have wrong lineno and col_offset information

2017-06-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
Removed message: http://bugs.python.org/msg296114

___
Python tracker 

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



[issue30465] FormattedValue expressions have wrong lineno and col_offset information

2017-06-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It causes segfault also with unpatched Python.

--

___
Python tracker 

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



[issue30465] FormattedValue expressions have wrong lineno and col_offset information

2017-06-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The last example causes a segfault with current PR.

>>> import ast
>>> ast.parse(r"""
... f'''\
... \
... {x}\
... \
... '''
... """)
python: Python/ast.c:4994: FstringParser_ConcatFstring: Assertion 
`!state->last_str || PyUnicode_GET_LENGTH(state->last_str) != 0' failed.

--

___
Python tracker 

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



[issue30676] [Windows] Potential for GIL deadlock on Windows in threadmodule acquire_lock

2017-06-15 Thread Steve Dower

Steve Dower added the comment:

We recently tried switching the GIL implementation on Windows by changing the 
setting you refer to. It didn't work, so we didn't keep the change, but I don't 
recall the details - likely the same issue you bring up here.

I don't have the other issue number handy right now, but it may be worth trying 
to find it. We should be able to switch to the OS implementation of condition 
variables, and I'd expect performance improvement, but we need to resolve these 
issues first.

--

___
Python tracker 

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



[issue30679] __aexit__ not called when `run_until_complete` is interrupted by SIGINT

2017-06-15 Thread Yury Selivanov

Yury Selivanov added the comment:

Yes, this is a known limitation of asyncio -- keyboardinterrupt exceptions 
kills the loop rather abruptly. One way to handle this is to use 
'signal.signal' for sigint to raise custom exception instead of 
keyboardinterrupt.

--

___
Python tracker 

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



[issue30603] textwrap: declining indent level has no test case

2017-06-15 Thread Emily Morehouse

Emily Morehouse added the comment:

Looks great, thanks for the updates.

Mariatta, can you get this merged in?

--

___
Python tracker 

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



[issue30679] __aexit__ not called when `run_until_complete` is interrupted by SIGINT

2017-06-15 Thread Arthur Darcet

Arthur Darcet added the comment:

Ok, thank you. I'm guessing the patch I proposed in the PR is not an option, 
for my curiosity, why is that?

--

___
Python tracker 

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



[issue30675] test_zipfile leaks references on Python 3.5 on the wo Refleaks buildbots (Gentoo, Windows)

2017-06-15 Thread STINNER Victor

STINNER Victor added the comment:

It seems like Python 3.6 and master (3.7) are not impacted by this bug, thanks 
to my rework on regrtest (now libregrtest) in Python 3.6.

It's unclear to me if Python 2.7 has the bug: I don't see the warm_caches() 
function.

--

___
Python tracker 

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



[issue30675] test_zipfile leaks references on Python 3.5 on the wo Refleaks buildbots (Gentoo, Windows)

2017-06-15 Thread STINNER Victor

STINNER Victor added the comment:

I succeeded to reproduce the bug, but only when running the -jN option, like:

./python -m test -j2 -R 3:3 test_zipfile

I reduced the test to:

./python -m test -j2 -R 3:3 test_zipfile -m test_random_open

This test heavily use random.randint().

In fact, the bug doesn't come from test_zipfile, but it's an issue Python 
singleton objects. There is a bug in regrtest which doesn't call 
warmup_caches() in worker processes when using the -jN option (multiprocessing 
mode).

My PR https://github.com/python/cpython/pull/2220 should fix the bug.

Sadly, I didn't backport test_regrtest functional tests from master to 3.5 yet: 
see bpo-30383.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue30675] test_zipfile leaks references on Python 3.5 on the wo Refleaks buildbots (Gentoo, Windows)

2017-06-15 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2265

___
Python tracker 

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



[issue30677] Enhance documentation of os.mkdir()

2017-06-15 Thread R. David Murray

R. David Murray added the comment:

We don't generally document all exceptions that a method can raise, only those 
that are relevant to its specific API.  In this case, documenting the exception 
answers the question, "what happens if the directory already exists?"  This 
question is relevant to the API since the other reasonable possibility is that 
it would act as if the mkdir had succeeded.  As for documenting OSError, I'm 
sure there are ways to get os.mkdir to raise an exception that is not an 
OSError.

However, there is an argument to be made for documenting FileNotFound: the 
other reasonable thing the function could do in that case would be to create 
all intermediate path parts, but it does not do that (you use os.makedirs for 
that).  Since os.makedirs is documented right after os.mkdir, I'm not sure it 
is worth adding, but one can make the argument :)

--
nosy: +r.david.murray

___
Python tracker 

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



[issue30679] __aexit__ not called when `run_until_complete` is interrupted by SIGINT

2017-06-15 Thread Arthur Darcet

New submission from Arthur Darcet:

Here is the example code I am running:

```
import asyncio

class it:
async def __aenter__(self):
return self
async def __aexit__(self, *_):
print('EXIT')

async def main():
async with it():
await asyncio.sleep(100)

asyncio.get_event_loop().run_until_complete(main())
```


When this gets interrupted by a SIGINT, I would expect this code to display 
`EXIT` before the `KeyboardInterrupt` stacktrace. But instead the `__aexit__` 
function is simply not called.

--
components: asyncio
messages: 296106
nosy: rthr, yselivanov
priority: normal
pull_requests: 2264
severity: normal
status: open
title: __aexit__ not called when `run_until_complete` is interrupted by SIGINT
versions: Python 3.5, 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



[issue30627] Incorrect error message for a few functions called with keywod argument

2017-06-15 Thread SylvainDe

Changes by SylvainDe :


--
pull_requests: +2263

___
Python tracker 

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



[issue20627] Add context manager support to xmlrpc.client.ServerProxy

2017-06-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
Removed message: http://bugs.python.org/msg296105

___
Python tracker 

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



[issue20627] Add context manager support to xmlrpc.client.ServerProxy

2017-06-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 96c7c0685045b739fdc5145018cddfd252155713 by Serhiy Storchaka 
(Sylvain) in branch 'master':
bpo-20627: Fix error message when keyword arguments are used (#2115)
https://github.com/python/cpython/commit/96c7c0685045b739fdc5145018cddfd252155713


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue30627] Incorrect error message for a few functions called with keywod argument

2017-06-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
stage: needs patch -> 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



[issue29721] "abort: repository . not found!" during the build of Python 2.7

2017-06-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The issue no longer reproduced.

--
resolution:  -> out of date
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



[issue30602] [Windows] os.spawn*() tests of test_os leak references on Windows

2017-06-15 Thread STINNER Victor

STINNER Victor added the comment:

It seems like I introduced a bug:
https://github.com/python/cpython/pull/2184#pullrequestreview-44308536

--

___
Python tracker 

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



[issue30149] inspect.signature() doesn't support partialmethod without explicit self parameter

2017-06-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue30149] inspect.signature() doesn't support partialmethod without explicit self parameter

2017-06-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset fb0825c2784f80689c4c00c3ede22958faaf512c by Serhiy Storchaka 
(Dong-hee Na) in branch '3.5':
bpo-30149: Fix partialmethod without explicit self parameter (#1308) (#1663)
https://github.com/python/cpython/commit/fb0825c2784f80689c4c00c3ede22958faaf512c


--

___
Python tracker 

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



[issue30149] inspect.signature() doesn't support partialmethod without explicit self parameter

2017-06-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset e45ea377b8d9ae23893d4587003c6d3e7f54b99a by Serhiy Storchaka 
(Dong-hee Na) in branch '3.6':
bpo-30149: Fix partialmethod without explicit self parameter (#1308) (#1662)
https://github.com/python/cpython/commit/e45ea377b8d9ae23893d4587003c6d3e7f54b99a


--

___
Python tracker 

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



[issue30678] Widget variable binding does not work if mainloop is called from a different function

2017-06-15 Thread Javier Dehesa

New submission from Javier Dehesa:

When you build a Tkinter interface with variables, if tkinter.Tk.mainloop is 
called from a different function that the one creating the variable objects, 
then in some cases the widgets associated with the variables will not be set to 
the right value. I have not been able to find a consistent pattern, but I have 
some examples.

The following script works correctly:
```
import tkinter as tk
from tkinter import ttk

def make_var_cb(root):
v = tk.BooleanVar(root, True)
cb = ttk.Checkbutton(root, text='Checkbutton', variable=v)
cb.pack()
root.mainloop()

if __name__ == '__main__':
root = tk.Tk()
make_var_cb(root)
```

But the following does not (the result is shown in the attached image):
```
import tkinter as tk
from tkinter import ttk

def make_var_cb(root):
v = tk.BooleanVar(root, True)
cb = ttk.Checkbutton(root, text='Checkbutton', variable=v)
cb.pack()

if __name__ == '__main__':
root = tk.Tk()
make_var_cb(root)
root.mainloop()
```

However, the following _does_ work again:
```

def make_var(root):
return tk.BooleanVar(root, True)

def make_cb(root, v):
return ttk.Checkbutton(root, text='Checkbutton', variable=v)

if __name__ == '__main__':
root = tk.Tk()
v = make_var(root)
cb = make_cb(root, v)
cb.pack()
root.mainloop()
```

--
components: Tkinter, Windows
files: checkbutton_bad.png
messages: 296100
nosy: Javier Dehesa, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Widget variable binding does not work if mainloop is called from a 
different function
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file46954/checkbutton_bad.png

___
Python tracker 

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



[issue29931] ipaddress.ip_interface __lt__ check seems to be broken

2017-06-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
stage: backport needed -> resolved
status: open -> closed

___
Python tracker 

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



[issue30605] re.compile fails when compiling bytes under `-bb` mode

2017-06-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
stage: backport needed -> resolved
status: open -> closed

___
Python tracker 

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



[issue30650] lack of right parentheses

2017-06-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
stage: backport needed -> resolved
status: open -> closed

___
Python tracker 

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



[issue29931] ipaddress.ip_interface __lt__ check seems to be broken

2017-06-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset c5a6fb654a280c7b17f1d348e2e40d62ca04c5d3 by Serhiy Storchaka in 
branch '3.5':
[3.5] bpo-29931 fix __lt__ check in ipaddress.ip_interface for both v4 and v6. 
(GH-879) (#2218)
https://github.com/python/cpython/commit/c5a6fb654a280c7b17f1d348e2e40d62ca04c5d3


--

___
Python tracker 

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



[issue29931] ipaddress.ip_interface __lt__ check seems to be broken

2017-06-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset cf58dfb44cc11d41ea1473cd7436618b210b8258 by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-29931 fix __lt__ check in ipaddress.ip_interface for both v4 and v6. 
(GH-879) (#2217)
https://github.com/python/cpython/commit/cf58dfb44cc11d41ea1473cd7436618b210b8258


--

___
Python tracker 

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



  1   2   >