[issue29988] with statements are not ensuring that __exit__ is called if __enter__ succeeds

2018-09-24 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
versions: +Python 3.8

___
Python tracker 

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



[issue34759] Possible regression in ssl module in 3.7.1 and master

2018-09-24 Thread Nathaniel Smith


Nathaniel Smith  added the comment:

Whoops, yep, I forgot it doesn't auto-close.

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



[issue34759] Possible regression in ssl module in 3.7.1 and master

2018-09-24 Thread Ned Deily


Ned Deily  added the comment:

This issue can now be closed, right?

--

___
Python tracker 

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



[issue31177] unittest mock's reset_mock throws an error when an attribute has been deleted

2018-09-24 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Adding Michael for thoughts on the fix and desired behavior. Removing 3.5 since 
only security fixes are accepted and adding 3.8 which is also affected.

Thanks

--
nosy: +michael.foord
versions: +Python 3.8 -Python 3.5

___
Python tracker 

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



[issue22079] Ensure in PyType_Ready() that base class of static type is static

2018-09-24 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> It would be good if PyType_Ready() will check that base class of static type 
> is static.

What's the rationale for this change? It's not explained in this bug report nor 
in the code.

--
nosy: +jdemeyer

___
Python tracker 

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



[issue34770] pyshellext.cpp: Possible null pointer dereference

2018-09-24 Thread Xiang Zhang


Change by Xiang Zhang :


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



[issue34683] Caret positioned wrong for SyntaxError reported by ast.c

2018-09-24 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

Wait, why did you make offsets 1-indexed? My suggestion was to make everything 
zero indexed...

--

___
Python tracker 

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



[issue34770] pyshellext.cpp: Possible null pointer dereference

2018-09-24 Thread miss-islington


miss-islington  added the comment:


New changeset 936d740ac0308fdcb87c11cbe87962d4fe06f5ab by Miss Islington (bot) 
in branch '3.6':
bpo-34770: Fix a possible null pointer dereference in pyshellext.cpp (GH-9497)
https://github.com/python/cpython/commit/936d740ac0308fdcb87c11cbe87962d4fe06f5ab


--

___
Python tracker 

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



[issue34770] pyshellext.cpp: Possible null pointer dereference

2018-09-24 Thread miss-islington


miss-islington  added the comment:


New changeset db23206367e2bfbbdfb29b7699f25a14ba353ae7 by Miss Islington (bot) 
in branch '3.7':
bpo-34770: Fix a possible null pointer dereference in pyshellext.cpp (GH-9497)
https://github.com/python/cpython/commit/db23206367e2bfbbdfb29b7699f25a14ba353ae7


--

___
Python tracker 

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



[issue34793] Remove support for "with (await asyncio.lock):"

2018-09-24 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Another discussion : 
https://github.com/python/cpython/pull/4753/files#r155656583

--

___
Python tracker 

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



[issue34770] pyshellext.cpp: Possible null pointer dereference

2018-09-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8958

___
Python tracker 

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



[issue34770] pyshellext.cpp: Possible null pointer dereference

2018-09-24 Thread miss-islington


miss-islington  added the comment:


New changeset f6c8007a29b95b3ea3ca687a9b4924769a696328 by Miss Islington (bot) 
(Zackery Spytz) in branch 'master':
bpo-34770: Fix a possible null pointer dereference in pyshellext.cpp (GH-9497)
https://github.com/python/cpython/commit/f6c8007a29b95b3ea3ca687a9b4924769a696328


--
nosy: +miss-islington

___
Python tracker 

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



[issue34770] pyshellext.cpp: Possible null pointer dereference

2018-09-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8959

___
Python tracker 

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



[issue34793] Remove support for "with (await asyncio.lock):"

2018-09-24 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I can see only around 3 results on GitHub with "with await asyncio.lock"  and 
just wanted to add it as a data point : 
https://github.com/search?utf8=%E2%9C%93=%22with+await+asyncio.lock%22=Code

--
nosy: +xtreak

___
Python tracker 

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



[issue34776] Postponed annotations break inspection of dataclasses

2018-09-24 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

fwiw, agreed that this should wait for 3.7.2.

--

___
Python tracker 

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



[issue34776] Postponed annotations break inspection of dataclasses

2018-09-24 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
nosy: +gregory.p.smith
versions: +Python 3.8

___
Python tracker 

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



[issue34786] ProcessPoolExecutor documentation reports wrong exception being raised

2018-09-24 Thread Xiang Zhang


Change by Xiang Zhang :


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



[issue32956] python 3 round bug

2018-09-24 Thread Ezio Melotti


Change by Ezio Melotti :


--
nosy: +ezio.melotti, mark.dickinson

___
Python tracker 

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



[issue34786] ProcessPoolExecutor documentation reports wrong exception being raised

2018-09-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8957

___
Python tracker 

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



[issue34700] typing.get_type_hints doesn't know about typeshed

2018-09-24 Thread Ben Darnell


Ben Darnell  added the comment:

Yeah, I think that would work at least for the sphinx use case. It seems like a 
strange partially-degraded mode and anything that needs structured access to 
the annotation would still need typeshed, but just getting the string would 
probably be enough for a lot of applications. In fact, sphinx *only* wants the 
string (AFAICT), so a separate method like get_type_hints_as_string() which 
stringifies everything even if it can be resolved might be a better route than 
an option to get_type_hints().

--

___
Python tracker 

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



[issue34788] ipaddress module fails on rfc4007 scoped IPv6 addresses

2018-09-24 Thread Jeremy McMillan


Jeremy McMillan  added the comment:

subclass workaround implementation example

https://github.com/isbm/salt/blob/976fe19d73ca6bf5df375eaa15d77ce4a5a54b7a/salt/_compat.py#L125

--

___
Python tracker 

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



[issue32956] python 3 round bug

2018-09-24 Thread Joshua Bronson


Joshua Bronson  added the comment:

This was so surprising to me that I had to check some other languages that I 
had handy. It turns out that not one of JavaScript, Ruby, Perl, C++, Java, Go, 
or Rust agrees with Python. In fact they all agreed with one another that 2.5 
should round to 3. Examples below.

I understand from 
https://github.com/cosmologicon/pywat/pull/40#discussion_r219962259 that "to 
always round up... can theoretically skew the data" but it's not clear why 
that's a good enough reason to differ from the "round" function in all these 
other languages (as opposed to e.g. offering this alternative behavior in some 
additional "round_unskewed" function).

I assume the rationale for having Python 3's "round" differ from that of so 
many other languages was written down when this decision was made, but I 
searched and couldn't find it. Could anyone link to it in a comment here?

And would it be worth including rationale and a larger callout in the 
https://docs.python.org/3/library/functions.html#round docs? The documentation 
of this behavior is a bit buried among other things, and the rationale for it 
is missing entirely.


$ node -e 'console.log(Math.round(2.5))'
3

$ ruby -e 'puts (2.5).round()'
3

$ perl -e 'use Math::Round; print round(2.5)'
3

$ cat test_round.cpp
#include 
#include 
int main(void) {
  printf("%f\n", round(2.5));
}
$ g++ test_round.cpp && ./a.out
3.00

$ cat TestRound.java
class TestRound {
  public static void main(String[] args) {
System.out.println(Math.round(2.5));
  }
}
$ javac TestRound.java && java TestRound
3

$ cat test_round.go
package main
import "fmt"
import "math"
func main() {
fmt.Println(math.Round(2.5))
}
$ go build test_round.go && ./test_round
3

$ cat test_round.rs
fn main() {
  println!("{}", (2.5_f64).round());
}
$ rustc test_round.rs && ./test_round
3

--
nosy: +jab

___
Python tracker 

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



[issue1529353] Squeezer - squeeze large output in IDLE's shell

2018-09-24 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Tal, if you think this is ready, I would like to get this in the upcoming 
releases.  I believe the deadline is midnight at the international dateline, 
which is noon UTC tomorrow, just over 9 hours from now. 

I decided that any suggestions I might have for the non-user-visible aspects of 
squeezer.py and test_squeezer.py can wait for later.  The best review of 
user-visible aspects will come from using it.

A second use of squeezer should be debugger's global and non-global('local') 
namespace displays.  The intended format is one name-value pair per line.  But 
values can be indefinitely large.  For this, we could skip the context menu 
(there is not one now), use a fixed trigger of n characters, and have 
double-click display to a popup Squeezer View.

I will come back to this in a couple of hours to see if you have responded.  I 
would write and merge a separate expanded news entry for idlelib/NEWS.txt.

--

___
Python tracker 

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



[issue34751] Hash collisions for tuples

2018-09-24 Thread Tim Peters


Tim Peters  added the comment:

And one more:

x = (x * mult) ^ t;

also appears to work equally well.  So, way back when, it appears we _could_ 
have wormed around the disaster du jour just by applying a shift-xor 
permutation to the raw hash results.

Note the implication:  if we believed our tuple hash worked OK before then (& 
we did), adding a shift-xor step would have changed nothing about it _except_ 
to permute the input space.  That alone was enough to repair the nested tuple 
problems.

Note that permutations are a bog standard way to improve algorithms with bad 
behaviors in some cases.  For example, at the end of the Mersenne Twister they 
do 4 permutations to improve otherwise-marginal results from "the real" 
pseudo-random generator:

y ^= (y >> 11);
y ^= (y << 7) & 0x9d2c5680U;
y ^= (y << 15) & 0xefc6U;
y ^= (y >> 18);
return y;

At this point I see no "good reason" to prefer any of

x = (x * mult) ^ t; // like Bernstein 33X & FNV-1
x = (x * mult) + t; // like Bernstein 33A
x = (x ^ t) * mult; // like FNV-1a

to any other.  In their _original_ contexts, they were applied to longish 
sequences of unsigned bytes.  But tuples used as keys and set elements are 
typically much shorter than strings, so results about how they worked in their 
original contexts are largely irrelevant for that reason too.

While lots of non-endcase testing is also needed, at this point I don't have 
any real fear about any of them.

As a sanity check,

x = (x * mult) | t;

is disastrous for all the endcase tests.  So I believe I really am compiling 
and running the code ;-)

--

___
Python tracker 

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



[issue34776] Postponed annotations break inspection of dataclasses

2018-09-24 Thread Yury Selivanov


Yury Selivanov  added the comment:

NP, Eric, take your time. I agree that the PR isn't simple and needs a very 
careful review.

--

___
Python tracker 

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



[issue34659] Inconsistency between functools.reduce & itertools.accumulate

2018-09-24 Thread Lisa Roach


Change by Lisa Roach :


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



[issue34776] Postponed annotations break inspection of dataclasses

2018-09-24 Thread Eric V. Smith


Eric V. Smith  added the comment:

Unfortunately, I'm not going to be able to give this the attention it deserves 
before the 3.7.1 cutoff. The changes are sufficiently tricky that I want to 
make sure I think through the issue in the appropriate detail.

Ned: I've made it not a release blocker. Please remove yourself as nosy if you 
don't care about this issue. I don't plan on making it a release blocker again, 
I just did that because it was so near the deadline.

Yury: Sorry for not being able to get delve in to it sufficiently. Thanks for 
your work on it.

I should be able to review this in the next few days, so we can get this in to 
3.7.2.

--
priority: release blocker -> 

___
Python tracker 

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



[issue34751] Hash collisions for tuples

2018-09-24 Thread Tim Peters


Tim Peters  added the comment:

Just noting that this Bernstein-like variant appears to work as well as the 
FNV-1a version in all the goofy ;-) endcase tests I've accumulated:

while (--len >= 0) {
y = PyObject_Hash(*p++);
if (y == -1)
return -1;
Py_uhash_t t = (Py_uhash_t)y;
t ^= t << 7;
x = x * mult + t;
}

They're identical except for the last line.  FNV-1a uses

 x = (x ^ t) * mult;

instead.

--

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2018-09-24 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The cutoff for PRs going into 3.7.0 was the rc1 on about 2018 May 15.  The 
first 3 PRs are for merges after that cutoff but before the 3.6.6/3.7.0 
release.  PR9549 adds an entry to master that was somehow omitted even though 
included in the backports to 3.7 and 3.6.

PR9550 updates 2.7 (rarely needed).  The next update to now.  If I merge 
anything else for 3.6.7/3.7.1, I might include NEWS in the PR.

--
stage: patch review -> needs patch

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2018-09-24 Thread miss-islington


miss-islington  added the comment:


New changeset 1ab9dfcfbe99d576b41209ca8ddbcacb682e4495 by Miss Islington (bot) 
in branch '3.6':
bpo-34162: Update idlelib/NEWS.txt to 2018-9-24. (GH-9551)
https://github.com/python/cpython/commit/1ab9dfcfbe99d576b41209ca8ddbcacb682e4495


--

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2018-09-24 Thread miss-islington


miss-islington  added the comment:


New changeset 65cc60b3687d33bfeda60b29a49a0708d4932b7b by Miss Islington (bot) 
in branch '3.7':
bpo-34162: Update idlelib/NEWS.txt to 2018-9-24. (GH-9551)
https://github.com/python/cpython/commit/65cc60b3687d33bfeda60b29a49a0708d4932b7b


--
nosy: +miss-islington

___
Python tracker 

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



[issue34751] Hash collisions for tuples

2018-09-24 Thread Tim Peters


Tim Peters  added the comment:

> advantage of my approach is that high-order bits become more
> important:

I don't much care about high-order bits, beyond that we don't systematically 
_lose_ them.  The dict and set lookup routines have their own strategies for 
incorporating high-order bits into the probe sequence, and those routines are 
the primary reason hash() exists in Python.

So there's scant reason to try to let high bits influence low bits (but good 
reason _not_ to, because - as explained before - the low-order bits are already 
in great shape for the important tuple component types).

Something else appears to be going on in this specific example, which has a 
very touchy set of hash codes:

> BEFORE:
> >>> L = [n << 60 for n in range(100)]; T = [(a,b,c) for a in L for b in L for 
> >>> c in L]; len(set(hash(x) for x in T))
> 50

Which is what I get too on (at least) a 64-bit build.

> AFTER:
> >>> L = [n << 60 for n in range(100)]; T = [(a,b,c) for a in L for b in L for 
> >>> c in L]; len(set(hash(x) for x in T))
> 100

Ditto.  However, I get exactly the same from the code I posted before, which 
has no right shifts at all.

More, if I take the code exactly as it exists today, and merely comment out the

mult += (Py_hash_t)(82520UL + len + len);

line, I also get a million distinct hash codes.

Half of the hash codes have bit 2**60 set, and apart from those all the hash 
codes have no bits set higher than 2**6.  Any number of accidents could cause 
the 2**60 bits to wipe each other out, and merely changing the sequence of 
multipliers was demonstrably enough to stop that.

Indeed, merely changing 82520 to 82524 in the current code is enough to get a 
million unique hash codes in this case.

--

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2018-09-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8956

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2018-09-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8955

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2018-09-24 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 16fba6231458cc1ff82db8695ee772b74131cc83 by Terry Jan Reedy in 
branch 'master':
bpo-34162: Update idlelib/NEWS.txt to 2018-9-24. (GH-9551)
https://github.com/python/cpython/commit/16fba6231458cc1ff82db8695ee772b74131cc83


--

___
Python tracker 

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



[issue34047] IDLE: on macOS, scroll slider 'sticks' at bottom of file

2018-09-24 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I opened #34796 for the scrollbar slider issues.

--
superseder:  -> Tkinter scrollbar issues on Mac.

___
Python tracker 

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



[issue34796] Tkinter scrollbar issues on Mac.

2018-09-24 Thread Terry J. Reedy


New submission from Terry J. Reedy :

#34047 was about scrollbar issues on MacOS in 3.7.0 and 3.6.6.  One was due to 
an IDLE bug, which was fixed on the issue.  Others, which can be demonstrated 
in the pure tkinter code below, are the subject of this issue.

1. Slider does not move properly when at top or bottom.
2. Clicking trough near slider at top or bottom has no effect.
See #34047 for more discussions and details.

Vlad Tudorache posted the code below as msg323349 of #34047 and attached as 
tktest.py, along with tkinter_scroll_issues.mov.
---

import tkinter

root = tkinter.Tk()

text = tkinter.Text(root)
vbar = tkinter.Scrollbar(root)

vbar.pack(side=tkinter.RIGHT, fill=tkinter.Y)
text.pack(side=tkinter.LEFT, fill=tkinter.BOTH, expand=1)

text.config(yscrollcommand=vbar.set)
vbar.config(command=text.yview)

lines = ['This is the line number %d.\n' % i for i in range(256)]
text.insert(tkinter.END, ''.join(lines))
 
def click_trace(event):
text.insert('%d.%d' % (1, 0), 'Clicked at (%d,%d) on %s.\n' % (event.x, 
event.y, vbar.identify(event.x, event.y)))

vbar.bind('', click_trace)

root.mainloop()
---

"Clicking at the top on the slider shows that the Scrollbar considers it as 
being on "through1" (in Tk the zone between the upper arrow and the "slider") 
and NOT on the "slider". Please, play with the script (python3 tktest.py) and 
see the results for yourselves."

--
components: Tkinter, macOS
messages: 326299
nosy: ned.deily, ronaldoussoren, serhiy.storchaka, terry.reedy, wordtech
priority: normal
severity: normal
stage: needs patch
status: open
title: Tkinter scrollbar issues on Mac.
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2018-09-24 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +8954

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2018-09-24 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 65fa1264a308a94e24afa76f41a68708a346738f by Terry Jan Reedy in 
branch '2.7':
[2.7] bpo-34162: Update 2.7 idlelib/NEWS.txt to 2018-9-24 (GH-9550)
https://github.com/python/cpython/commit/65fa1264a308a94e24afa76f41a68708a346738f


--

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2018-09-24 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +8953

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2018-09-24 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 5a606674edbf4a94370ee55b0906dd9bec83abb0 by Terry Jan Reedy in 
branch 'master':
bpo-34162: Add entry for idlelib/NEWS.txt already included for 3.6/3.7 (GH-9549)
https://github.com/python/cpython/commit/5a606674edbf4a94370ee55b0906dd9bec83abb0


--

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2018-09-24 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +8952
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



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

2018-09-24 Thread Neil Booth


Neil Booth  added the comment:

My library user reports:

I can't reproduce the issue with uvloop on linux. (looks like uvloop does not 
work on windows atm)

--

___
Python tracker 

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



[issue32892] Remove specific constant AST types in favor of ast.Constant

2018-09-24 Thread Neil Schemenauer


Neil Schemenauer  added the comment:

I've checked Quixote PTL module support.  I will have to make some changes to 
support the removal of Str and other node types.  E.g. I have to change 
visit_Str to visit_Constant.  The fixes are pretty easy though and I think it 
is reasonable that this kind of AST manipulation is dependent on Python version 
and may get broken between releases.

--

___
Python tracker 

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



[issue30064] BaseSelectorEventLoop.sock_{recv, sendall}() don't remove their callbacks when canceled

2018-09-24 Thread Yury Selivanov


Yury Selivanov  added the comment:

See also https://bugs.python.org/issue34795

--
nosy: +asvetlov
versions: +Python 3.8 -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



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

2018-09-24 Thread Neil Booth


Neil Booth  added the comment:

This seems related: https://bugs.python.org/issue30064

--

___
Python tracker 

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



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

2018-09-24 Thread Yury Selivanov


Yury Selivanov  added the comment:

Can you reproduce this with uvloop?

Andrew: I think we need to "lock" sockets from closing in sock_recv and friends 
the same way we do it in uvloop.

--

___
Python tracker 

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



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

2018-09-24 Thread Neil Booth


New submission from Neil Booth :

In certain circumstances the coroutine loop.sock_recv() registers a callback 
internally, which is called on e.g. task cancellation.  The callback assumes a 
file descriptor that was open and valid at the time the callback was registered 
is still open and valid when the callback is called, and this need not be the 
case.  For example, when client code handling exceptions (in particular, 
cancellation) closes the socket itself.

I have reports of this error for Python 3.6 and 3.7 by a user of my library 
which uses asyncio, and that bad things happen on both Windows (the event loop 
dies) and Linux (a traceback happens but no loop death).
It likely happens in earlier versions of Python too but my library requires >= 
Python 3.6

I hope the above description in addition to pointing out the problematic lines 
in asyncio make the bug clear.  I tried to produce a simplified testcase but it 
doesn't trigger the issue on Linux.  I am told it does trigger it on Windows (I 
don't have Windows to test on).

Here are the problematic lines in selector_events.py where the FD is 
registered; the callback above them assumes the DF remains valid (but the 
socket might have been closed in the meantime):

https://github.com/python/cpython/blob/master/Lib/asyncio/selector_events.py#L378-L380

The same problem is evident in sock_recv_into, and perhaps other calls.

Here is code I am told triggers the problem on Windows; it seems to require 
something a little more complex to trigger reliably on Unix platforms:


import asyncio
import socket


class MyProtocol(asyncio.Protocol):

def connection_made(self, transport):
transport.write(b'123')   # just in case a write is needed


port = 


async def connect_and_recv(loop, sock):
try:
await loop.sock_connect(sock, ('127.0.0.1', port))
while True:
await loop.sock_recv(sock, 20)
except asyncio.CancelledError:
print("Cancelled")
sock.close()


async def main(loop):
server = await loop.create_server(MyProtocol, '127.0.0.1', port)
sock = socket.socket()
sock.setblocking(False)
task = loop.create_task(connect_and_recv(loop, sock))
await asyncio.sleep(0.1)
task.cancel()
await asyncio.sleep(0.1)


loop = asyncio.get_event_loop()
loop.run_until_complete(main(loop))



Here are backtraces from a client application doing things more complex but 
similar in spirit to the snippet above:

  File 
"C:\Users\User\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py",
 line 455, in run_until_complete
self.run_forever()
  File 
"C:\Users\User\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py",
 line 422, in run_forever
self._run_once()
  File 
"C:\Users\User\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py",
 line 1398, in _run_once
event_list = self._selector.select(timeout)
  File 
"C:\Users\User\AppData\Local\Programs\Python\Python36-32\lib\selectors.py", 
line 323, in select
r, w, _ = self._select(self._readers, self._writers, [], timeout)
  File 
"C:\Users\User\AppData\Local\Programs\Python\Python36-32\lib\selectors.py", 
line 314, in _select
r, w, x = select.select(r, w, w, timeout)
OSError: [WinError 10038] An operation was attempted on something that is not a 
socket

and one for Linux:

Exception in callback BaseSelectorEventLoop._sock_recv(, 
True, , 5)
handle: , True, 
, 5)>
Traceback (most recent call last):
  File "/usr/lib/python3.6/asyncio/events.py", line 127, in _run
self._callback(*self._args)
  File "/usr/lib/python3.6/asyncio/selector_events.py", line 378, in _sock_recv
self.remove_reader(fd)
  File "/usr/lib/python3.6/asyncio/selector_events.py", line 342, in 
remove_reader
return self._remove_reader(fd)
  File "/usr/lib/python3.6/asyncio/selector_events.py", line 279, in 
_remove_reader
key = self._selector.get_key(fd)
  File "/usr/lib/python3.6/selectors.py", line 189, in get_key
return mapping[fileobj]
  File "/usr/lib/python3.6/selectors.py", line 70, in __getitem__
fd = self._selector._fileobj_lookup(fileobj)
  File "/usr/lib/python3.6/selectors.py", line 224, in _fileobj_lookup
return _fileobj_to_fd(fileobj)
  File "/usr/lib/python3.6/selectors.py", line 41, in _fileobj_to_fd
raise ValueError("Invalid file descriptor: {}".format(fd))
ValueError: Invalid file descriptor: -1

--
components: asyncio
messages: 326291
nosy: asvetlov, kyuupichan, yselivanov
priority: normal
severity: normal
status: open
title: loop.sock_recv failure because of delayed callback handling
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



[issue34781] infinite waiting in multiprocessing.Pool

2018-09-24 Thread Brett Cannon


Change by Brett Cannon :


--
nosy: +davin, pitrou

___
Python tracker 

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



[issue34751] Hash collisions for tuples

2018-09-24 Thread Tim Peters


Tim Peters  added the comment:

Jeroen, I understood the part about -2 from your initial report ;-)  That's why 
the last code I posted didn't use -2 at all (neither -1, which hashes to -2).  
None of the very many colliding tuples contained -2 in any form.  For example, 
these 8 tuples all have the same hash now:

(-4,  -4,  -4,  40)(-4,  -4,  4, -48)
( 4,   4,  -4,  40)( 4,   4,  4, -48)
(-4,  28, -28, -48)(-4,  28, 28,  40)
( 4, -28, -28, -48)( 4, -28, 28,  40)

Your last example (with (3, -2) and (-3, 0)) also implicitly relies on that:

j is even implies (j ^ -3) == -(j ^ 3)

There are apparently piles of similar identities :-(

I appreciate that

a*M + C = b*M + C (mod N)

implies

a = b (mod N)

when M is coprime to N, and also that the theory of linear combinations modulo 
2**K is far better known than the well-hidden theory FNV developed.

--

___
Python tracker 

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



[issue34794] memory leak in TkApp:_createbytearray

2018-09-24 Thread David Talkin


New submission from David Talkin :

The Tkinter.PhotoImage class leaks memory with each change of the 'data' 
Attribute due to Image calling tk._createbytearray, which allocates memory, but 
never frees it.

The offending method is in the TkApp class, _createbytearray().

--
components: Tkinter
messages: 326289
nosy: dtalkin
priority: normal
severity: normal
status: open
title: memory leak in TkApp:_createbytearray
type: resource usage
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



[issue34683] Caret positioned wrong for SyntaxError reported by ast.c

2018-09-24 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 025eb98dc0c1dc27404df6c544fc2944e0fa9f3a by Guido van Rossum 
(Ammar Askar) in branch 'master':
bpo-34683: Make SyntaxError column offsets consistently 1-indexed (gh-9338)
https://github.com/python/cpython/commit/025eb98dc0c1dc27404df6c544fc2944e0fa9f3a


--

___
Python tracker 

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



[issue34683] Caret positioned wrong for SyntaxError reported by ast.c

2018-09-24 Thread Guido van Rossum


Guido van Rossum  added the comment:

Hm, should this be backported? I think it's safest not to.

--

___
Python tracker 

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



[issue34683] Caret positioned wrong for SyntaxError reported by ast.c

2018-09-24 Thread Guido van Rossum


Guido van Rossum  added the comment:

Fixed by gh-9338. Thanks Ammar!

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



[issue34789] doc xml.sax.make_parser expects a list not just any sequence

2018-09-24 Thread Fred L. Drake, Jr.


Fred L. Drake, Jr.  added the comment:

The existing PR can be re-targeted to merge to a maintenance branch (I'd be 
inclined to merge manually, myself, but will have to check the current devguide 
to make sure that's still allowed).

A new PR can be made for the non-documentation fix for master.

My thought is that a PR is more about the patch than about the workflow; a 
different patch can be handled in a separate PR, and review & discussion are 
used to determine which PR should be applied where.

--

___
Python tracker 

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



[issue5950] Make zipimport work with zipfile containing comments

2018-09-24 Thread Zackery Spytz


Zackery Spytz  added the comment:

I've created a PR.

--
nosy: +ZackerySpytz
versions: +Python 3.8 -Python 3.6

___
Python tracker 

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



[issue5950] Make zipimport work with zipfile containing comments

2018-09-24 Thread Zackery Spytz


Change by Zackery Spytz :


--
pull_requests: +8951

___
Python tracker 

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



[issue34792] Tutorial doesn''t discuss / and * function arguments

2018-09-24 Thread Ezio Melotti


Change by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue34791] xml package does not obey sys.flags.ignore_environment

2018-09-24 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner

___
Python tracker 

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



[issue34789] doc xml.sax.make_parser expects a list not just any sequence

2018-09-24 Thread Andrés Delfino

Andrés Delfino  added the comment:

Admittedly, my Git-fu is not strong, but since the PR was opened against 
master, and given that the PR as is won't be merged to master, can it still be 
"backported" to 3.7, 3.6, and 2.7?

Shouldn't I update the PR so it can be merged to master (that won't be 
backported), and then open a new PR against 3.7 that will be backported to 3.6 
and 2.7?

--

___
Python tracker 

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



[issue34792] Tutorial doesn''t discuss / and * function arguments

2018-09-24 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

There is a related issue to document / in signatures though : 
https://bugs.python.org/issue21314

--
nosy: +xtreak

___
Python tracker 

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



[issue34793] Remove support for "with (await asyncio.lock):"

2018-09-24 Thread Yury Selivanov


New submission from Yury Selivanov :

Never mind, we do this already.  The question is then should we just remove the 
support for this syntax entirely in 3.8, or we should wait until 3.9?

--
title: Raise DeprecationWarning for "with (await lock):" -> Remove support for 
"with (await asyncio.lock):"

___
Python tracker 

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



[issue34790] Deprecate passing coroutine objects to asyncio.wait()

2018-09-24 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue34793] Raise DeprecationWarning for "with (await lock):"

2018-09-24 Thread Yury Selivanov


Change by Yury Selivanov :


--
components: asyncio
nosy: asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Raise DeprecationWarning for "with (await lock):"
versions: Python 3.8

___
Python tracker 

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



[issue34789] doc xml.sax.make_parser expects a list not just any sequence

2018-09-24 Thread Fred L. Drake, Jr.


Fred L. Drake, Jr.  added the comment:

It probably makes more sense to keep that PR for the maintenance branches, and 
create a new branch / PR to land on master.

--

___
Python tracker 

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



[issue34789] doc xml.sax.make_parser expects a list not just any sequence

2018-09-24 Thread Andrés Delfino

Andrés Delfino  added the comment:

I think it makes sense for make_parser to accept any iterable too. I'll update 
the PR when I have the testcase ready.

--

___
Python tracker 

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



[issue34751] Hash collisions for tuples

2018-09-24 Thread Tim Peters


Tim Peters  added the comment:

> when you do t ^= t << 7, then you are not changing
> the lower 7 bits at all.

I want to leave low-order hash bits alone.  That's deliberate.

The most important tuple component types, for tuples that are hashable, are 
strings and contiguous ranges of "not huge" ints.  The current string hash 
works hard to "act randomly" in every bit position - there's no point in trying 
to "improve" anything about the hashes it already produces.

In contrast, the hashes of any contiguous range of N not-huge integers 
(excluding -1) are already, by construction, guaranteed to have no collisions 
at all in their low-order (roughly) log2(N) bits.  They can't be improved in 
this respect, because they're already optimal in this respect.

So, if anything, I'd look at increasing the left shift rather than reducing it. 
 The low bits are already un-improvable in the most important cases.


> So applications using hash(x) % 128 will still see
> all the problems that we are trying to fix.

?  The only "problem" I've seen identified was in mixing positive and negative 
integers.  Here on a 32-build with the FNV-1a 32-bit multiplier:

>> from itertools import product
>> from collections import Counter
>> cands = list(range(-50, 51))
>> cands.remove(-1)
>> c = Counter()
>> for t in product(cands, repeat=4):
.. c[hash(t) & 0x7f] += 1
>>> len(c)
128

So all 128 lower 7-bit patterns showed up.  And they're quite evenly 
distributed:

>>> c2 = Counter(c.values())
>>> for k in sorted(c2):
... print(k, c2[k])
...
781202 1
781207 1
781209 2
781212 1
781213 2
781214 1
781215 4
781221 3
781222 1
781225 3
781226 1
781227 3
781228 2
781229 2
781230 1
781231 1
781232 2
781233 3
781234 1
781235 4
781236 2
781237 1
781238 2
781240 5
781241 6
781242 1
781243 1
781244 1
781245 1
781247 1
781248 2
781251 2
781252 4
781253 3
781254 5
781255 2
781256 2
781257 3
781259 2
781260 1
781261 1
781262 1
781263 2
781264 4
781265 2
781266 1
781267 1
781268 4
781269 1
781270 1
781271 2
781272 1
781274 2
781275 1
781276 1
781278 1
781280 1
781281 2
781282 2
781285 1
781286 2
781288 1
781295 1
781297 2
781301 1
781302 1
781304 1
781307 1

> With the standard FNV multiplier on 64 bits, I did
> get collisions while testing.

When testing what, specifically?  And the standard 32-bit FNV multiplier, or 
the standard 64-bit FNV multiplier?

> Instead, I chose 3**41 as multiplier. But of course,
> there are still plenty of bikeshedding opportunities
> for the multiplier...

Not for me.  If the universally used 64-bit FNV multiplier can't be used in the 
context of Python's tuple hash fiddled to use an almost-pure form of FNV-1a, 
then that approach is dead to me.  Needing to pick multipliers out of thin air 
instead implies the theory underlying FNV-1a doesn't transfer to this context.

About which I have no current opinion.  It may or may not.  Since we're flying 
blind, I'm just willing to _assume_ it does until proven otherwise by testing.

--

___
Python tracker 

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



[issue34792] Tutorial doesn''t discuss / and * function arguments

2018-09-24 Thread Mark Diekhans


New submission from Mark Diekhans :

https://docs.python.org/3/tutorial/controlflow.html doest not discuss / and * 
arguments (end of positional, keyword required)

--
assignee: docs@python
components: Documentation
messages: 326277
nosy: diekhans, docs@python
priority: normal
severity: normal
status: open
title: Tutorial doesn''t discuss / and * function arguments
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



[issue34778] Memoryview for column-major (f_contiguous) arrays from bytes impossible to achieve

2018-09-24 Thread mattip


mattip  added the comment:

This could be done via a `shape` kwarg to `cast`

--
nosy: +mattip

___
Python tracker 

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



[issue32528] Change base class for futures.CancelledError

2018-09-24 Thread Yury Selivanov


Yury Selivanov  added the comment:

> Closing this issue as I, personally, don't see this happening and there's no 
> point in keeping it open.

Actually, Andrew and I changed our opinion on this, so I'm re-opening the issue.

After visiting three conferences this summer and talking to asyncio users, it 
seems that this is a very serious pitfall.  At least 8 different people shared 
stories about really hard to debug problems caused by "except Exception" code 
blocking cancellation.

I now think we should fix this and make CancelledError a BaseException.  Doing 
that isn't as straightforward as it seems as we have to first fix how asyncio 
handles BaseExceptions (my next ToDo).

--
resolution: rejected -> 
stage: resolved -> 
status: closed -> open
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



[issue32528] Change base class for futures.CancelledError

2018-09-24 Thread Gustavo J. A. M. Carneiro


Gustavo J. A. M. Carneiro  added the comment:

What a shame, I've seen this error many times as well.

Surely making it BaseException will not break that much code?...

--
nosy: +gustavo

___
Python tracker 

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



[issue34791] xml package does not obey sys.flags.ignore_environment

2018-09-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8950

___
Python tracker 

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



[issue34791] xml package does not obey sys.flags.ignore_environment

2018-09-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8949

___
Python tracker 

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



[issue34791] xml package does not obey sys.flags.ignore_environment

2018-09-24 Thread miss-islington


miss-islington  added the comment:


New changeset 223e501fb9c2b6ae21b96054e20c4c31d94a5d96 by Miss Islington (bot) 
(Christian Heimes) in branch 'master':
bpo-34791: xml package obeys ignore env flags (GH-9544)
https://github.com/python/cpython/commit/223e501fb9c2b6ae21b96054e20c4c31d94a5d96


--
nosy: +miss-islington

___
Python tracker 

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



[issue34791] xml package does not obey sys.flags.ignore_environment

2018-09-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8948

___
Python tracker 

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



[issue34790] Deprecate passing coroutine objects to asyncio.wait()

2018-09-24 Thread Yury Selivanov


Yury Selivanov  added the comment:

> 4.0 is too far. Why not disallow them in 3.10?

What's the current plan?  I thought it's going to be 3.8, 3.9, 4.0.  Is there a 
PEP detailing this?

--

___
Python tracker 

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



[issue34790] Deprecate passing coroutine objects to asyncio.wait()

2018-09-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

4.0 is too far. Why not disallow them in 3.10?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue34334] QueueHandler logs exc_info twice

2018-09-24 Thread Vinay Sajip


Vinay Sajip  added the comment:

Having looked at it again, Adrian Dries might be right that setting exc_text to 
None will also do the trick, and perhaps in a better way. The reasoning:

Handler.format() formats record.msg % record.args, and caches it in 
record.message. If there is exception information, it will format that and 
cache it in record.exc_text, then append the exception text to the message and 
return that.

So prepare() calling

msg = self.format(record)

will return the complete message and exception text in msg, and record will 
have record.message = record.msg % record.args, and record.exc_info and 
record.exc_text will have exception info.

When preparing, the prepare() method pretends that the already-formatted 
message was logged - record.msg % record.args is equivalent to record.message 
with no args, so it does

record.msg = msg (contains formatted message + exception info)
record.args = None (since the args have already been used)
record.exc_info = None (since the exception info has already been used)

but I forgot that record.exc_text should also be zapped, as it should always 
reflect the contents of record.exc_info. So I think that setting 
record.exc_text to None is perhaps the correct thing to do here, as Adrian 
originally suggested.

There should be a test that specifically exercises this with a QueueHandler and 
QueueListener - test_queue_listener needs to test for this case in case a 
regression reappears.

The reason for converting record.msg, record.args, record.exc_info and 
record.exc_text to record.msg = fully formatted message, None, None and None is 
that the arguments and exception trace may not be pickleable, which is a 
consideration when using multiprocessing queues. Otherwise we could just have 
passed them over unchanged.

Are you OK with changing the PR in line with the above, Cheryl?

--

___
Python tracker 

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



[issue34364] problem with traceback for syntax error in f-string

2018-09-24 Thread Eric V. Smith


Eric V. Smith  added the comment:

It's more elaborate than I'd like, but I think it's the right way to solve it: 
I'm passing in the starting line and column number to the parser machinery.

--

___
Python tracker 

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



[issue31084] QueueHandler not formatting messages

2018-09-24 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
pull_requests: +8947

___
Python tracker 

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



[issue13607] Move generator specific sections out of ceval.

2018-09-24 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue34791] xml package does not obey sys.flags.ignore_environment

2018-09-24 Thread Christian Heimes


Change by Christian Heimes :


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

___
Python tracker 

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



[issue34790] Deprecate passing coroutine objects to asyncio.wait()

2018-09-24 Thread Yury Selivanov


Change by Yury Selivanov :


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

___
Python tracker 

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



[issue34364] problem with traceback for syntax error in f-string

2018-09-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Great! I was going to take it. Will be glad to make a review.

--

___
Python tracker 

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



[issue34791] xml package does not obey sys.flags.ignore_environment

2018-09-24 Thread Christian Heimes


New submission from Christian Heimes :

On two occasions, the xml package uses environment variables to override parser 
/ DOM implementations: xml.sax package and xml.dom.domreg module. On both 
occasions, the code should not use env vars to override module names, when the 
interpreter is started with flags like -E or -I.

--
components: XML
messages: 326267
nosy: christian.heimes
priority: normal
severity: normal
status: open
title: xml package does not obey sys.flags.ignore_environment
type: security
versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue34776] Postponed annotations break inspection of dataclasses

2018-09-24 Thread Eric V. Smith


Eric V. Smith  added the comment:

Ned: I'm marking this as a release blocker because I'd like to get it in 3.7.1. 
If I can't do that in the next 5 hours or so, I'll remove the release blocker 
tag.

--
assignee:  -> eric.smith
nosy: +ned.deily
priority: normal -> release blocker

___
Python tracker 

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



[issue34790] Deprecate passing coroutine objects to asyncio.wait()

2018-09-24 Thread Yury Selivanov


New submission from Yury Selivanov :

asyncio.wait() accepts coroutines, wraps them into Tasks, and later returns 
those implicitly created Tasks in (done, pending) sets.  This is very confusing 
to new asyncio users and it's almost impossible to figure out what is going on. 
 See the first PR to the docs for more info.

Andrew, I think we should deprecate passing coroutines to asyncio.wait() in 
3.8, and disallow that in 4.0.

--
components: asyncio
messages: 326265
nosy: asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Deprecate passing coroutine objects to asyncio.wait()
type: behavior

___
Python tracker 

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



[issue34372] Parenthesized expression has incorrect line numbers

2018-09-24 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Tracebacks should contain the first line of continuation lines
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



[issue34364] problem with traceback for syntax error in f-string

2018-09-24 Thread Eric V. Smith


Eric V. Smith  added the comment:

I worked on this at the core sprint, and I have a patch almost ready.

--

___
Python tracker 

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



[issue34364] problem with traceback for syntax error in f-string

2018-09-24 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue12458] Tracebacks should contain the first line of continuation lines

2018-09-24 Thread Serhiy Storchaka


Change 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



[issue34788] ipaddress module fails on rfc4007 scoped IPv6 addresses

2018-09-24 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2018-09-24 Thread Guido van Rossum


Guido van Rossum  added the comment:

Thanks, I have confirmed that this reproduces our issue and that your PR fixes 
it. I guess at this point we need someone to test with Brew.

--

___
Python tracker 

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



[issue34789] doc xml.sax.make_parser expects a list not just any sequence

2018-09-24 Thread Fred L. Drake, Jr.


Fred L. Drake, Jr.  added the comment:

I'm just going to presume this issue has been around a long time, but I think 
that's a pretty safe presumption.

Accepting a general sequence instead of only a list would reasonable, and I'd 
support a fix that caused the code to accept a general sequence (or any 
iterable) by calling list() on the passed-in value, starting with 3.8.

The patch provided looks good for versions in maintenance.  (It would also be 
fine for 3.8 if there's no interest in generalizing the code to accept 
arbitrary iterables).

--
nosy: +fdrake

___
Python tracker 

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



[issue34789] doc xml.sax.make_parser expects a list not just any sequence

2018-09-24 Thread Andrés Delfino

Change by Andrés Delfino :


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

___
Python tracker 

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



[issue26452] Wrong line number attributed to comprehension expressions

2018-09-24 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks much Greg for the details but I am closing this as fixed since there 
have been some improvements merged with issue12458 along with tests. The 
original issue reported regarding multi-line comprehension was fixed as I have 
tested it on https://bugs.python.org/issue26452#msg325985. I tested the patch 
but unfortunately had runtime errors. Feel free to reopen this if needed or any 
cases have been missed in the patch that you would like to make a PR.

Thanks :)

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



[issue34788] ipaddress module fails on rfc4007 scoped IPv6 addresses

2018-09-24 Thread Yury Selivanov


Change by Yury Selivanov :


--
nosy: +pmoody

___
Python tracker 

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



[issue34789] doc xml.sax.make_parser expects a list not just any sequence

2018-09-24 Thread Andrés Delfino

New submission from Andrés Delfino :

Doc says:

"If parser_list is provided, it must be a *sequence* of strings which name 
modules that have a function named create_parser()"

but code concatenas parser_list with an existing list:

for parser_name in parser_list + default_parser_list:

Fix this by stating parser_list must be a specific kind of sequence, that is, a 
list.

--
assignee: docs@python
components: Documentation
messages: 326261
nosy: adelfino, docs@python
priority: normal
severity: normal
status: open
title: doc xml.sax.make_parser expects a list not just any sequence
type: enhancement
versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue33977] [Windows] test_compileall fails randomly with PermissionError: [WinError 5] Access is denied: (...).pyc

2018-09-24 Thread STINNER Victor


Change by STINNER Victor :


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



[issue34037] asyncio: BaseEventLoop.close() shutdowns the executor without waiting causing leak of dangling threads

2018-09-24 Thread STINNER Victor


STINNER Victor  added the comment:

> Maybe.  At least we need to add a "timeout" argument to asyncio.run() to let 
> it wait for executor jobs.

The shutdown() method of concurrent.futures.Executor API doesn't accept a 
timeout. It waits for multiple things.

I added "block_on_close = True" class attribute to socketserver.ForkingMixIn 
and socketserver.ThreadingMixIn. By default, server_close() waits until all 
children complete, but the wait is non-blocking if block_on_close is false.

--

___
Python tracker 

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



  1   2   >