[issue37206] Incorrect application of Argument Clinic to dict.pop()

2019-06-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The code generated by Argument Clinic is correct.

>>> {}.pop(1)
Traceback (most recent call last):
  File "", line 1, in 
KeyError: 1
>>> {}.pop(1, None)

It is just a signature wrong. Some earlier versions of Argument Clinic allowed 
you to write "default=undefined" to specify an optional argument without 
default value, but this feature was lost a long time ago. So now signatures of 
some functions with optional arguments are false.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue34836] test_ssl.test_default_ecdh_curve needs no tls1.3 flag in 2.7, for now

2019-06-08 Thread Nick Coghlan


Nick Coghlan  added the comment:


New changeset 99b5c940d3471e0ed6579771d94e7342d7c733e0 by Nick Coghlan (Dimitri 
John Ledkov) in branch '2.7':
[2.7] bpo-34836: fix test_default_ecdh_curve, needs no tlsv1.3. (GH-9626)
https://github.com/python/cpython/commit/99b5c940d3471e0ed6579771d94e7342d7c733e0


--
nosy: +ncoghlan

___
Python tracker 

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



[issue37107] ensurepip --upgrade doesn't change the version of pip used by venv

2019-06-08 Thread Nick Coghlan


Nick Coghlan  added the comment:

Addressing the other part of Chris's initial post: there's also no 
`--upgrade-pip` option on `venv` itself.

Instead, there's only an `--upgrade` option that is intended for *Python* 
version upgrades, and restructures the internal layout of the venv to switch 
the Python major version number.

Unless you're using a Linux distro Python that has been patched to inject the 
external pip installation with rewheel or dirtbike, getting a venv that uses 
the externally updated version of pip requires running `python3 - m venv 
--system-site-packages --without-pip ...`.

So my suggestion there would be to:

- rename "venv --upgrade" to "venv --set-interpreter" (keeping `--upgrade` as a 
legacy alias)
- default to running `ensurepip --upgrade` with its new behaviour
- add `--network-upgrade/--no-network-upgrade` options which get passed 
straight through to the updated ensurepip

--

___
Python tracker 

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



[issue37107] ensurepip --upgrade doesn't change the version of pip used by venv

2019-06-08 Thread Nick Coghlan


Nick Coghlan  added the comment:

(Added packaging, Linux distro, and Windows and macOS installer folks to the cc 
list)

Chris and I were discussing this behaviour, and it turns out even I had 
forgotten how we had specified this feature in PEP 453: `ensurepip --upgrade` 
ensures that an older pip is brought up to date with the bundled version, but 
it does *not* check PyPI for the latest version the way that `python3 -m pip 
install --upgrade pip` does.

We both expected the ensurepip option to behave the same way as the pip option, 
since they share a name.

If I had the time machine keys, I'd use a more verbose name for the ensurepip 
flag (e.g. `--upgrade-to-match-bundle`) to help make it clearer that it does 
something different from the corresponding pip flag.

As it is though, for Python 3.9, I think we should change the behaviour of 
`--upgrade` to imply `python -m pip install --upgrade pip`, and then add a 
separate `--network-upgrade`/`--no-network-upgrade` option that allows folks to 
opt out of the PyPI part of the version check.

The make file would presumably be updated to pass the `--no-network-upgrade` 
flag, and I guess the macOS and Windows installers would as well (I'm not sure 
what the platform policies are around installers making random additional 
requests to external network services)

--
nosy: +barry, doko, dstufft, ncoghlan, ned.deily, paul.moore, petr.viktorin, 
steve.dower
stage:  -> needs patch
type:  -> enhancement
versions: +Python 3.9 -Python 3.7

___
Python tracker 

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



[issue37176] super() docs don't say what super() does

2019-06-08 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

On Sat, Jun 08, 2019 at 09:14:18PM +, Raymond Hettinger wrote:

> Ideally, the text can also be made more compact.  Having eight 
> paragraphs sends an implicit message that this is too complex to 
> understand and that it should be avoided.

But it is complex -- as you point out, there are *at least* seven 
potential misapprehensions here.

super does a lot: there are at least four ways to call it (zero-argument 
form, unbound super, class+instance and class+subclass). And as the old 
"super considered harmful" versus "super considered super" debate shows, 
there are pitfalls in multiple inheritance that people run into.

The challenge here is that for 95% of cases (plucking a number from thin 
air) using super is simple: just follow the example in the docs. But the 
remaining troublesome cases can be very troublesome, and people running 
into those cases do need to understand the gory details.

> One essential goal is that we need to overcome strong preconceptions 
> about about what super() might do versus what it actually does.
[...]

Here's two more that you missed:

- that you should call super with super(type(self), self);

- that unbound super objects dispatch to unbound methods.

At some point or another over the last decade I've misunderstood super 
to do almost all of those things. As this thread shows, I thought I had 
understood it but I still misunderstood the role of the class calling 
super.

--

___
Python tracker 

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



[issue37178] One argument form of math.perm()

2019-06-08 Thread Raymond Hettinger


Change by Raymond Hettinger :


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



[issue11122] bdist_rpm should use rpmbuild, not rpm

2019-06-08 Thread miss-islington


miss-islington  added the comment:


New changeset 3f7629d93c8cb3e0ee118c6a6463250f03d6c9f9 by Miss Islington (bot) 
in branch '3.8':
bpo-11122: fix hardcoded path checking for rpmbuild in bdist_rpm.py (GH-10594)
https://github.com/python/cpython/commit/3f7629d93c8cb3e0ee118c6a6463250f03d6c9f9


--
nosy: +miss-islington

___
Python tracker 

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



[issue37203] Correct classmethod emulation in Descriptor HowTo Guide

2019-06-08 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I'm going to close this because 1) I'm working on a somewhat major set of 
updates this guide already and 2) I think this tracker issue misses the point 
of what those guide is trying to do (communicating that the class is prepended 
to the argument stream but not trying to be a fully accurate drop in 
substitute).  The responsibility for describing in detail what @classmethod 
does belongs in libstdtypes.rst.  The goal in the descriptor how-to is to give 
an understanding of how descriptors work.

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



[issue37176] super() docs don't say what super() does

2019-06-08 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Yes, issue 23674 seems to be at least a partial duplicate.  We should just get 
this fixed and close both issues.

Ideally, the text can also be made more compact.  Having eight paragraphs sends 
an implicit message that this is too complex to understand and that it should 
be avoided.

One essential goal is that we need to overcome strong preconceptions about 
about what super() might do versus what it actually does.  Those with 
experience of super() in other languages tend to presume that it would be a 
keyword rather than a builtin type that needs to be instantiated, that it can 
only work within a class, that it has lower computational overhead than it 
does, that it only calls parents rather than siblings, that search order is 
controlled by the method using super() rather than the child instance, that 
operators will work, or that the search order is something is something other 
than the C3 algorithm.

The core challenge of documenting super() is that it is so different from what 
a person might imagine.

--

___
Python tracker 

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



[issue37203] Correct classmethod emulation in Descriptor HowTo Guide

2019-06-08 Thread Géry

Géry  added the comment:

@Raymond Hettinger

> Though less accurate, the current version communicates better

I agree that types.MethodType is more accurate but may be less understandable. 
But in this case I think that the Function class for emulating instance methods 
should not use types.MethodType either, but a custom newfunc function as well. 
And **kwargs parameters should be added to both newfunc functions.

--

___
Python tracker 

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



[issue11122] bdist_rpm should use rpmbuild, not rpm

2019-06-08 Thread Cheryl Sabella


Cheryl Sabella  added the comment:


New changeset 45a14942c969ed508b35abd5e116cb18f84ce5b4 by Cheryl Sabella 
(Marcin Niemira) in branch 'master':
bpo-11122: fix hardcoded path checking for rpmbuild in bdist_rpm.py (GH-10594)
https://github.com/python/cpython/commit/45a14942c969ed508b35abd5e116cb18f84ce5b4


--
nosy: +cheryl.sabella

___
Python tracker 

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



[issue11122] bdist_rpm should use rpmbuild, not rpm

2019-06-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13795
pull_request: https://github.com/python/cpython/pull/13922

___
Python tracker 

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



[issue11122] bdist_rpm should use rpmbuild, not rpm

2019-06-08 Thread Cheryl Sabella


Change by Cheryl Sabella :


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



[issue37202] Future.cancelled is not set to true immediately after calling Future.cancel

2019-06-08 Thread Roland Netzsch


Change by Roland Netzsch :


--
resolution:  -> not a bug

___
Python tracker 

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



[issue31652] make install fails: no module _ctypes

2019-06-08 Thread Jakub Wilk


Change by Jakub Wilk :


--
nosy: +jwilk

___
Python tracker 

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



[issue37206] Incorrect application of Argument Clinic to dict.pop()

2019-06-08 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +inada.naoki

___
Python tracker 

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



[issue37206] Incorrect application of Argument Clinic to dict.pop()

2019-06-08 Thread Raymond Hettinger


New submission from Raymond Hettinger :

help(dict.pop) was correct in 3.7:

pop(...)
D.pop(k[,d]) -> v

and incorrect for 3.8:

 pop(self, key, default=None, /)

This happened in:
 
https://github.com/python/cpython/commit/9e4f2f3a6b8ee995c365e86d976937c141d867f8
 https://github.com/python/cpython/pull/12792

We've long known that the Argument Clinic was not applicable to all functions 
and methods, including this one in particular.  The issue is that the one 
argument form does not set the default to None; rather, it triggers a KeyError 
when the key is missing.  In other words, there is an important and 
long-standing semantic difference between d.pop(k) and d.pop(k,None).

When reverting this change, please add a note about why the ArgumentClinic is 
not being applied to this function until its capabilities have been built-out 
to handle functions that have different behaviors depending on the number of 
arguments.

Also, we should review other recent applications of the ArgumentClinic to make 
sure they didn't make the same mistake.

--
components: Argument Clinic
keywords: 3.8regression
messages: 345062
nosy: larry, rhettinger
priority: high
severity: normal
status: open
title: Incorrect application of Argument Clinic to dict.pop()
versions: Python 3.8, Python 3.9

___
Python tracker 

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



[issue37091] subprocess - uncaught PermissionError in send_signal can cause hang

2019-06-08 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

even with that initially proposed patch, the subprocess.run code is going to 
hang if the .kill() fails without raising an exception:

The run() TimeoutExpired path calls communicate() after the kill to consume all 
remaining output: 
  https://github.com/python/cpython/blob/master/Lib/subprocess.py#L478

and the __exit__ code path calls wait().

both assume that the kill() succeeded because the normal case is not someone 
launching a child process that they are unable to kill (as happens when sudo or 
similar is used).

Today's workarounds: Don't use timeout when launching a child you cannot kill.  
OR  launch it via an intermediate process that you can kill (shell=True or 
equivalent).

To address this issue, catching a PermissionError exception around both of 
those kill() calls and preventing it from calling either communicate() or 
wait() as we cannot force the child process to exit makes sense.  With some 
indication that this happened left as a hint to the user on the TimeoutExpired 
itself.

--

___
Python tracker 

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



[issue34235] PyArg_ParseTupleAndKeywords: support required keyword arguments

2019-06-08 Thread Tal Einat


Tal Einat  added the comment:

How about allowing '|' to be used again after '$'? Keyword arguments would be 
optional by default, but if there is a '|' after the '$', then those before it 
are required.

Examples:
"O|O$O|O" -- one required keyword arg and one optional one.
"O|O$OO" -- both keyword args are optional.
"O|O$|OO" -- both keyword args are optional.
"O|O$OO|" -- both keyword args are required.

Pros:
1. Backwards-compatible with current notation.
2. No additional characters used as sigils.
3. Similar meaning as existing use of '|' to separate required and optional 
args.
4. Same order as for Python function.

Cons:
1. Need to scan to the end of the format string to figure out whether keyword 
args are optional or required.

--
nosy: +taleinat

___
Python tracker 

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



[issue37205] time.perf_counter() is not system-wide on Windows, in disagreement with documentation

2019-06-08 Thread Ken Healy


Ken Healy  added the comment:

Note that this offset subtraction behavior appears to be inherited from 
time.clock(), which did not make any guarantees about returning a system-wide 
value: 

https://github.com/python/cpython/commit/ec89539d6103665a7a5c7234cf09f27c1c72#diff-4a575e94d6ac98a0d82fd93509b6bfd3L91

--

___
Python tracker 

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



[issue36003] set better defaults for TCPServer options

2019-06-08 Thread Tal Einat


Tal Einat  added the comment:

I'm not sure that changing the default value for "reuse address" justifies 
breaking backwards compatibility like this. Admittedly, I'm not an expert on 
networking, so perhaps there's a good reason that I'm unaware of.

As for the queue size, passing 0 to socket.listen() does seem like a more 
reasonable default than the rather arbitrary value of 5. Again, it's arguable 
whether it's worth changing this given that it has been like this for a long 
time, but in this case at least the potential for harm seems negligible.

--
nosy: +taleinat

___
Python tracker 

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



[issue37205] time.perf_counter() is not system-wide on Windows, in disagreement with documentation

2019-06-08 Thread Ken Healy


New submission from Ken Healy :

The documentation for time.perf_counter() indicates it should return a 
system-wide value: https://docs.python.org/3/library/time.html#time.perf_counter

This is not true on Windows, as a process-specific offset is subtracted from 
the underlying QueryPerformanceCounter() value. The code comments indicate this 
is to reduce precision loss: 
https://github.com/python/cpython/blob/master/Python/pytime.c#L995-L997

This is relevant in multiprocess applications, where accurate timing is 
required across multiple processes. Here is a simple test case:

---
import concurrent.futures
import time

def worker():
return time.perf_counter()

if __name__ == '__main__':
pool = concurrent.futures.ProcessPoolExecutor()
futures = []
for i in range(3):
print('Submitting worker {:d} at time.perf_counter() == 
{:.3f}'.format(i, time.perf_counter()))
futures.append(pool.submit(worker))
time.sleep(1)

for i, f in enumerate(futures):
print('Worker {:d} started at time.perf_counter() == {:.3f}'.format(i, 
f.result()))
---

Output:
---
C:\...>Python37\python.exe -VV
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05)
[MSC v.1916 64 bit (AMD64)]

C:\...>Python37\python.exe perf_counter_across_processes.py
Submitting worker 0 at time.perf_counter() == 0.376
Submitting worker 1 at time.perf_counter() == 1.527
Submitting worker 2 at time.perf_counter() == 2.529
Worker 0 started at time.perf_counter() == 0.380
Worker 1 started at time.perf_counter() == 0.956
Worker 2 started at time.perf_counter() == 1.963
---

See my stackoverflow question for a comparison with Linux: 
https://stackoverflow.com/questions/56502111/should-time-perf-counter-be-consistent-across-processes-in-python-on-windows

--
assignee: docs@python
components: Documentation, Library (Lib), Windows
messages: 345057
nosy: docs@python, kh90909, paul.moore, steve.dower, tim.golden, vstinner, 
zach.ware
priority: normal
severity: normal
status: open
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue12144] cookielib.CookieJar.make_cookies fails for cookies with 'expires' set

2019-06-08 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
pull_requests: +13794
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/13921

___
Python tracker 

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



[issue36373] Deprecate explicit loop parameter in all public asyncio APIs

2019-06-08 Thread Emmanuel Arias


Change by Emmanuel Arias :


--
pull_requests: +13793
pull_request: https://github.com/python/cpython/pull/13920

___
Python tracker 

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



[issue37189] PyRun_String not exported in python38.dll

2019-06-08 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

It shouldn't break existing code because PyRun_String has a macro expansion to 
PyRun_StringFlags. ABI compatibility between major releases is not provded.

--

___
Python tracker 

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



[issue37176] super() docs don't say what super() does

2019-06-08 Thread Jeroen Demeyer

Jeroen Demeyer  added the comment:

> Some of the problems brought up here (which sibling or subclass, and which 
> parameter’s MRO) also came up a few years ago in Issue 23674.

Indeed. I would actually say that these two issues are duplicates of each other.

--

___
Python tracker 

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



[issue37178] One argument form of math.perm()

2019-06-08 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset feaceaafe816e95c4aff15eab0bea6dc2bbfe4fd by Raymond Hettinger 
(Miss Islington (bot)) in branch '3.8':
bpo-37178: Allow a one argument form of math.perm() (GH-13905) (GH-13919)
https://github.com/python/cpython/commit/feaceaafe816e95c4aff15eab0bea6dc2bbfe4fd


--

___
Python tracker 

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



[issue37178] One argument form of math.perm()

2019-06-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13792
pull_request: https://github.com/python/cpython/pull/13919

___
Python tracker 

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



[issue37178] One argument form of math.perm()

2019-06-08 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset e119b3d136bd94d880bce4b382096f6de3f38062 by Raymond Hettinger in 
branch 'master':
bpo-37178: Allow a one argument form of math.perm() (GH-13905)
https://github.com/python/cpython/commit/e119b3d136bd94d880bce4b382096f6de3f38062


--

___
Python tracker 

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



[issue37203] Correct classmethod emulation in Descriptor HowTo Guide

2019-06-08 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

This wasn't intended to be an exact equivalent. Instead, it focuses on the key 
action of classmethod which is prepending the class to the call.  Though less 
accurate, the current version communicates better.  I suggest adding a short 
comment to the effect that "newfunc" emulates "types.MethodType(self.f, klass)".

--

___
Python tracker 

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



[issue37203] Correct classmethod emulation in Descriptor HowTo Guide

2019-06-08 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee: docs@python -> rhettinger

___
Python tracker 

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



[issue37177] IDLE: Search dialogs can be hidden behind the main window

2019-06-08 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I saw the email, thanks for testing.

Irv, a reminder: All reports of IDLE UI behavior (and some of internal 
behavior) need to be tagged with OS.  Working 'cross-platform' does not mean 
'the same across platforms'.  In particular, tcl/tk long ago made a decision to 
adjust to platform conventions (which have sometimes changed ;-).  I should 
have asked 'what OS' when I saw your report.

--

___
Python tracker 

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



[issue37173] inspect.getfile error names module instead of passed class

2019-06-08 Thread miss-islington


miss-islington  added the comment:


New changeset 51c9cc73cb8768a691688755af0a8b6b12cf712c by Miss Islington (bot) 
in branch '3.7':
bpo-37173: Show passed class in inspect.getfile error (GH-13861)
https://github.com/python/cpython/commit/51c9cc73cb8768a691688755af0a8b6b12cf712c


--

___
Python tracker 

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



[issue37202] Future.cancelled is not set to true immediately after calling Future.cancel

2019-06-08 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

I don't follow what reliability guarantee are you requesting.

A cite from task.cancel() docstring:

> Request that this task cancel itself.

This arranges for a CancelledError to be thrown into the
wrapped coroutine on the next cycle through the event loop.
The coroutine then has a chance to clean up or even deny
the request using try/except/finally.

Unlike Future.cancel, this does not guarantee that the
task will be cancelled: the exception might be caught and
acted upon, delaying cancellation of the task or preventing
cancellation completely.  The task may also return a value or
raise a different exception.

Immediately after this method is called, Task.cancelled() will
not return True (unless the task was already cancelled).  A
task will be marked as cancelled when the wrapped coroutine
terminates with a CancelledError exception (even if cancel()
was not called).

task.cancelled() returns True for canceled and finished tasks, but 
task.cancel() is a request for cancellation. The requested task needs some time 
to gracefully finish itself.

--

___
Python tracker 

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



[issue34886] subprocess.run throws exception when input and stdin are passed as kwargs

2019-06-08 Thread miss-islington


miss-islington  added the comment:


New changeset 10b4fd98142edef6ab7b034e10ae5c9551043999 by Miss Islington (bot) 
in branch '3.7':
bpo-34886: Fix subprocess.run handling of exclusive arguments (GH-11727)
https://github.com/python/cpython/commit/10b4fd98142edef6ab7b034e10ae5c9551043999


--

___
Python tracker 

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



[issue37204] Scripts and binaries in PYTHON_PREFIX/Scripts contain unnecessarily lowercased path to Python location on Windows

2019-06-08 Thread Vlad Shcherbina


Vlad Shcherbina  added the comment:

https://github.com/pypa/pip/issues/6582

--

___
Python tracker 

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



[issue34886] subprocess.run throws exception when input and stdin are passed as kwargs

2019-06-08 Thread miss-islington


miss-islington  added the comment:


New changeset 6324ac1293b2cf71559869b88f89f510f9a62a8e by Miss Islington (bot) 
in branch '3.8':
bpo-34886: Fix subprocess.run handling of exclusive arguments (GH-11727)
https://github.com/python/cpython/commit/6324ac1293b2cf71559869b88f89f510f9a62a8e


--
nosy: +miss-islington

___
Python tracker 

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



[issue29505] Submit the re, json, & csv modules to oss-fuzz testing

2019-06-08 Thread miss-islington


miss-islington  added the comment:


New changeset 6692d35317a45905a043dccae3940ea5d5d84352 by Miss Islington (bot) 
in branch '3.7':
bpo-29505: Fix interpreter in fuzzing targets to be relocatable (GH-13907)
https://github.com/python/cpython/commit/6692d35317a45905a043dccae3940ea5d5d84352


--

___
Python tracker 

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



[issue29505] Submit the re, json, & csv modules to oss-fuzz testing

2019-06-08 Thread miss-islington


miss-islington  added the comment:


New changeset 22b69da4c38042e923d633530bdafc1b5fb94928 by Miss Islington (bot) 
in branch '3.8':
bpo-29505: Fix interpreter in fuzzing targets to be relocatable (GH-13907)
https://github.com/python/cpython/commit/22b69da4c38042e923d633530bdafc1b5fb94928


--
nosy: +miss-islington

___
Python tracker 

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



[issue37173] inspect.getfile error names module instead of passed class

2019-06-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13791
pull_request: https://github.com/python/cpython/pull/13918

___
Python tracker 

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



[issue37173] inspect.getfile error names module instead of passed class

2019-06-08 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Right, 3.8 not being released yet makes it different.

--

___
Python tracker 

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



[issue34886] subprocess.run throws exception when input and stdin are passed as kwargs

2019-06-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13790
pull_request: https://github.com/python/cpython/pull/13917

___
Python tracker 

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



[issue34886] subprocess.run throws exception when input and stdin are passed as kwargs

2019-06-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13789
pull_request: https://github.com/python/cpython/pull/13916

___
Python tracker 

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



[issue34886] subprocess.run throws exception when input and stdin are passed as kwargs

2019-06-08 Thread Gregory P. Smith

Gregory P. Smith  added the comment:


New changeset 8cc605acdda5aff250ab4c9b524a7560f90ca9f3 by Gregory P. Smith 
(Rémi Lapeyre) in branch 'master':
bpo-34886: Fix subprocess.run handling of exclusive arguments (GH-11727)
https://github.com/python/cpython/commit/8cc605acdda5aff250ab4c9b524a7560f90ca9f3


--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue37204] Scripts and binaries in PYTHON_PREFIX/Scripts contain unnecessarily lowercased path to Python location on Windows

2019-06-08 Thread Steve Dower


Steve Dower  added the comment:

This is due to how the pip.exe launcher is generated, which is part of pip 
itself (actually distlib, I think, but someone over there can redirect).

Please report this at https://github.com/pypa/pip

--
resolution:  -> third party
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



[issue10880] do_mkvalue and 'boolean'

2019-06-08 Thread Owais Kazi


Owais Kazi  added the comment:

If it's a easy patch, I would like to pick it up. Can someone please explain 
how should I proceed with this? I am already done with the setup.
TIA

--
nosy: +Owais Kazi
type: enhancement -> 

___
Python tracker 

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



[issue29505] Submit the re, json, & csv modules to oss-fuzz testing

2019-06-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13788
pull_request: https://github.com/python/cpython/pull/13915

___
Python tracker 

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



[issue29505] Submit the re, json, & csv modules to oss-fuzz testing

2019-06-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13787
pull_request: https://github.com/python/cpython/pull/13914

___
Python tracker 

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



[issue29505] Submit the re, json, & csv modules to oss-fuzz testing

2019-06-08 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset a15a7bcaea54e1845ab2abe27e6f583294cd715b by Gregory P. Smith 
(Ammar Askar) in branch 'master':
bpo-29505: Fix interpreter in fuzzing targets to be relocatable (GH-13907)
https://github.com/python/cpython/commit/a15a7bcaea54e1845ab2abe27e6f583294cd715b


--

___
Python tracker 

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



[issue37202] Future.cancelled is not set to true immediately after calling Future.cancel

2019-06-08 Thread Roland Netzsch


Roland Netzsch  added the comment:

So there is no way to reliably find out whether a task has been cancelled by 
calling Task.cancelled()?

--

___
Python tracker 

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



[issue37204] Scripts and binaries in PYTHON_PREFIX/Scripts contain unnecessarily lowercased path to Python location on Windows

2019-06-08 Thread Vlad Shcherbina


New submission from Vlad Shcherbina :

To reproduce:

1. Download and run Python installer (I used python-3.7.3-amd64-webinstall.exe).
2. Modify install settings:
   - Install for all users: yes
   - Customize install location: "C:\Python37"
   (don't know if it's relevant, mentioning it just in case)
3. Install.
4. Run the following commands:
pip --version
py -m pip --version

Expected result:

> pip --version
pip 19.0.3 from C:\Python37\lib\site-packages\pip (python 3.7)
> py -m pip --version
pip 19.0.3 from C:\Python37\lib\site-packages\pip (python 3.7)

Actual result:

> pip --version
pip 19.0.3 from c:\python37\lib\site-packages\pip (python 3.7)
> py -m pip --version
pip 19.0.3 from C:\Python37\lib\site-packages\pip (python 3.7)


Same happens for all binaries and scripts in PYTHON_PREFIX/Scripts, not only 
for pip.exe.

For example, if I install pytest (using "pip install pytest" or "py -m pip 
install pytest", doesn't matter), I get the following:

> pytest -v
 test session 
starts 
platform win32 -- Python 3.7.3, pytest-4.6.2, py-1.8.0, pluggy-0.12.0 -- 
c:\python37\python.exe
cachedir: .pytest_cache
rootdir: C:\temp\qqq
collected 0 items
=== no tests ran in 0.02 
seconds 

> py -m pytest -v
 test session 
starts 
platform win32 -- Python 3.7.3, pytest-4.6.2, py-1.8.0, pluggy-0.12.0 -- 
C:\Python37\python.exe
cachedir: .pytest_cache
rootdir: C:\temp\qqq
collected 0 items
=== no tests ran in 0.02 
seconds 

--
components: Distutils, Installation, Windows
messages: 345037
nosy: dstufft, eric.araujo, paul.moore, steve.dower, tim.golden, vlad, zach.ware
priority: normal
severity: normal
status: open
title: Scripts and binaries in PYTHON_PREFIX/Scripts contain unnecessarily 
lowercased path to Python location on Windows
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue37202] Future.cancelled is not set to true immediately after calling Future.cancel

2019-06-08 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

This is the expected behavior.

asyncio.ensure_future() returns not a future but a task for your case.
Task cancellation requires at least one context switch to finish the task.

P.S.
I suggest replacing `asyncio.ensure_future()` with `asyncio.create_task()` to 
avoid confusion.

--

___
Python tracker 

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



[issue37177] IDLE: Search dialogs can be hidden behind the main window

2019-06-08 Thread Tal Einat


Tal Einat  added the comment:

The issue Irv reported happened on macOS but not on Windows. I've reproduced 
his issue without this fix, and checked that this fix does indeed fix his issue.

For future reference, Irv also posted a video showing his issue on YouTube[1] 
(he sent a link to idle-dev).

[1] http://www.youtube.com/watch?v=YWDsOEN8qsE

--

___
Python tracker 

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



[issue37173] inspect.getfile error names module instead of passed class

2019-06-08 Thread miss-islington


miss-islington  added the comment:


New changeset c5daae4ef6d09269c95ed1023e76932cc179f309 by Miss Islington (bot) 
in branch '3.8':
bpo-37173: Show passed class in inspect.getfile error (GH-13861)
https://github.com/python/cpython/commit/c5daae4ef6d09269c95ed1023e76932cc179f309


--

___
Python tracker 

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



[issue37173] inspect.getfile error names module instead of passed class

2019-06-08 Thread Andrew Svetlov


Change by Andrew Svetlov :


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

___
Python tracker 

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



[issue37173] inspect.getfile error names module instead of passed class

2019-06-08 Thread miss-islington


miss-islington  added the comment:


New changeset d407d2a7265f6102e51a1d62b3fd28b4f7a78d16 by Miss Islington (bot) 
(Philipp A) in branch 'master':
bpo-37173: Show passed class in inspect.getfile error (GH-13861)
https://github.com/python/cpython/commit/d407d2a7265f6102e51a1d62b3fd28b4f7a78d16


--
nosy: +miss-islington

___
Python tracker 

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



[issue37173] inspect.getfile error names module instead of passed class

2019-06-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13786
pull_request: https://github.com/python/cpython/pull/13913

___
Python tracker 

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



[issue37173] inspect.getfile error names module instead of passed class

2019-06-08 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

I think landing the fix to 3.8 only is just fine

--
nosy: +asvetlov

___
Python tracker 

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



[issue37173] inspect.getfile error names module instead of passed class

2019-06-08 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue37203] Correct classmethod emulation in Descriptor HowTo Guide

2019-06-08 Thread Géry

New submission from Géry :

With the current Python equivalent `ClassMethod` implementation of 
`classmethod` given in Raymond Hettinger's _Descriptor HowTo Guide_, the 
following code snippet:

```
class A:
@ClassMethod
def f(cls, *, x): pass

print(A.f)
A.f(x=3)
```

prints:

> .newfunc at 0x106b76268>

and raises:

> TypeError: newfunc() got an unexpected keyword argument 'x'

instead of only printing:

> >

like the `@classmethod` decorator would do.

So the `ClassMethod` implementation fails in two regards:
* it does not return a bound method to a class;
* it does not handle keyword-only arguments.

With this PR `ClassMethod` will correctly emulate `classmethod`. This approach 
(`types.MethodType`) is already used in the Python equivalent `Function` 
implementation of functions given earlier in the same guide.

--
assignee: docs@python
components: Documentation
messages: 345031
nosy: docs@python, eric.araujo, ezio.melotti, maggyero, mdk, rhettinger, 
willingc
priority: normal
pull_requests: 13785
severity: normal
status: open
title: Correct classmethod emulation in Descriptor HowTo Guide
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue37202] Future.cancelled is not set to true immediately after calling Future.cancel

2019-06-08 Thread Roland Netzsch


Roland Netzsch  added the comment:

Python-Version:

[stuxcrystal@caprica ~]$ python3.7 --version
Python 3.7.3


Additional Notes:
Distribution: Fedora 30 (Workstation Edition)
Kernel: x86_64 Linux 5.0.9-301.fc30.x86_64

--

___
Python tracker 

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



[issue33071] Document that PyPI no longer requires 'register'

2019-06-08 Thread Cheryl Sabella


Change by Cheryl Sabella :


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

___
Python tracker 

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



[issue37202] Future.cancelled is not set to true immediately after calling Future.cancel

2019-06-08 Thread Roland Netzsch


New submission from Roland Netzsch :

The attached file produces the following output:

wait is still running
wait is not set to cancelled!
Awaiting cancelled future produced a CancelledError.

A look a the documentation does not suggest a need to await the future in order 
to make sure the cancelled-flag is being set.

--
components: asyncio
files: test.py
messages: 345029
nosy: Roland Netzsch, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Future.cancelled is not set to true immediately after calling 
Future.cancel
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48405/test.py

___
Python tracker 

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



[issue37176] super() docs don't say what super() does

2019-06-08 Thread Géry

Géry  added the comment:

@Steven D'Aprano

> But neither can it *only* look at the MRO of the second class, because that 
> would restart the search at the top of the hierarchy; also if type(second 
> argument) was the only thing that mattered, that would make the first 
> argument redundant and pointless.

Yes of course, but nobody states the opposite. Both parameters are necessary 
super(type1, obj-or-type2):

— the first one for getting the start class in the MRO, which is the class 
following type1 in the MRO;
— the second one for getting the MRO, which is type(obj).__mro__ if it is an 
instance of type1 or type2.__mro__ if it is a subclass of type1, and for 
binding the function into a method in a super(type1, obj).function expression 
(as you correctly said in your last message).

Guido's Python equivalent implementation of super() given in his 2002 paper 
Unifying types and classes in Python 2.2 is very informative:
https://www.python.org/download/releases/2.2.3/descrintro/#cooperation

All this confusion around super() shows that there is room for improvement in 
the documentation.

@Raymond Hettinger

> Please make a concrete proposal (a PR or somesuch).

I will try to make a PR this weekend if I find some time.

--

___
Python tracker 

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



[issue37176] super() docs don't say what super() does

2019-06-08 Thread Martin Panter

Martin Panter  added the comment:

Some of the problems brought up here (which sibling or subclass, and which 
parameter’s MRO) also came up a few years ago in Issue 23674.

--
nosy: +martin.panter

___
Python tracker 

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



[issue37188] Creating a ctypes array of an element with size zero causes "Fatal Python error: Floating point exception"

2019-06-08 Thread Stefan Krah


Change by Stefan Krah :


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



[issue37188] Creating a ctypes array of an element with size zero causes "Fatal Python error: Floating point exception"

2019-06-08 Thread Stefan Krah


Stefan Krah  added the comment:


New changeset 3d03a35ba0f162a350898100efc95fdf392070a2 by Stefan Krah (Miss 
Islington (bot)) in branch '3.8':
[3.8] bpo-37188: Fix a divide-by-zero in arrays of size-0 objects (#13911)
https://github.com/python/cpython/commit/3d03a35ba0f162a350898100efc95fdf392070a2


--

___
Python tracker 

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



[issue37188] Creating a ctypes array of an element with size zero causes "Fatal Python error: Floating point exception"

2019-06-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13784
pull_request: https://github.com/python/cpython/pull/13911

___
Python tracker 

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



[issue37188] Creating a ctypes array of an element with size zero causes "Fatal Python error: Floating point exception"

2019-06-08 Thread Stefan Krah


Stefan Krah  added the comment:


New changeset 48f190f79cd89f7ad4409b3c782e462368583309 by Stefan Krah (Eric 
Wieser) in branch '2.7':
[2.7] bpo-37188: Fix a divide-by-zero in arrays of size-0 objects (#13906)
https://github.com/python/cpython/commit/48f190f79cd89f7ad4409b3c782e462368583309


--

___
Python tracker 

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



[issue36520] Email header folded incorrectly

2019-06-08 Thread Abhilash Raj


Change by Abhilash Raj :


--
pull_requests: +13782
pull_request: https://github.com/python/cpython/pull/13909

___
Python tracker 

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



[issue36520] Email header folded incorrectly

2019-06-08 Thread Abhilash Raj


Change by Abhilash Raj :


--
pull_requests: +13783
pull_request: https://github.com/python/cpython/pull/13910

___
Python tracker 

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



[issue37188] Creating a ctypes array of an element with size zero causes "Fatal Python error: Floating point exception"

2019-06-08 Thread Ma Lin


Ma Lin  added the comment:

> 3.7/3.8 are done

3.7 and master (3.9) are done, 3.8 was missed.

--
nosy: +Ma Lin

___
Python tracker 

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



[issue18299] Change script_helper to use universal_newlines=True in _assert_python

2019-06-08 Thread hai shi


Change by hai shi :


--
pull_requests: +13781
pull_request: https://github.com/python/cpython/pull/13908

___
Python tracker 

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