[issue38061] FreeBSD: Optimize subprocess.Popen(close_fds=True) using closefrom()

2019-09-09 Thread STINNER Victor


New submission from STINNER Victor :

The default value of subprocess.Popen "close_fds" parameter changed to True in 
Python 3. Compared to Python 2, close_fds=True can make Popen 10x slower: see 
bpo-37790.

A single close(fd) syscall is cheap. But when MAXFDS (maximum file descriptor 
number) is high, the loop calling close(fd) on each file descriptor can take 
several milliseconds.

On FreeBSD, the _posixsubprocess could use closefrom() to reduce the number of 
syscalls.

On Linux, _posixsubprocess lists the content of /proc/self/fd/ to only close 
open file descriptor, after fork() and before exec().

--
components: Library (Lib)
messages: 351351
nosy: vstinner
priority: normal
severity: normal
status: open
title: FreeBSD: Optimize subprocess.Popen(close_fds=True) using closefrom()
type: enhancement
versions: Python 3.9

___
Python tracker 

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



[issue37790] subprocess.Popen() is extremely slow

2019-09-09 Thread STINNER Victor


STINNER Victor  added the comment:

I create bpo-38061 "FreeBSD: Optimize subprocess.Popen(close_fds=True) using 
closefrom()".

--

___
Python tracker 

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



[issue38061] FreeBSD: Optimize subprocess.Popen(close_fds=True) using closefrom()

2019-09-09 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +koobs

___
Python tracker 

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



[issue38061] FreeBSD: Optimize subprocess.Popen(close_fds=True) using closefrom()

2019-09-09 Thread STINNER Victor


STINNER Victor  added the comment:

A workaround is to use close_fds=False which is only safe if all code used in 
Python implements the PEP 446.

This PEP mentions the FreeBSD issue, mentioning bpo-11284 with MAXFD=655,000:

"The operation can be slow if MAXFD is large. For example, on a FreeBSD 
buildbot with MAXFD=655,000, the operation took 300 ms: see issue #11284: slow 
close file descriptors."

Note: the subprocess module is now able to use posix_spawn() syscall, but it 
doesn't use it if close_fds=True, so it's outside the scope of this issue.

--

___
Python tracker 

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



[issue13788] os.closerange optimization

2019-09-09 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-38061: "FreeBSD: Optimize subprocess.Popen(close_fds=True) using 
closefrom()".

--

___
Python tracker 

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



[issue27898] regexp performance degradation between 2.7.6 and 2.7.12

2019-09-09 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
status: open -> pending

___
Python tracker 

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



[issue38061] FreeBSD: Optimize subprocess.Popen(close_fds=True) using closefrom()

2019-09-09 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-13788: "os.closerange optimization".

--

___
Python tracker 

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



[issue34410] itertools.tee not thread-safe; can segfault interpreter when wrapped iterator releases GIL

2019-09-09 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +15391
pull_request: https://github.com/python/cpython/pull/15736

___
Python tracker 

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



[issue38061] FreeBSD: Optimize subprocess.Popen(close_fds=True) using closefrom()

2019-09-09 Thread STINNER Victor


STINNER Victor  added the comment:

> On Linux, _posixsubprocess lists the content of /proc/self/fd/ to only close 
> open file descriptor, after fork() and before exec().

This code is specific to Linux because it uses the SYS_getdents64 syscall.

FreeBSD has a similar concept using /dev/fd "file-descriptor file system". See 
fdescfs manual page:
https://www.freebsd.org/cgi/man.cgi?query=fdescfs&sektion=5

I'm not sure how it is supposed to work. When I open a file in Python, I don't 
see its file descriptor in /dev/fd:

vstinner@freebsd$ python3
Python 3.6.9 (default, Aug  8 2019, 01:16:42) 
>>> import os
>>> os.listdir("/dev/fd")
['0', '1', '2']
>>> f=open("/etc/motd")
>>> os.listdir("/dev/fd")
['0', '1', '2']
>>> f.fileno()
3

>>> os.set_inheritable(f.fileno(), True)
>>> os.listdir("/dev/fd")
['0', '1', '2']

>>> import sys, subprocess
>>> rc=subprocess.call([sys.executable, "-c", "import os; 
>>> print(os.listdir('/dev/fd')); print(os.fstat(3))"], close_fds=False)
['0', '1', '2']
os.stat_result(st_mode=33188, st_ino=321134, st_dev=83, st_nlink=1, st_uid=0, 
st_gid=0, st_size=899, st_atime=1568014491, st_mtime=1566390614, 
st_ctime=1566390614)


The file descriptor 3 is not listed in /dev/fd/. It is inherited: fstat(3) in a 
child process doesn't fail and it's not listed in /dev/fd/ in the child process.

--

___
Python tracker 

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



[issue38061] FreeBSD: Optimize subprocess.Popen(close_fds=True) using closefrom()

2019-09-09 Thread STINNER Victor


STINNER Victor  added the comment:

Oh, _posixsubprocess uses /dev/fd/ on FreeBSD, but only if it's mounted file 
system (expected to be fdescfs filesystem):

#if defined(__FreeBSD__) || (defined(__APPLE__) && defined(__MACH__))
# define FD_DIR "/dev/fd"
#else
# define FD_DIR "/proc/self/fd"
#endif

#if defined(__FreeBSD__)
/* When /dev/fd isn't mounted it is often a static directory populated
 * with 0 1 2 or entries for 0 .. 63 on FreeBSD, NetBSD and OpenBSD.
 * NetBSD and OpenBSD have a /proc fs available (though not necessarily
 * mounted) and do not have fdescfs for /dev/fd.  MacOS X has a devfs
 * that properly supports /dev/fd.
 */
static int
_is_fdescfs_mounted_on_dev_fd(void)
{
struct stat dev_stat;
struct stat dev_fd_stat;
if (stat("/dev", &dev_stat) != 0)
return 0;
if (stat(FD_DIR, &dev_fd_stat) != 0)
return 0;
if (dev_stat.st_dev == dev_fd_stat.st_dev)
return 0;  /* / == /dev == /dev/fd means it is static. #fail */
return 1;
}
#endif


On my FreeBSD 12 VM, MAXFD is around 230k which is quite large.

vstinner@freebsd$ uname -a
FreeBSD freebsd 12.0-RELEASE-p10 FreeBSD 12.0-RELEASE-p10 GENERIC  amd64

vstinner@freebsd$ ./python 
Python 3.9.0a0 (heads/master:4db25d5c39, Sep  9 2019, 07:52:01) 
>>> import os; os.sysconf("SC_OPEN_MAX")
229284

It's easy to measure the overhead of 230k close() syscalls:

vstinner@freebsd$ python3 -m pyperf timeit -s 'import subprocess; 
args=["/usr/bin/true"]' 'subprocess.Popen(args, close_fds=False).wait()' 
.
Mean +- std dev: 1.22 ms +- 0.12 ms
vstinner@freebsd$ python3 -m pyperf timeit -s 'import subprocess; 
args=["/usr/bin/true"]' 'subprocess.Popen(args, close_fds=True).wait()' 
.
Mean +- std dev: 53.3 ms +- 1.4 ms

The overhead is 52.08 ms per Popen().wait() call (with close_fds=True).



If I mount manually the fdescfs filesystem, suddenly, subprocess is efficient 
again:

vstinner@freebsd$ sudo mount -t fdescfs  /dev/fd 
vstinner@freebsd$ python3 -m pyperf timeit -s 'import subprocess; 
args=["/usr/bin/true"]' 'subprocess.Popen(args, close_fds=True).wait()' 
.
Mean +- std dev: 1.20 ms +- 0.06 ms

close_fds=True becomes as efficient as close_fds=False.

--

___
Python tracker 

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



[issue38061] FreeBSD: Optimize subprocess.Popen(close_fds=True) using closefrom()

2019-09-09 Thread STINNER Victor


STINNER Victor  added the comment:

> FreeBSD has a similar concept using /dev/fd "file-descriptor file system". 
> (...) I'm not sure how it is supposed to work.

Sadly, on my FreeBSD VM, it seems like /dev/fd/ is not mounted with fdescfs by 
default, but as a regular directory with 3 hardcoded files 0, 1 and 2 which are 
character devices.

I had to mount fdescfs filesystem manually at /dev/fd/ :-(

$ cat /etc/fstab 
# Custom /etc/fstab for FreeBSD VM images
/dev/gpt/rootfs   /   ufs rw  1   1
/dev/gpt/swapfs  noneswapsw  0   0

Maybe it's an issue with "FreeBSD VM images" that I chose.

--

The FreeBSD CURRENT buildbot worker mounts /dev/fd:

CURRENT-amd64% cat /etc/fstab
# DeviceMountpoint  FStype  Options DumpPass#
/dev/da0p2  noneswapsw  0   0
/dev/da0p3  /   ufs rw  1   1
fdescfs /dev/fd fdescfs rw  0   0

CURRENT-amd64% mount|grep fd
fdescfs on /dev/fd (fdescfs)

--

___
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

2019-09-09 Thread STINNER Victor


STINNER Victor  added the comment:

I change the version to Python 3.9: the 3.8 branch don't accept new features 
anymore.

--
versions: +Python 3.9 -Python 3.8

___
Python tracker 

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



[issue38007] Regression: name of PyType_Spec::slots conflicts with Qt macro

2019-09-09 Thread STINNER Victor


STINNER Victor  added the comment:

I don't understand this issue, it mostly contains reference to other bugs. Can 
someone please try to elaborate the issue?

"Regression: name of PyType_Spec::slots conflicts with Qt macro"

What is "::slots"? Is it C++ syntax?

I don't understand how "slots" name can be an issue: it's not a global 
variable, but a structure member name.

--

___
Python tracker 

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



[issue34410] itertools.tee not thread-safe; can segfault interpreter when wrapped iterator releases GIL

2019-09-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15393
pull_request: https://github.com/python/cpython/pull/15738

___
Python tracker 

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



[issue34410] itertools.tee not thread-safe; can segfault interpreter when wrapped iterator releases GIL

2019-09-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15392
pull_request: https://github.com/python/cpython/pull/15737

___
Python tracker 

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



[issue34410] itertools.tee not thread-safe; can segfault interpreter when wrapped iterator releases GIL

2019-09-09 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 526a01467b3277f9fcf7f91e66c23321caa1245d by Serhiy Storchaka in 
branch 'master':
bpo-34410: Fix a crash in the tee iterator when re-enter it. (GH-15625)
https://github.com/python/cpython/commit/526a01467b3277f9fcf7f91e66c23321caa1245d


--

___
Python tracker 

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



[issue38038] Remove urllib.parse._splittype from xmlrpc.client

2019-09-09 Thread STINNER Victor


STINNER Victor  added the comment:

> Let's remove the deprecated urllib.parse._splituser and 
> urllib.parse._splittype from xmlrpc.client

splittype() is deprecated, _splittype() is not deprecated.

Should we deprecate _splittype() as well? I don't know the rationale of 
splittype() deprecation.

--

___
Python tracker 

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



[issue38062] Clarify that atexit.unregister matches by equality, not identity

2019-09-09 Thread Mark Dickinson


New submission from Mark Dickinson :

Suppose I have a class that looks like this:

class A:
def cleanup(self):
print("Doing essential cleanup")

and on an instance `a = A()`, I do: `atexit.register(a.cleanup)`.

Then it's not obvious from the documentation that an 
`atexit.unregister(a.cleanup)` will successfully undo the effect of the 
reigster call: the second `a.cleanup` is a different object from the first:

>>> a = A()
>>> clean1 = a.cleanup
>>> clean2 = a.cleanup
>>> clean1 is clean2
False

Luckily, though the two bound methods are different objects, they're equal:

>>> clean1 == clean2
True

and from looking at the source, it's apparent that `atexit.unregister` compares 
by equality rather than identity, so everything works.

It would be good to add a sentence to the documentation for `atexit.unregister` 
to clarify that this can be expected to work.

--
messages: 351363
nosy: mark.dickinson
priority: normal
severity: normal
status: open
title: Clarify that atexit.unregister matches by equality, not identity

___
Python tracker 

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



[issue38062] Clarify that atexit.unregister matches by equality, not identity

2019-09-09 Thread Mark Dickinson


Change by Mark Dickinson :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
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



[issue34155] email.utils.parseaddr mistakenly parse an email

2019-09-09 Thread Riccardo Schirone


Riccardo Schirone  added the comment:

CVE-2019-16056 has been assigned to this issue.
See https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-16056 .

--
nosy: +rschiron

___
Python tracker 

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



[issue15382] os.utime() mishandles some arguments

2019-09-09 Thread STINNER Victor


STINNER Victor  added the comment:

> The documentation issue was fixed in issue23738. The documentation no longer 
> claims that ns can be None. If specified it must be a tuple of floats.

tuple of integers, not tuple a floats.

Python 3.9 documentation says: "If ns is specified, it must be a 2-tuple of the 
form (atime_ns, mtime_ns) where each member is an int expressing nanoseconds." 
which is correct.

Python 3.9 now emits a DeprecationWarning when passing floats:

vstinner@apu$ ./python
Python 3.9.0a0 (heads/pr/15701-dirty:a0f335c74c, Sep  6 2019, 17:38:14) 
>>> import os
>>> os.utime("x", ns=(1, 1))
>>> os.utime("x", ns=(0.1, 1))
:1: DeprecationWarning: an integer is required (got type float).  
Implicit conversion to integers using __int__ is deprecated, and may be removed 
in a future version of Python.

--

___
Python tracker 

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



[issue15382] os.utime() mishandles some arguments

2019-09-09 Thread STINNER Victor


STINNER Victor  added the comment:

By the way, error messages are now also correct:

>>> os.utime("x", ns=None)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: utime: 'ns' must be a tuple of two ints

>>> os.utime("x", times=(0, 0), ns=None)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: utime: you may specify either 'times' or 'ns' but not both

--

___
Python tracker 

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



[issue38061] FreeBSD: Optimize subprocess.Popen(close_fds=True) using closefrom()

2019-09-09 Thread Kubilay Kocak


Kubilay Kocak  added the comment:

We're tracking this in our downstream bug: 
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221700

There's a patch there you may base something upstream on

Open question:

closefrom(2) test in ./configure && ifdef __FreeBSD__ ?

--

___
Python tracker 

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



[issue15817] Misc/gdbinit: Expose command documentation to gdb help

2019-09-09 Thread Zachary Ware


Zachary Ware  added the comment:


New changeset 1f86fdcfc57270ee569cc58269a4e08afe7608ec by Zachary Ware (Florian 
Bruhin) in branch 'master':
bpo-15817: gdbinit: Document commands after defining them (GH-15021)
https://github.com/python/cpython/commit/1f86fdcfc57270ee569cc58269a4e08afe7608ec


--
nosy: +zach.ware

___
Python tracker 

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



[issue34410] itertools.tee not thread-safe; can segfault interpreter when wrapped iterator releases GIL

2019-09-09 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +15394
pull_request: https://github.com/python/cpython/pull/15740

___
Python tracker 

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



[issue38061] FreeBSD: Optimize subprocess.Popen(close_fds=True) using closefrom()

2019-09-09 Thread Kubilay Kocak


Kubilay Kocak  added the comment:

@Victor I mounted fdescfs on the buildbot workers to make the tests run faster. 
You're correct that it's not enabled by default.

If we could look at the initial support being as simple as possible, we can 
look to backport this to 2.7 as well

--

___
Python tracker 

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



[issue34410] itertools.tee not thread-safe; can segfault interpreter when wrapped iterator releases GIL

2019-09-09 Thread miss-islington


miss-islington  added the comment:


New changeset 6e3809c7ce9fbee11c3a3f89dd7e89829b7581ac by Miss Islington (bot) 
in branch '3.8':
bpo-34410: Fix a crash in the tee iterator when re-enter it. (GH-15625)
https://github.com/python/cpython/commit/6e3809c7ce9fbee11c3a3f89dd7e89829b7581ac


--
nosy: +miss-islington

___
Python tracker 

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



[issue34410] itertools.tee not thread-safe; can segfault interpreter when wrapped iterator releases GIL

2019-09-09 Thread miss-islington


miss-islington  added the comment:


New changeset 5190b7193c184268d5c8a9440b3a5a8bcd84a23e by Miss Islington (bot) 
in branch '3.7':
bpo-34410: Fix a crash in the tee iterator when re-enter it. (GH-15625)
https://github.com/python/cpython/commit/5190b7193c184268d5c8a9440b3a5a8bcd84a23e


--

___
Python tracker 

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



[issue11953] Missing WSA* error codes

2019-09-09 Thread Steve Dower


Steve Dower  added the comment:


New changeset 71ea688d662a74ddf39a3874e06c73e58df55c02 by Steve Dower (Ngalim 
Siregar) in branch 'master':
bpo-11953: Extend table of Windows WSA* error codes (GH-15004)
https://github.com/python/cpython/commit/71ea688d662a74ddf39a3874e06c73e58df55c02


--
nosy: +steve.dower

___
Python tracker 

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



[issue38043] small cleanups in Unicode normalization code

2019-09-09 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset 7669cb8b21c7c9cef758609c44017c09d1ce4658 by Benjamin Peterson 
(Greg Price) in branch 'master':
bpo-38043: Use `bool` for boolean flags on is_normalized_quickcheck. (GH-15711)
https://github.com/python/cpython/commit/7669cb8b21c7c9cef758609c44017c09d1ce4658


--

___
Python tracker 

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



[issue11953] Missing WSA* error codes

2019-09-09 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +15395
pull_request: https://github.com/python/cpython/pull/15741

___
Python tracker 

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



[issue37445] Some FormatMessageW() calls use FORMAT_MESSAGE_FROM_SYSTEM without FORMAT_MESSAGE_IGNORE_INSERTS

2019-09-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15397
pull_request: https://github.com/python/cpython/pull/15743

___
Python tracker 

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



[issue37445] Some FormatMessageW() calls use FORMAT_MESSAGE_FROM_SYSTEM without FORMAT_MESSAGE_IGNORE_INSERTS

2019-09-09 Thread Steve Dower


Steve Dower  added the comment:


New changeset a6563650c835d50f7302971a5b145e94f9d0dc68 by Steve Dower (Zackery 
Spytz) in branch 'master':
bpo-37445: Include FORMAT_MESSAGE_IGNORE_INSERTS in FormatMessageW() calls 
(GH-14462)
https://github.com/python/cpython/commit/a6563650c835d50f7302971a5b145e94f9d0dc68


--

___
Python tracker 

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



[issue37445] Some FormatMessageW() calls use FORMAT_MESSAGE_FROM_SYSTEM without FORMAT_MESSAGE_IGNORE_INSERTS

2019-09-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15396
pull_request: https://github.com/python/cpython/pull/15742

___
Python tracker 

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



[issue15817] Misc/gdbinit: Expose command documentation to gdb help

2019-09-09 Thread Zachary Ware


Change by Zachary Ware :


--
pull_requests: +15398
pull_request: https://github.com/python/cpython/pull/15744

___
Python tracker 

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



[issue38038] Remove urllib.parse._splittype from xmlrpc.client

2019-09-09 Thread Dong-hee Na


Dong-hee Na  added the comment:

@vstinner

Right. splittype() is deprecated.
Nevertheless, the same functionality is still accessible to end users with 
_splittype (). So I thought we should go in the direction of removing this 
completely.
>From the view of the standard library is used by Python end users as a 
>reference for their own implementation, I suggest removing indirectly usage of 
>deprecated API gradually.

--

___
Python tracker 

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



[issue32587] Make REG_MULTI_SZ support zero-length strings

2019-09-09 Thread Steve Dower


Steve Dower  added the comment:


New changeset e223ba13d8d871ee58570dfca4e82a591189cc2f by Steve Dower (Zackery 
Spytz) in branch 'master':
bpo-32587: Make winreg.REG_MULTI_SZ support zero-length strings (#13239)
https://github.com/python/cpython/commit/e223ba13d8d871ee58570dfca4e82a591189cc2f


--

___
Python tracker 

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



[issue32587] Make REG_MULTI_SZ support zero-length strings

2019-09-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15399
pull_request: https://github.com/python/cpython/pull/15745

___
Python tracker 

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



[issue13788] os.closerange optimization

2019-09-09 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
versions: +Python 3.8 -Python 3.4

___
Python tracker 

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



[issue32587] Make REG_MULTI_SZ support zero-length strings

2019-09-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15400
pull_request: https://github.com/python/cpython/pull/15746

___
Python tracker 

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



[issue34155] email.utils.parseaddr mistakenly parse an email

2019-09-09 Thread STINNER Victor


STINNER Victor  added the comment:

I reopen the issue since Python 2.7 is still vulnerable.

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

___
Python tracker 

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



[issue37705] winerror_to_errno implementation

2019-09-09 Thread Steve Dower


Steve Dower  added the comment:

I'm going to merge and backport this all the way to 3.7. Adding a publicly 
accessible dict for use in Python code should be 3.9 only.

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



[issue34155] [CVE-2019-16056] email.utils.parseaddr mistakenly parse an email

2019-09-09 Thread STINNER Victor


Change by STINNER Victor :


--
title: email.utils.parseaddr mistakenly parse an email -> [CVE-2019-16056] 
email.utils.parseaddr mistakenly parse an email

___
Python tracker 

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



[issue37705] winerror_to_errno implementation

2019-09-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15404
pull_request: https://github.com/python/cpython/pull/15750

___
Python tracker 

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



[issue37936] gitignore file is too broad

2019-09-09 Thread miss-islington


miss-islington  added the comment:


New changeset 5e5e9515029f70836003a8cfb30433166fcc8db7 by Miss Islington (bot) 
(Greg Price) in branch 'master':
bpo-37936: Avoid ignoring files that we actually do track. (GH-15451)
https://github.com/python/cpython/commit/5e5e9515029f70836003a8cfb30433166fcc8db7


--

___
Python tracker 

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



[issue34410] itertools.tee not thread-safe; can segfault interpreter when wrapped iterator releases GIL

2019-09-09 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 2fb6921ab296f933caf361a662e6471e143abefc by Serhiy Storchaka in 
branch '2.7':
[2.7] bpo-34410: Fix a crash in the tee iterator when re-enter it. (GH-15625) 
(GH-15740)
https://github.com/python/cpython/commit/2fb6921ab296f933caf361a662e6471e143abefc


--

___
Python tracker 

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



[issue37705] winerror_to_errno implementation

2019-09-09 Thread Steve Dower


Steve Dower  added the comment:


New changeset 19052a11314e7be7ba003fd6cdbb5400a5d77d96 by Steve Dower (Zackery 
Spytz) in branch 'master':
bpo-37705: Improve the implementation of winerror_to_errno() (GH-15623)
https://github.com/python/cpython/commit/19052a11314e7be7ba003fd6cdbb5400a5d77d96


--

___
Python tracker 

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



[issue37936] gitignore file is too broad

2019-09-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15402
pull_request: https://github.com/python/cpython/pull/15748

___
Python tracker 

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



[issue37936] gitignore file is too broad

2019-09-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15401
pull_request: https://github.com/python/cpython/pull/15747

___
Python tracker 

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



[issue36816] self-signed.pythontest.net TLS certificate key is too weak

2019-09-09 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

I believe this has been addressed.

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



[issue37705] winerror_to_errno implementation

2019-09-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15403
pull_request: https://github.com/python/cpython/pull/15749

___
Python tracker 

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



[issue38061] FreeBSD: Optimize subprocess.Popen(close_fds=True) using closefrom()

2019-09-09 Thread STINNER Victor


STINNER Victor  added the comment:

> @Victor I mounted fdescfs on the buildbot workers to make the tests run 
> faster. You're correct that it's not enabled by default.

Would it be possible to modify FreeBSD to enable it by default? Or is there a 
reason to not enable it by default?

> We're tracking this in our downstream bug: 
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221700 There's a patch 
> there you may base something upstream on

Which patch? https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221700#c3 or 
something else?


> Open question: closefrom(2) test in ./configure && ifdef __FreeBSD__ ?

No need to make closefrom test conditional depending on the platform. We have 
plently of tests which are platform specific but run on all platforms.

It's common that a function is first available on a single platform, but then 
available on more platforms.

It seems like closefrom() is available on:

* FreeBSD
* NetBSD: https://netbsd.gw.com/cgi-bin/man-cgi?closefrom++NetBSD-current
* OpenBSD: https://man.openbsd.org/closefrom.2
* Solaris: https://docs.oracle.com/cd/E23823_01/html/816-5168/closefrom-3c.html

--

___
Python tracker 

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



[issue37251] Mocking a MagicMock with a function spec results in an AsyncMock

2019-09-09 Thread Lisa Roach


Lisa Roach  added the comment:

I made a new branch with the changes I am suggesting here to try to be more 
clear: https://github.com/lisroach/cpython/tree/issue37251

What do you think?

--

___
Python tracker 

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



[issue37936] gitignore file is too broad

2019-09-09 Thread Benjamin Peterson


Change by Benjamin Peterson :


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



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

2019-09-09 Thread Yury Selivanov


Yury Selivanov  added the comment:

Here's the API I propose to solve this problem: 
https://github.com/python/cpython/pull/15735#pullrequestreview-285389412

Summary:

* Add a new loop.shutdown_threadpool() method. Just like with 
shutdown_asyncgens() -- it would be invalid to call loop.run_in_executer() 
after loop.shutdown_threadpool() is called.

* Make asyncio.run() to call the new loop.shutdown_threadpool().

--

___
Python tracker 

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



[issue21120] PyArena type is used in headers from the limited API

2019-09-09 Thread Mark Shannon


Mark Shannon  added the comment:

This seems like the correct thing to do.
Since the AST changes from version to version, I don't see how these files 
could reasonably be part of the limited API.

--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue38015] inline function generates slightly inefficient machine code

2019-09-09 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

I agree with msg351348. The performance wins are very context-dependent and 
even then very small. It's not worth further disturbing the small int code. So, 
we should close this issue out.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue37445] Some FormatMessageW() calls use FORMAT_MESSAGE_FROM_SYSTEM without FORMAT_MESSAGE_IGNORE_INSERTS

2019-09-09 Thread miss-islington


miss-islington  added the comment:


New changeset e103732f5df13a97f610a8b80883895f7a273573 by Miss Islington (bot) 
in branch '3.8':
bpo-37445: Include FORMAT_MESSAGE_IGNORE_INSERTS in FormatMessageW() calls 
(GH-14462)
https://github.com/python/cpython/commit/e103732f5df13a97f610a8b80883895f7a273573


--
nosy: +miss-islington

___
Python tracker 

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



[issue38038] Remove urllib.parse._splittype from xmlrpc.client

2019-09-09 Thread STINNER Victor


STINNER Victor  added the comment:

splittype() was deprecated in Python 3.8 by bpo-27485:

commit 0250de48199552cdaed5a4fe44b3f9cdb5325363
Author: Cheryl Sabella 
Date:   Wed Apr 25 16:51:54 2018 -0700

bpo-27485: Rename and deprecate undocumented functions in urllib.parse 
(GH-2205)


Dong-hee Na: This issue is about xmlrpc.client. If you consider that it's time 
to remove deprecated urllib.parse functions, please open a separated issue.

--

___
Python tracker 

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



[issue36311] Flaw in Windows code page decoder for large input

2019-09-09 Thread Steve Dower


Steve Dower  added the comment:

Declaring this out-of-scope for 2.7, unless someone wants to insist (and 
provide a PR).

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

___
Python tracker 

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



[issue38060] precedence (relational, logical operator)not working with single value

2019-09-09 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Tim is correct, the behaviour is right, however the docs could be clearer.

I think what you are missing is that ``or`` and ``and`` are short-circuiting 
operators. So in the expression

9 or (anything)

the "anything" expression never gets evaluated because 9 is a truthy value. You 
might get a better example of what is happening if you disassemble the 
byte-code:


py> from dis import dis
py> dis(compile("9 or 7 < 'str'", '', 'eval'))
  1   0 LOAD_CONST   0 (9)
  3 JUMP_IF_TRUE_OR_POP 15
  6 LOAD_CONST   1 (7)
  9 LOAD_CONST   2 ('str')
 12 COMPARE_OP   0 (<)
>>   15 RETURN_VALUE


Another way to see the order of evaluation is if we make the left hand operand 
falsey:


py> print("first") or print("second") < 'str'
first
second
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unorderable types: NoneType() < str()

In this case, the order of operations is:

- evaluate ``print("first")`` (returns None)
- since None is falsey, evaluate ``print("second") < 'str'``
- which prints the word "second", then raises an exception.


We can get rid of the exception:

py> print("first") or str(print("second")) < 'str'
first
second
True


I can see how the docs are a little bit confusing if you don't remember that 
``or`` and ``and`` are short-circuiting operators. If you would like to propose 
an improvement to the docs, please suggest something. But the behaviour is 
correct and is not a bug.

https://docs.python.org/3/reference/expressions.html#operator-precedence

--
nosy: +steven.daprano

___
Python tracker 

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



[issue37383] call count in not registered in AsyncMock till the coroutine is awaited

2019-09-09 Thread Lisa Roach


Lisa Roach  added the comment:

I see your point it is confusing the difference between the async and sync API, 
but I think the current AsyncMock call check is correct. According to the 
asyncio docs: "...simply calling a coroutine will not schedule it to be 
executed" (https://docs.python.org/3/library/asyncio-task.html#coroutines) and 
it goes on to say you either need to call the function with await, 
asyncio.run(), or asyncio.create_task(). 

So I believe calling an AsyncMock without using await should not log as a call, 
it is only if one of the three criteria above is met that it should be added to 
the mock_calls list.

--

___
Python tracker 

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



[issue37445] Some FormatMessageW() calls use FORMAT_MESSAGE_FROM_SYSTEM without FORMAT_MESSAGE_IGNORE_INSERTS

2019-09-09 Thread miss-islington


miss-islington  added the comment:


New changeset 1af2c0ec2f63cc6516eb814c3e29d94451a52194 by Miss Islington (bot) 
in branch '3.7':
bpo-37445: Include FORMAT_MESSAGE_IGNORE_INSERTS in FormatMessageW() calls 
(GH-14462)
https://github.com/python/cpython/commit/1af2c0ec2f63cc6516eb814c3e29d94451a52194


--

___
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

2019-09-09 Thread STINNER Victor


STINNER Victor  added the comment:

"shutdown_threadpool()" name

What do you think of the "shutdown_default_executor()" name?

The default executor can be overriden by set_default_executor():

def set_default_executor(self, executor):
if not isinstance(executor, concurrent.futures.ThreadPoolExecutor):
warnings.warn(
'Using the default executor that is not an instance of '
'ThreadPoolExecutor is deprecated and will be prohibited '
'in Python 3.9',
DeprecationWarning, 2)
self._default_executor = executor

The default executor should always be a thread pool, so "shutdown_threadpool()" 
name is also correct. I have no strong preference.

--

___
Python tracker 

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



[issue15817] Misc/gdbinit: Expose command documentation to gdb help

2019-09-09 Thread Zachary Ware


Zachary Ware  added the comment:


New changeset 14f7de72b62ec8e73a8a57b25ad8fef230dc6a3c by Zachary Ware in 
branch '3.8':
[3.8] bpo-15817: gdbinit: Document commands after defining them (GH-15021) 
(#15744)
https://github.com/python/cpython/commit/14f7de72b62ec8e73a8a57b25ad8fef230dc6a3c


--

___
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

2019-09-09 Thread Yury Selivanov


Yury Selivanov  added the comment:

> What do you think of the "shutdown_default_executor()" name?

Yeah, I think it's a better name!

--

___
Python tracker 

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



[issue38038] Remove urllib.parse._splittype from xmlrpc.client

2019-09-09 Thread Dong-hee Na


Dong-hee Na  added the comment:

Understood

--

___
Python tracker 

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



[issue37835] typing.get_type_hints wrong namespace for forward-declaration of inner class

2019-09-09 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

> I anyway always wonder, why functions, which are methods, do not hold a 
> reference to the class, which they belong to.

This may indeed be a useful feature on its own, but it will also require a much 
more wider discussion.

--

___
Python tracker 

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



[issue37531] Fix regrtest timeout for subprocesses: regrtest -jN --timeout=SECONDS

2019-09-09 Thread STINNER Victor


STINNER Victor  added the comment:

Crap, test_regrtest.test_multiprocessing_timeout() hangs sometimes (randomly), 
and then support.temp_cwd() fails on rmtree() with "PermissionError: [WinError 
32] The process cannot access the file because it is being used by another 
process".


running: test_regrtest (14 min 24 sec)
running: test_regrtest (14 min 54 sec)
0:24:35 load avg: 2.02 [419/419/1] test_regrtest crashed (Exit code 1)
Timeout (0:15:00)!
Thread 0x17d0 (most recent call first):
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\subprocess.py", line 
1353 in _readerthread
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\threading.py", line 
882 in run
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\threading.py", line 
944 in _bootstrap_inner
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\threading.py", line 
902 in _bootstrap

Thread 0x0a30 (most recent call first):
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\threading.py", line 
1039 in _wait_for_tstate_lock
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\threading.py", line 
1023 in join
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\subprocess.py", line 
1382 in _communicate
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\subprocess.py", line 
1015 in communicate
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\subprocess.py", line 
491 in run
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_regrtest.py", line 
504 in run_command
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_regrtest.py", line 
529 in run_python
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_regrtest.py", line 
680 in run_tests
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_regrtest.py", line 
1178 in test_multiprocessing_timeout

(...)

1 re-run test:
test_regrtest

Total duration: 25 min 20 sec
Tests result: FAILURE then SUCCESS
Traceback (most recent call last):
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\support\__init__.py", 
line 1013, in temp_dir
yield path
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\support\__init__.py", 
line 1065, in temp_cwd
yield cwd_dir
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\libregrtest\main.py", 
line 628, in main
self._main(tests, kwargs)
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\libregrtest\main.py", 
line 690, in _main
sys.exit(0)
SystemExit: 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\support\__init__.py", 
line 330, in _force_run
return func(*args)
PermissionError: [WinError 32] The process cannot access the file because it is 
being used by another process: 
'C:\\buildbot.python.org\\3.x.kloth-win64\\build\\build\\test_python_4376\\test_python_worker_5136'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\runpy.py", line 192, 
in _run_module_as_main
return _run_code(code, main_globals, None,
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\runpy.py", line 85, in 
_run_code
exec(code, run_globals)
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\__main__.py", 
line 2, in 
main()
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\libregrtest\main.py", 
line 695, in main
Regrtest().main(tests=tests, **kwargs)
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\libregrtest\main.py", 
line 628, in main
self._main(tests, kwargs)
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\contextlib.py", line 
131, in __exit__
self.gen.throw(type, value, traceback)
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\support\__init__.py", 
line 1065, in temp_cwd
yield cwd_dir
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\contextlib.py", line 
131, in __exit__
self.gen.throw(type, value, traceback)
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\support\__init__.py", 
line 1018, in temp_dir
rmtree(path)
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\support\__init__.py", 
line 452, in rmtree
_rmtree(path)
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\support\__init__.py", 
line 393, in _rmtree
_waitfor(_rmtree_inner, path, waitall=True)
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\support\__init__.py", 
line 341, in _waitfor
func(pathname)
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\support\__init__.py", 
line 390, in _rmtree_inner
_force_run(fullname, os.rmdir, fullname)
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\support\__init__.py", 
line 336, in _force_run
return func(*args)
PermissionError: [WinError 32] The process

[issue37857] Setting logger.level directly has no effect due to caching in 3.7+

2019-09-09 Thread Vinay Sajip


Vinay Sajip  added the comment:

That code in the wild that sets the level attribute directly is wrong and 
should be changed, right? The documentation has always been clear that 
setLevel() should be used. If we now take steps to support setting the level 
via attribute, isn't that encouraging bypassing the documented APIs? I'm not 
sure such misuse is widespread.

Using a property might seem a good solution, but there is a performance impact, 
so I am not keen on this change. I don't know what the real-world performance 
impact would be, but this simple script to look at the base access timing:

import timeit

class Logger(object):
def __init__(self):
self._levelprop = self.level = 0

@property
def levelprop(self):
return self.level


def main():
logger = Logger()
print(timeit.timeit('logger.level', globals=locals()))
print(timeit.timeit('logger.levelprop', globals=locals()))

if __name__ == '__main__':
main()

gives, for example,

0.1263063173353
0.4208384449998448

--

___
Python tracker 

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



[issue32587] Make REG_MULTI_SZ support zero-length strings

2019-09-09 Thread miss-islington


miss-islington  added the comment:


New changeset bbf02da42e2368ae6b40015d6e92eaac4120f2dc by Miss Islington (bot) 
in branch '3.7':
bpo-32587: Make winreg.REG_MULTI_SZ support zero-length strings (GH-13239)
https://github.com/python/cpython/commit/bbf02da42e2368ae6b40015d6e92eaac4120f2dc


--
nosy: +miss-islington

___
Python tracker 

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



[issue32587] Make REG_MULTI_SZ support zero-length strings

2019-09-09 Thread miss-islington


miss-islington  added the comment:


New changeset ebca7eb093f31052ff9f245b306d38941c28a1ad by Miss Islington (bot) 
in branch '3.8':
bpo-32587: Make winreg.REG_MULTI_SZ support zero-length strings (GH-13239)
https://github.com/python/cpython/commit/ebca7eb093f31052ff9f245b306d38941c28a1ad


--

___
Python tracker 

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



[issue1154351] add get_current_dir_name() to os module

2019-09-09 Thread STINNER Victor


STINNER Victor  added the comment:

I rejected PR 10117 which adds os.get_current_dir_name(). Copy of my comment:
https://github.com/python/cpython/pull/10117#issuecomment-529399532

The os module is thin wrappers to functions of the libc or even system calls. 
We don't implement heuristic using 2 variants of the same feature: there shutil 
module is there for that. Compare os.get_terminal_size() to 
shutil.get_terminal_size() for example.

I close the PR to add os.get_current_dir_name(): IMHO it's more a feature for 
the shutil module.

--

___
Python tracker 

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



[issue1154351] add get_current_dir_name() to os module

2019-09-09 Thread STINNER Victor


STINNER Victor  added the comment:

I don't see much traction to get this feature into Python. Only a few comments 
since 2005. I close the issue. The function implement is just a few lines of 
pure Python code. If you need it, it's easy to put it in your project.

Sorry, but I'm not convinced that we really need this feature in Python.

I close the issue. If you want this feature, please come back with a better 
rationale. I don't understand which use case is solved by this feature.

--
resolution:  -> rejected
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



[issue35667] activate for venv containing apostrophe doesn't work in powershell

2019-09-09 Thread Vinay Sajip


Vinay Sajip  added the comment:

This has reportedly been fixed by the changes made to fix bpo-37354. I'll close 
this, but please reopen if you find it's still a problem.

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



[issue37936] gitignore file is too broad

2019-09-09 Thread miss-islington


miss-islington  added the comment:


New changeset c837ad408e85eed9d20ba8331751df15e14f6aef by Miss Islington (bot) 
in branch '3.8':
bpo-37936: Avoid ignoring files that we actually do track. (GH-15451)
https://github.com/python/cpython/commit/c837ad408e85eed9d20ba8331751df15e14f6aef


--

___
Python tracker 

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



[issue38063] Modify test_socket.py to use unittest test discovery

2019-09-09 Thread STINNER Victor


Change by STINNER Victor :


--
components: Tests
nosy: vstinner
priority: normal
severity: normal
status: open
title: Modify test_socket.py to use unittest test discovery
type: enhancement
versions: Python 3.9

___
Python tracker 

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



[issue37383] call count in not registered in AsyncMock till the coroutine is awaited

2019-09-09 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I just checked the behavior with asynctest. The _mock_call implementation where 
the call is recorded is similar except that in asynctest it's a synchronous 
function [0] and in AsyncMock it's an async function [1] thus needs to be 
awaited to register call count. Agreed it's more of a confusion over does call 
mean a function call or something that should be recorded only once awaited 
given that there is call_count and await_calls. But would be good to have this 
documented that call_count is recorded only after await.


Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 16:52:21)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import asynctest
>>> m = asynctest.CoroutineMock()
>>> m(1)
.proxy at 0x1023c8b88>
>>> m.mock_calls
[call(1)]

Python 3.9.0a0 (heads/master:a6563650c8, Sep  9 2019, 14:53:16)
[Clang 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from unittest.mock import AsyncMock
>>> m = AsyncMock()
>>> m.mock_calls
[]


[0] 
https://github.com/Martiusweb/asynctest/blob/d1d47ecb8220371284230d6d6fe642649ef82ab2/asynctest/mock.py#L584
[1] 
https://github.com/python/cpython/blob/19052a11314e7be7ba003fd6cdbb5400a5d77d96/Lib/unittest/mock.py#L2120

--

___
Python tracker 

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



[issue38063] Modify test_socket.py to use unittest test discovery

2019-09-09 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +15405
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/15751

___
Python tracker 

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



[issue38064] Agen Poker Online Terpercaya

2019-09-09 Thread Poker Online


New submission from Poker Online :

Situs agen poker online terpercayahttps://www.jakartapoker.net/

--
components: Cross-Build
messages: 351408
nosy: Alex.Willmer, pokeronline63
priority: normal
severity: normal
status: open
title: Agen Poker Online Terpercaya
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



[issue38063] Modify test_socket.py to use unittest test discovery

2019-09-09 Thread STINNER Victor


Change by STINNER Victor :


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



[issue38064] Spam

2019-09-09 Thread Zachary Ware


Change by Zachary Ware :


--
components:  -Cross-Build
nosy:  -Alex.Willmer, pokeronline63, xtreak
title: Agen Poker Online Terpercaya -> Spam
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



[issue38063] Modify test_socket.py to use unittest test discovery

2019-09-09 Thread Zachary Ware


New submission from Zachary Ware :

See also #14408.

--
nosy: +zach.ware

___
Python tracker 

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



[issue38064] Spam

2019-09-09 Thread Zachary Ware


Change by Zachary Ware :


--
Removed message: https://bugs.python.org/msg351408

___
Python tracker 

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



[issue38064] Agen Poker Online Terpercaya

2019-09-09 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This looks like spam to me. Feel free to reopen the issue if incorrect with a 
better description and example of the problem.

--
nosy: +xtreak
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



[issue37383] call count in not registered in AsyncMock till the coroutine is awaited

2019-09-09 Thread Lisa Roach


Lisa Roach  added the comment:

Agreed, I think documentation can be clearer around this. I'll add a PR to try 
to clarify.

--

___
Python tracker 

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



[issue32587] Make REG_MULTI_SZ support zero-length strings

2019-09-09 Thread Steve Dower


Steve Dower  added the comment:

This introduced a new warning:

c:\projects\cpython\pc\winreg.c(775): warning C4267: '-=': conversion from 
'size_t' to 'int', possible loss of data 
[C:\Projects\cpython\PCbuild\pythoncore.vcxproj]

I'll fix it (after I'm done with my current task) unless someone else gets 
there first.

--

___
Python tracker 

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



[issue37445] Some FormatMessageW() calls use FORMAT_MESSAGE_FROM_SYSTEM without FORMAT_MESSAGE_IGNORE_INSERTS

2019-09-09 Thread Steve Dower


Steve Dower  added the comment:

Going to say this doesn't qualify for 2.7 (unless someone insists and provides 
a PR), given the lack of reports that anything is actually impacted.

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

___
Python tracker 

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



[issue11953] Missing WSA* error codes

2019-09-09 Thread Steve Dower


Change by Steve Dower :


--
assignee:  -> steve.dower
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.8, Python 3.9 -Python 3.3

___
Python tracker 

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



[issue11953] Missing WSA* error codes

2019-09-09 Thread Steve Dower


Steve Dower  added the comment:


New changeset eb02196bd95ea12fcccff3960f36601596811570 by Steve Dower in branch 
'3.8':
bpo-11953: Extend table of Windows WSA* error codes (GH-15004)
https://github.com/python/cpython/commit/eb02196bd95ea12fcccff3960f36601596811570


--

___
Python tracker 

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



[issue37705] winerror_to_errno implementation

2019-09-09 Thread miss-islington


miss-islington  added the comment:


New changeset 68e401fa0b1a3407bce395ad893535f65107ee6e by Miss Islington (bot) 
in branch '3.8':
bpo-37705: Improve the implementation of winerror_to_errno() (GH-15623)
https://github.com/python/cpython/commit/68e401fa0b1a3407bce395ad893535f65107ee6e


--
nosy: +miss-islington

___
Python tracker 

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



[issue37383] call count in not registered in AsyncMock till the coroutine is awaited

2019-09-09 Thread Lisa Roach


Lisa Roach  added the comment:

I wonder if `await_count` is really necessary, since it is essentially the same 
as `call_count`. Would it be too late or confusing to remove it now?

--

___
Python tracker 

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



[issue37705] winerror_to_errno implementation

2019-09-09 Thread miss-islington


miss-islington  added the comment:


New changeset c25759187829d5732eea73f52a269c88aba28371 by Miss Islington (bot) 
in branch '3.7':
bpo-37705: Improve the implementation of winerror_to_errno() (GH-15623)
https://github.com/python/cpython/commit/c25759187829d5732eea73f52a269c88aba28371


--

___
Python tracker 

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



[issue38063] Modify test_socket.py to use unittest test discovery

2019-09-09 Thread STINNER Victor


STINNER Victor  added the comment:

Right now, test_main() is awful: 75 lines of code which is a very long list of 
class names! There are just 2 lines to check if tests don't leak a running 
thread.


def test_main():
tests = [GeneralModuleTests, BasicTCPTest, TCPCloserTest, TCPTimeoutTest,
 TestExceptions, BufferIOTest, BasicTCPTest2, BasicUDPTest,
 UDPTimeoutTest, CreateServerTest, CreateServerFunctionalTest]

tests.extend([
NonBlockingTCPTests,
FileObjectClassTestCase,
UnbufferedFileObjectClassTestCase,
LineBufferedFileObjectClassTestCase,
SmallBufferedFileObjectClassTestCase,
UnicodeReadFileObjectClassTestCase,
UnicodeWriteFileObjectClassTestCase,
UnicodeReadWriteFileObjectClassTestCase,
NetworkConnectionNoServer,
NetworkConnectionAttributesTest,
NetworkConnectionBehaviourTest,
ContextManagersTest,
InheritanceTest,
NonblockConstantTest
])
tests.append(BasicSocketPairTest)
tests.append(TestUnixDomain)
tests.append(TestLinuxAbstractNamespace)
tests.extend([TIPCTest, TIPCThreadableTest])
tests.extend([BasicCANTest, CANTest])
tests.extend([BasicRDSTest, RDSTest])
tests.append(LinuxKernelCryptoAPI)
tests.append(BasicQIPCRTRTest)
tests.extend([
BasicVSOCKTest,
ThreadedVSOCKSocketStreamTest,
])
tests.append(BasicBluetoothTest)
tests.extend([
CmsgMacroTests,
SendmsgUDPTest,
RecvmsgUDPTest,
RecvmsgIntoUDPTest,
SendmsgUDP6Test,
RecvmsgUDP6Test,
RecvmsgRFC3542AncillaryUDP6Test,
RecvmsgIntoRFC3542AncillaryUDP6Test,
RecvmsgIntoUDP6Test,
SendmsgUDPLITETest,
RecvmsgUDPLITETest,
RecvmsgIntoUDPLITETest,
SendmsgUDPLITE6Test,
RecvmsgUDPLITE6Test,
RecvmsgRFC3542AncillaryUDPLITE6Test,
RecvmsgIntoRFC3542AncillaryUDPLITE6Test,
RecvmsgIntoUDPLITE6Test,
SendmsgTCPTest,
RecvmsgTCPTest,
RecvmsgIntoTCPTest,
SendmsgSCTPStreamTest,
RecvmsgSCTPStreamTest,
RecvmsgIntoSCTPStreamTest,
SendmsgUnixStreamTest,
RecvmsgUnixStreamTest,
RecvmsgIntoUnixStreamTest,
RecvmsgSCMRightsStreamTest,
RecvmsgIntoSCMRightsStreamTest,
# These are slow when setitimer() is not available
InterruptedRecvTimeoutTest,
InterruptedSendTimeoutTest,
TestSocketSharing,
SendfileUsingSendTest,
SendfileUsingSendfileTest,
])
tests.append(TestMSWindowsTCPFlags)

thread_info = support.threading_setup()
support.run_unittest(*tests)
support.threading_cleanup(*thread_info)

--

___
Python tracker 

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



[issue30491] Add a lightweight mechanism for detecting un-awaited coroutine objects

2019-09-09 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

This is a new feature (and not a blocker).
Shift to 3.9.

Nathaniel, the PR is outdated.
Have you an intention to land it or the issue can be closed by the lack of 
interest?

--
nosy: +asvetlov
versions: +Python 3.9 -Python 3.8

___
Python tracker 

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



[issue37283] Unexpected behavior when running installer a second time with the same arguments or unattend.xml

2019-09-09 Thread Steve Dower


Steve Dower  added the comment:

Okay, this is definitely an ordering issue in 
Tools/msi/bundle/bootstrap/PythonBootstrapApplication.cpp

Fixing most of the options is easy - just a case of moving 
LoadOptionalFeatureStates() a few lines up - but Install_launcher is set much 
later. I should be able to fix both though.

--
stage:  -> needs patch
versions: +Python 3.8, Python 3.9 -Python 3.6

___
Python tracker 

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



[issue36250] pdb: interaction might cause "ValueError: signal only works in main thread"

2019-09-09 Thread Zachary Ware


Zachary Ware  added the comment:


New changeset 8d64bfafdffd9f866bb6ac2e5b4c4bdfcb16aea0 by Zachary Ware (Daniel 
Hahler) in branch 'master':
bpo-36250: ignore ValueError from signal in non-main thread (GH-12251)
https://github.com/python/cpython/commit/8d64bfafdffd9f866bb6ac2e5b4c4bdfcb16aea0


--

___
Python tracker 

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



[issue36250] pdb: interaction might cause "ValueError: signal only works in main thread"

2019-09-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15406
pull_request: https://github.com/python/cpython/pull/15752

___
Python tracker 

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



[issue36250] pdb: interaction might cause "ValueError: signal only works in main thread"

2019-09-09 Thread Zachary Ware


Change by Zachary Ware :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.9

___
Python tracker 

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



[issue38037] reference counter issue in signal module

2019-09-09 Thread Ma Lin


Change by Ma Lin :


--
pull_requests: +15407
pull_request: https://github.com/python/cpython/pull/15753

___
Python tracker 

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



  1   2   3   4   >