[issue38427] Issue URL on translated Python docs site is always pointed to English version

2019-10-10 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

There are occasional reports of typo in translations that are opened in 
bugs.python.org and it would make sense to redirect to respective GitHub repos 
for the translations.

--
nosy: +mdk, xtreak

___
Python tracker 

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



[issue38427] Issue URL on translated Python docs site is always pointed to English version

2019-10-10 Thread Shengjing Zhu


Shengjing Zhu  added the comment:

On https://docs.python.org/zh-cn/3/bugs.html we emphasis that translation bugs 
should be reported at GitHub. So that's why I want the footer link same as 
previous (link to translated bugs.html).

--

___
Python tracker 

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



[issue38426] declare visit_validate in Py_DEBUG macro

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset a5447735c334a041ee2ffdeb5c7e13d7d4502ea2 by Victor Stinner in 
branch 'master':
bpo-38392: Only declare visit_validate() if Py_DEBUG is defined (GH-16689)
https://github.com/python/cpython/commit/a5447735c334a041ee2ffdeb5c7e13d7d4502ea2


--

___
Python tracker 

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



[issue38392] Ensure that objects entering the GC are valid

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset a5447735c334a041ee2ffdeb5c7e13d7d4502ea2 by Victor Stinner in 
branch 'master':
bpo-38392: Only declare visit_validate() if Py_DEBUG is defined (GH-16689)
https://github.com/python/cpython/commit/a5447735c334a041ee2ffdeb5c7e13d7d4502ea2


--

___
Python tracker 

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



[issue38109] Missing constants in Lib/stat.py

2019-10-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16278
pull_request: https://github.com/python/cpython/pull/16691

___
Python tracker 

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



[issue38109] Missing constants in Lib/stat.py

2019-10-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16277
pull_request: https://github.com/python/cpython/pull/16690

___
Python tracker 

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



[issue38109] Missing constants in Lib/stat.py

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 7bb14316b8ceddb813f31040a299af94a57ab339 by Victor Stinner (Ronan 
Lamy) in branch 'master':
bpo-38109: Add missing constants to Lib/stat.py (GH-16665)
https://github.com/python/cpython/commit/7bb14316b8ceddb813f31040a299af94a57ab339


--

___
Python tracker 

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



[issue38109] Missing constants in Lib/stat.py

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

Ronan Lamy: Hum, do you really need this change to land in Python 3.7 and 3.8? 
If not, I will close PR 16690 and PR 16691 backports.

I don't think that it's worth it, since _stat should be always present in 
CPython.

--

___
Python tracker 

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



[issue38417] Add support for settting umask in subprocess children

2019-10-10 Thread Christian Heimes


Change by Christian Heimes :


--
nosy: +christian.heimes

___
Python tracker 

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



[issue38425] Remove warning: ‘res’ may be used uninitialized in this function

2019-10-10 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset a05fcd3c7adf6e3a0944da8cf80a3346882e9b3b by Victor Stinner 
(Dong-hee Na) in branch 'master':
bpo-38425: Fix ‘res’ may be used uninitialized warning (GH-16688)
https://github.com/python/cpython/commit/a05fcd3c7adf6e3a0944da8cf80a3346882e9b3b


--
nosy: +vstinner

___
Python tracker 

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



[issue38425] Remove warning: ‘res’ may be used uninitialized in this function

2019-10-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16279
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/16693

___
Python tracker 

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



[issue38425] Remove warning: ‘res’ may be used uninitialized in this function

2019-10-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16280
pull_request: https://github.com/python/cpython/pull/16694

___
Python tracker 

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



[issue36339] test_ttk_guionly: test_traversal() fails randomly on AMD64 Windows8.1 Refleaks 2.7

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

Recent failure:

The Buildbot has detected a failed build on builder AMD64 Windows8.1 Refleaks 
2.7 while building Python.
Full details are available at:
https://buildbot.python.org/all/#builders/33/builds/726

--

___
Python tracker 

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



[issue38426] declare visit_validate in Py_DEBUG macro

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks for the report. It's now fixed.

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



[issue37677] Seg Fault on OSX when multiprocessing

2019-10-10 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Looking at the stack trace this is a similar issue as the "no_proxy" one, but 
in some sense worse because it happens when just calling a regular unix API 
(not an Apple framework API).

The first few lines of the stack trace are for code in the "Network" framework 
which is new in macOS 10.14 and is based on lib dispatch and  hence uses 
threads. That results in the same problem as the "no_proxy" one: code that 
causes problems when called after os.fork().

That's a bug in macOS.

In Python 3.8 the multiprocessing module switched to "spawn" mode instead of 
"fork" mode because of this.  You can do this manually for earlier versions 
(https://docs.python.org/3.7/library/multiprocessing.html#contexts-and-start-methods)

P.S. A reproducer would still be nice as that would make it easier to raise and 
issue with Apple about this.

--
components: +macOS
nosy: +ned.deily, ronaldoussoren
versions: +Python 3.6

___
Python tracker 

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



[issue38417] Add support for settting umask in subprocess children

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

> Another use of the deprecated unsafe preexec_fn was to call os.umask in the 
> child prior to exec.

What do you mean by "deprecated"? The parameter doesn't seem to be deprecated 
in the documentation:
https://docs.python.org/dev/library/subprocess.html#subprocess.Popen

And when I use it, it doesn't emit any warning:
---
import os, subprocess, sys
def func(): print(f"func called in {os.getpid()}")
argv = [sys.executable, "-c", "pass"]
print(f"parent: {os.getpid()}")
subprocess.run(argv, preexec_fn=func)
---

Output:
---
$ ./python -Werror x.py 
parent: 22264
func called in 22265
---

If you want to deprecate it, it should be documented as deprecated and emit a 
DeprecatedWarning, no?

--

___
Python tracker 

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



[issue38416] test_largefile.TestSocketSendfile.test_it() failed with 15 min timeout on AMD64 FreeBSD 10-STABLE Non-Debug 3.x

2019-10-10 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

> Another approach is to change the timeout of 15 min for this super slow 
> buildbot. For example, set it to 20 min or 30 min.

I think this makes more sense (set timeout to 25 min).

--

___
Python tracker 

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



[issue38417] Add support for settting umask in subprocess children

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

pylint emits a warning on subprocess.Popen(preexec_fn=func):

   W1509: Using preexec_fn keyword which may be unsafe in
   the presence of threads (subprocess-popen-preexec-fn)

But not when using subprocess.run(preexec_fn=func). Maybe a check is missing in 
pylint.

Note: pyflakes doesn't complain about preexec_fn.

--

___
Python tracker 

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



[issue38425] Remove warning: ‘res’ may be used uninitialized in this function

2019-10-10 Thread miss-islington

miss-islington  added the comment:


New changeset 6b6935e563562c427d5bb1b2864d6a2fed0e74fa by Miss Islington (bot) 
in branch '3.8':
bpo-38425: Fix ‘res’ may be used uninitialized warning (GH-16688)
https://github.com/python/cpython/commit/6b6935e563562c427d5bb1b2864d6a2fed0e74fa


--
nosy: +miss-islington

___
Python tracker 

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



[issue38417] Add support for settting umask in subprocess children

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

> We should not provide such an "run arbitrary python code before execing the 
> ultimate child" feature in the standard library.

Do you want to modify _posixsubprocess to call umask() between fork() and 
exec()? As it has been done for uid, gid and groups: call setreuid(), 
setregid() and setgroups()?

If so, it means that posix_spawn() couldn't be used when the new umask 
parameter would be used, right?

--

___
Python tracker 

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



[issue38425] Remove warning: ‘res’ may be used uninitialized in this function

2019-10-10 Thread miss-islington

miss-islington  added the comment:


New changeset d27a9b1695a1b46c81b3a83a7a35034791265d89 by Miss Islington (bot) 
in branch '3.7':
bpo-38425: Fix ‘res’ may be used uninitialized warning (GH-16688)
https://github.com/python/cpython/commit/d27a9b1695a1b46c81b3a83a7a35034791265d89


--

___
Python tracker 

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



[issue38425] Remove warning: ‘res’ may be used uninitialized in this function

2019-10-10 Thread Dong-hee Na


Change by Dong-hee Na :


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



[issue38416] test_largefile.TestSocketSendfile.test_it() failed with 15 min timeout on AMD64 FreeBSD 10-STABLE Non-Debug 3.x

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

I changed AMD64 FreeBSD 10-STABLE timeout from 15 to 30 minutes.

https://github.com/python/buildmaster-config/commit/c3fe0b1b65d94c1150521dda4daba02775dc

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

___
Python tracker 

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



[issue38417] Add support for settting umask in subprocess children

2019-10-10 Thread Christian Heimes


Christian Heimes  added the comment:

preexec_fn does not work in subinterpreters, which (amongst others) affects 
mod_wsgi and similar WSGI implementations. Therefore portable software must not 
use preexec_fn at all.

--

___
Python tracker 

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



[issue38417] Add support for settting umask in subprocess children

2019-10-10 Thread Christian Heimes


Christian Heimes  added the comment:

Changed in version 3.8: The preexec_fn parameter is no longer supported in 
subinterpreters. The use of the parameter in a subinterpreter raises 
RuntimeError. The new restriction may affect applications that are deployed in 
mod_wsgi, uWSGI, and other embedded environments.

--

___
Python tracker 

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



[issue14307] Make subclassing SocketServer simpler for non-blocking frameworks

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

Antoine Pitrou: "...  I'm against this change ..."

Martin Panter: "... But this seems unreasonable to me. ..."

I close the issue. You can use asyncio for non-blocking networking code. Or 
have a look at Twisted, Tornado, eventlet, etc.

If you really want to hack socketserver, I suggest you to copy the whole 
socketserver.py file. But asynchronous programming is a hard problem which 
requires more than modiying a single function. Slowly, you will built something 
similar the the project that I cited.

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



[issue35762] subprocess.Popen with universal_newlines and nonblocking streams fails with "can't concat NoneType to bytes"

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

I close this issue as a duplicate of bpo-13322 which is older and has a longer 
history.

--
nosy: +vstinner
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> buffered read() and write() does not raise BlockingIOError

___
Python tracker 

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



[issue13322] buffered read() and write() does not raise BlockingIOError

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

I closed bpo-35762 as a duplicate of this issue: subprocess.Popen with 
universal_newlines and nonblocking streams fails with "can't concat NoneType to 
bytes".

--
nosy: +vstinner

___
Python tracker 

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



[issue26292] Raw I/O writelines() broken for non-blocking I/O

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

I close this issue as duplicate of bpo-13322 which is older and has a longer 
history.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> buffered read() and write() does not raise BlockingIOError

___
Python tracker 

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



[issue13322] buffered read() and write() does not raise BlockingIOError

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

I closed bpo-26292 as a duplicate of this issue: Raw I/O writelines() broken 
for non-blocking I/O.

--

___
Python tracker 

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



[issue24560] codecs.StreamReader doesn't work with nonblocking streams: TypeError: can't concat bytes to NoneType

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

I close this issue as a duplicate of bpo-13322.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> buffered read() and write() does not raise BlockingIOError

___
Python tracker 

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



[issue13322] buffered read() and write() does not raise BlockingIOError

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

I closed bpo-24560 as a duplicate of this issue: codecs.StreamReader doesn't 
work with nonblocking streams: TypeError: can't concat bytes to NoneType.

--

___
Python tracker 

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



[issue13322] buffered read() and write() does not raise BlockingIOError

2019-10-10 Thread Jakub Stasiak


Change by Jakub Stasiak :


--
nosy: +jstasiak

___
Python tracker 

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



[issue13322] buffered read() and write() does not raise BlockingIOError

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-32561: Add API to io objects for non-blocking reads/writes.

--

___
Python tracker 

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



[issue13322] The io module doesn't support non-blocking files

2019-10-10 Thread STINNER Victor


Change by STINNER Victor :


--
components:  -Documentation, IO
title: buffered read() and write() does not raise BlockingIOError -> The io 
module doesn't support non-blocking files
versions: +Python 3.9 -Python 2.7, Python 3.6, Python 3.7

___
Python tracker 

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



[issue32561] Add API to io objects for non-blocking reads/writes

2019-10-10 Thread STINNER Victor

STINNER Victor  added the comment:

> Background: Doing I/O to files on disk has a hugely bimodal latency. If the 
> I/O happens to be in or going to cache (either user-space cache, like in 
> io.BufferedIOBase, or the OS's page cache), then the operation returns 
> instantly (~1 µs) without blocking. OTOH if the I/O isn't cached (for reads) 
> or cacheable (for writes), then the operation may block for 10 ms or more.

On Linux 4.14 and newer, Python 3.8 now provides os.preadv(os.RWF_NOWAIT):

"Do not wait for data which is not immediately available. If this flag is 
specified, the system call will return instantly if it would have to read data 
from the backing storage or wait for a lock. If some data was successfully 
read, it will return the number of bytes read. If no bytes were read, it will 
return -1 and set errno to errno.EAGAIN."

At least on recent Linux, it became possible to write a different code path for 
uncached data.

--
nosy: +vstinner

___
Python tracker 

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



[issue38428] Can't gracefully ctrl+C multiprocessing pool on Python3 & Windows

2019-10-10 Thread Rebecca Fair


New submission from Rebecca Fair :

I want to be able to Ctrl+C to exit a multiprocessing Pool.map gracefully, and 
have made a solution based on this Stack Overflow answer: 
https://stackoverflow.com/questions/11312525/catch-ctrlc-sigint-and-exit-multiprocesses-gracefully-in-python

However, this solution works on Linux, and on Windows 10 with Python 2.7, but 
not on Windows 10 with Python 3.7. The Ctrl+C is just ignored and I have to 
kill the processes manually. I've attached the minimum code required to 
reproduce the problem.

Is this a bug, expected, or is there a workaround? I believe it might be caused 
by the behaviour of threading.Condition.wait() being changed in commit 7c3e577 
but I don't know enough about signalling to say any more than that

--
components: Windows
files: bug.py
messages: 354344
nosy: paul.moore, rebeccafair, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Can't gracefully ctrl+C multiprocessing pool on Python3 & Windows
versions: Python 3.7
Added file: https://bugs.python.org/file48653/bug.py

___
Python tracker 

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



[issue13322] The io module doesn't support non-blocking files

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

TextIOWrapper, and maybe also BufferedRead, may raise an exception if the 
underlying file descriptor is configured in non-blocking mode. It may require 
an additional syscall() to query the FD properties, which may slowdown the 
creation of file objects in Python :-/

--

___
Python tracker 

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



[issue38428] Can't gracefully ctrl+C multiprocessing pool on Python3 & Windows

2019-10-10 Thread Rebecca Fair


Rebecca Fair  added the comment:

Sorry, I didn't realise it wouldn't link to a commit automatically, the commit 
is here: 
https://github.com/python/cpython/commit/7c3e5773954009d65520eb063621cf7724da88e3

--

___
Python tracker 

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



[issue32561] Add API to io objects for non-blocking reads/writes

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

The Linux kernel 5.1 also got a new "io_uring" for asynchronous I/O:

"Ringing in a new asynchronous I/O API"
https://lwn.net/Articles/776703/

Linux 5.2: "The io_uring mechanism has a new operation, 
IORING_OP_SYNC_FILE_RANGE, which performs the equivalent of a sync_file_range() 
system call. It is also now possible to register an eventfd with an io_uring 
and get notifications when operations complete."

Linux 5.3: "The io_uring mechanism has gained support for asynchronous 
sendmsg() and recvmsg() operations."

--

___
Python tracker 

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



[issue38429] Failed to compile with --enable-framework on macOS on master

2019-10-10 Thread Haruka Ma


New submission from Haruka Ma :

Since commit 
https://github.com/python/cpython/commit/c02b41b1fb115c87693530ea6a480b2e15460424
 , some syntax errors are preventing cpython from compiling with 
--enable-framework on. 

Specifically, the errors are in Modules/getpath.c on line 1134 and 1165.

I've made some inline comments on github as well.

--
components: macOS
messages: 354348
nosy: Haruka Ma, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: Failed to compile with --enable-framework on macOS on master
type: compile error
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



[issue32561] Add API to io objects for non-blocking reads/writes

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

I suggest to close the issue and move the discussion to a place to discuss 
asynchronous ideas.


I'm sorry, but I don't understand what it is proposed here. I understand that 
Nathaniel wants to add something like a new "asynchronous" mode in the io 
module which would make FileIO, BufferedReader and TextIOWrapper behave 
differently.

IMHO it's a bad idea. The io module is designed for blocking I/O syscalls. Not 
only the implementation, but also the API.

Non-blocking I/O requires a platform specific implementation for best 
performances, but that requires something like an event loop, and so unusual 
programming style like asyncio "await ...".

I dislike the idea of having a single module for synchronous (blocking) and 
asynchronous (non-blocking) operations. IMHO asynchronous programming is so 
complex that it requires to develop a whole new module.

Maybe new module could reuse io code. Like implement an asynchronous using 
io.TextIOWrapper, but its underlying buffer would be feeded and controlled by 
asynchronous code.

The Python bug tracker is usually used for bugs or to implement a concrete 
proposal. Here I understand that it's more an idea at the design stage. I don't 
think that it's the best place to discuss it. I suggest to open a discussion on 
python-ideas list or a list about asynchronous programming (I looked for 
"async-sig", but it seems like the list is gone?).

--

___
Python tracker 

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



[issue38416] test_largefile.TestSocketSendfile.test_it() failed with 15 min timeout on AMD64 FreeBSD 10-STABLE Non-Debug 3.x

2019-10-10 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

Thanks.

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

___
Python tracker 

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



[issue38416] test_largefile.TestSocketSendfile.test_it() failed with 15 min timeout on AMD64 FreeBSD 10-STABLE Non-Debug 3.x

2019-10-10 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue38429] Failed to compile with --enable-framework on macOS on master

2019-10-10 Thread Ned Deily


Change by Ned Deily :


--
nosy: +vstinner

___
Python tracker 

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



[issue38430] Memory leak in ThreadPoolExecutor + run_in_executor

2019-10-10 Thread Evgeny Nizhibitsky


New submission from Evgeny Nizhibitsky :

I have run into a memory leak caused by using run_in_executor + 
ThreadPoolExecutor while running some stability tests with custom web services.

It was 1 MB leaked for 1k requests made for my case and I've extracted the root 
cause and converted it into minimal script with both mentioned parts + just NOP 
function to "run".

The script can easily eat up to 1 GB of memory in less then 1 minute now. It 
uses external psutil library to report the memory allocated but it can be 
easily commented out and the leak will stay anyway.

One can found that script attached + Dockerfile/Makefile for reproducibility. 
I've also reproduced it in my own conda-based 3.7 environment as well as the 
master branch of cpython.

--
components: asyncio
files: python-leak.zip
messages: 354351
nosy: Evgeny Nizhibitsky, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Memory leak in ThreadPoolExecutor + run_in_executor
type: resource usage
versions: Python 3.6, Python 3.7, Python 3.9
Added file: https://bugs.python.org/file48654/python-leak.zip

___
Python tracker 

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



[issue38430] Memory leak in ThreadPoolExecutor + run_in_executor

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

Well, that's a common issue when using asyncio: you forgot await.

async def main(_loop):
while True:
with futures.ThreadPoolExecutor() as pool:
_loop.run_in_executor(pool, nop)
sys.stdout.write(f'\r{get_mem():0.3f}MB')

It should be: "await _loop.run_in_executor(pool, nop)" ;-)

Sadly, PYTHONASYNCIODEBUG=1 env var doesn't complain on this bug.

See: https://docs.python.org/dev/library/asyncio-dev.html#debug-mode

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



[issue38430] Memory leak in ThreadPoolExecutor + run_in_executor

2019-10-10 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

You MUST await a future returned from `loop.run_in_executor()` to avoid the 
leak.

Yuri, what should we do with the issue? I see the second similar report in the 
last half of the year.
Sure, we can add weakrefs somewhere in futures._chain_future() but I pretty 
sure that the proper fix is just enforcing `await` here, e.g.

1. rename existing run_in_executor() into a private _run_in_executor() function.

2. write async trampoline:
async def run_in_executor(self, executor, func, *args):
return await self._run_in_executor(executor, func, *args)

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

___
Python tracker 

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



[issue38430] Memory leak in ThreadPoolExecutor + run_in_executor

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

> Yuri, what should we do with the issue?

A Task emits a warning when it's not awaited. Can a Task be used instead of a 
Future in run_in_executor()?

--
nosy: +vstinner

___
Python tracker 

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



[issue38430] Memory leak in ThreadPoolExecutor + run_in_executor

2019-10-10 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Victor answered the first :)

--

___
Python tracker 

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



[issue38430] Memory leak in ThreadPoolExecutor + run_in_executor

2019-10-10 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

> Can a Task be used instead of a Future in run_in_executor()?

I don't think that the task is required here. The problem is that 
run_in_executor is a function that returns asyncio future; that is in turn a 
wrapper around concurrent future object.

If we convert run_in_executor() into async function we'll get a warning about 
unawaited coroutine even without asyncio debug mode.

--

___
Python tracker 

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



[issue38430] Memory leak in ThreadPoolExecutor + run_in_executor

2019-10-10 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

The change is slightly not backward compatible but
1. It's pretty visible. In the worst-case instead of the memory leak people see 
a RuntimeWarning
2. We did it already for a part of API, e.g. loop.sock_read() and family

--

___
Python tracker 

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



[issue38430] Memory leak in ThreadPoolExecutor + run_in_executor

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

> If we convert run_in_executor() into async function we'll get a warning about 
> unawaited coroutine even without asyncio debug mode.

That sounds like a good solution :-)

--

___
Python tracker 

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



[issue38353] Cleanup the path configuration implementation code (getpath.c)

2019-10-10 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16281
pull_request: https://github.com/python/cpython/pull/16695

___
Python tracker 

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



[issue38429] Failed to compile with --enable-framework on macOS on master

2019-10-10 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue38429] Failed to compile with --enable-framework on macOS on master

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

Oh, I expected that we had macOS buildbots building Python with 
--enable-framework. Thanks for the reporting the issue.

I wrote PR 16695 which should fix the issue, but I cannot test my fix right now.

--

___
Python tracker 

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



[issue38430] Memory leak in ThreadPoolExecutor + run_in_executor

2019-10-10 Thread Evgeny Nizhibitsky


Evgeny Nizhibitsky  added the comment:

Oh, I see that in the initial code with leakage (it was heavy 
ThreadPoolExecutor + xgboost thing) there was an await but I must have lost it 
somewhere while reducing it to the minimal example and finished in the wrong 
direction.

Glad too see that it raised a discussion to prevent others from getting into 
this silent trap.

--

___
Python tracker 

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



[issue38429] Failed to compile with --enable-framework on macOS on master

2019-10-10 Thread Haruka Ma


Haruka Ma  added the comment:

I'm now getting double free on the same function:

https://pastebin.com/zHWCtTuV (with debug on)

--

___
Python tracker 

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



[issue32561] Add API to io objects for non-blocking reads/writes

2019-10-10 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

The proposal is to be able to run io module operations in two modes: the 
regular one, and one where performing actual I/O is forbidden – so if they go 
down the stack and can fulfill the operation from some in-memory buffer, great, 
they do that, and if not, they raise an error.

It turns out that this is actually the right primitive to enable async disk 
access. That's the only target use case, and there's no IO loop involved. If 
you wanted to keep async disk access separate from the io module, then what 
we'd have to do is to create a fork of all the code in the io module, and add 
this feature to it. Which doesn't seem like a good design :-).

--

___
Python tracker 

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



[issue32996] Improve What's New in 3.7

2019-10-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16283
pull_request: https://github.com/python/cpython/pull/16696

___
Python tracker 

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



[issue32996] Improve What's New in 3.7

2019-10-10 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:


New changeset d47f0dd2e85ce032aebfedbde18cdb2e728fa79f by Ivan Levkivskyi (M. 
Eric Irrgang) in branch 'master':
bpo-32996: Documentation fix-up. (GH-16646)
https://github.com/python/cpython/commit/d47f0dd2e85ce032aebfedbde18cdb2e728fa79f


--
nosy: +levkivskyi

___
Python tracker 

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



[issue32996] Improve What's New in 3.7

2019-10-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16284
pull_request: https://github.com/python/cpython/pull/16697

___
Python tracker 

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



[issue32996] Improve What's New in 3.7

2019-10-10 Thread miss-islington


miss-islington  added the comment:


New changeset ca012360b103f2ab1acfa506aed032b0ed9b105c by Miss Islington (bot) 
in branch '3.7':
bpo-32996: Documentation fix-up. (GH-16646)
https://github.com/python/cpython/commit/ca012360b103f2ab1acfa506aed032b0ed9b105c


--

___
Python tracker 

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



[issue32996] Improve What's New in 3.7

2019-10-10 Thread miss-islington


miss-islington  added the comment:


New changeset baf8a9b03a56ce1ee2284763b267ff56ab4507fe by Miss Islington (bot) 
in branch '3.8':
bpo-32996: Documentation fix-up. (GH-16646)
https://github.com/python/cpython/commit/baf8a9b03a56ce1ee2284763b267ff56ab4507fe


--

___
Python tracker 

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



[issue17894] Edits to descriptor howto

2019-10-10 Thread Ned Batchelder


Ned Batchelder  added the comment:

I think it's a bad precedent to have pages in the official docs that belong to 
a single author.  If you want to maintain that kind of control, it should go on 
your blog.  Part of the agreement for having material added to the official 
docs should be the understanding that they are fair game for community 
contributions.

--

___
Python tracker 

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



[issue38429] Failed to compile with --enable-framework on macOS on master

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

Hum, getpath.c seems to use deprecated APIs:

./Modules/getpath.c:1098:20: warning: 'NSModuleForSymbol' is deprecated: first 
deprecated in macOS 10.5 - dladdr() [-Wdeprecated-declarations]
pythonModule = NSModuleForSymbol(NSLookupAndBindSymbol("_Py_Initialize"));
   ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/mach-o/dyld.h:193:21:
 note: 'NSModuleForSymbol' has been explicitly marked deprecated here
extern NSModule NSModuleForSymbol(NSSymbol symbol) __API_UNAVAILABLE(ios, 
tvos, watchos)  __OSX_DEPRECATED(10.1, 10.5, "dladdr()");
^
./Modules/getpath.c:1098:38: warning: 'NSLookupAndBindSymbol' is deprecated: 
first deprecated in macOS 10.4 - dlsym() [-Wdeprecated-declarations]
pythonModule = NSModuleForSymbol(NSLookupAndBindSymbol("_Py_Initialize"));
 ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/mach-o/dyld.h:183:17:
 note: 'NSLookupAndBindSymbol' has been explicitly marked deprecated here
extern NSSymbol NSLookupAndBindSymbol(const char* symbolName)   
 __API_UNAVAILABLE(ios, tvos, watchos)  
__OSX_DEPRECATED(10...
^
./Modules/getpath.c:1101:27: warning: 'NSLibraryNameForModule' is deprecated: 
first deprecated in macOS 10.5 [-Wdeprecated-declarations]
const char* modPath = NSLibraryNameForModule(pythonModule);
  ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/mach-o/dyld.h:163:21:
 note: 'NSLibraryNameForModule' has been explicitly marked deprecated here
extern const char*  NSLibraryNameForModule(NSModule m) __API_UNAVAILABLE(ios, 
tvos, watchos)  __OSX_DEPRECATED(10.1, 10.5, "");
^
3 warnings generated.

--

___
Python tracker 

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



[issue14307] Make subclassing SocketServer simpler for non-blocking frameworks

2019-10-10 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

Nice necro :)
Socketserver is already subclassable and overridable for so many things.  Hard 
to understand the reluctancy to _allow_ for a different way to handle accept 
timeouts.  But this is also why I stopped contributing to core, because it 
turned out to be more about lobbying than anything else.  Anyway this is 
already implemented in PythonClassic, so no need for me to push it upstream :)

--

___
Python tracker 

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



[issue38429] Failed to compile with --enable-framework on macOS on master

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b6e0fc74265db96fdd0e0b8151c768c583ad80f0 by Victor Stinner in 
branch 'master':
bpo-38353: Fix typos in calculate_argv0_path_framework() (GH-16695)
https://github.com/python/cpython/commit/b6e0fc74265db96fdd0e0b8151c768c583ad80f0


--

___
Python tracker 

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



[issue38353] Cleanup the path configuration implementation code (getpath.c)

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b6e0fc74265db96fdd0e0b8151c768c583ad80f0 by Victor Stinner in 
branch 'master':
bpo-38353: Fix typos in calculate_argv0_path_framework() (GH-16695)
https://github.com/python/cpython/commit/b6e0fc74265db96fdd0e0b8151c768c583ad80f0


--

___
Python tracker 

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



[issue38429] Failed to compile with --enable-framework on macOS on master

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks for the bug report Haruka Ma, it should now be fixed.

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



[issue38109] Missing constants in Lib/stat.py

2019-10-10 Thread Ronan Lamy


Ronan Lamy  added the comment:

Well, my interest in this is to reduce the divergence between PyPy and CPython, 
and, potentially, to help other implementations. So I actually care more about 
3.7 than about 3.9, which I probably won't look at before 2021.

That said, I don't *need* anything: the fix is already in PyPy and we'll carry 
it forward regardless of what CPython does.

--

___
Python tracker 

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



[issue14307] Make subclassing SocketServer simpler for non-blocking frameworks

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

> Hard to understand the reluctancy to _allow_ for a different way to handle 
> accept timeouts.  But this is also why I stopped contributing to core, 
> because it turned out to be more about lobbying than anything else.

To get a change merged into Python, you need to find someone who wants to be 
responsible for it: not only merge the change, but also maintain the code 
later. I touched socketserver recently for my work on making the Python CI more 
reliable. It was not easy to get a review. I ended to merge the changes with no 
review (if I recall properly).

I dislike socketserver design: it tries to be too generic. Like supporting TCP 
and UDP, support threading and forking models, etc.

To be honest, I didn't look at your issue. I only close it for bug triage, 
since there was no activity since 2016 and 2 core devs were against the change.

And you want to revisit the change, please reopen the issue.

--

___
Python tracker 

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



[issue38109] Missing constants in Lib/stat.py

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 8ab11c433a81b6c7ef84a66e36fbe199915e2ff6 by Victor Stinner (Miss 
Islington (bot)) in branch '3.8':
bpo-38109: Add missing constants to Lib/stat.py (GH-16665) (GH-16690)
https://github.com/python/cpython/commit/8ab11c433a81b6c7ef84a66e36fbe199915e2ff6


--

___
Python tracker 

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



[issue38109] Missing constants in Lib/stat.py

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset f5ed41c1ae9a575e965d55c6a5e86fb59181eee8 by Victor Stinner (Miss 
Islington (bot)) in branch '3.7':
bpo-38109: Add missing constants to Lib/stat.py (GH-16665) (GH-16691)
https://github.com/python/cpython/commit/f5ed41c1ae9a575e965d55c6a5e86fb59181eee8


--

___
Python tracker 

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



[issue38109] Missing constants in Lib/stat.py

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

I understand that backporting the change up to 3.7 makes your life easier, so I 
merged it. The change is safe and should not affect the regular use case (when 
the C extension _stat is used).

Thanks Ronan for this nice enhancement. It's good to see the stat module 
respect the PEP 399 ;-)

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



[issue38429] Failed to compile with --enable-framework on macOS on master

2019-10-10 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

W.r.t. the deprecated APIs in getpath.c: Issue15498

That issue contains an ancient patch to switch to non-deprecated APIs, but we 
haven't had time yet to fully test these. The issue also mentions that Apple's 
install of Python already switched away from the deprecated APIs, but had some 
issues at the time.

--

___
Python tracker 

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



[issue15498] Eliminate the use of deprecated OS X APIs in getpath.c

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

The deprecation warnings are not fixed yet. They were quickly mentioned at:
https://bugs.python.org/issue38429#msg354367

--
nosy: +vstinner

___
Python tracker 

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



[issue38353] Cleanup the path configuration implementation code (getpath.c)

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

I created this issue to attempt to modify _PyPathConfig to use PyWideStringList 
for module_search_paths, to support ":" character in a path. It would fix 
bpo-31210.

See also bpo-12989.

--

___
Python tracker 

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



[issue38109] Missing constants in Lib/stat.py

2019-10-10 Thread Ronan Lamy


Ronan Lamy  added the comment:

Thanks Victor!

--

___
Python tracker 

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



[issue38367] test_regrtest hanged on AMD64 Windows10 3.x

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

I hope that this bug has been fixed by my latest fix for bpo-37531.

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

___
Python tracker 

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



[issue38339] [3.5] The doc job of Travis CI fails on Python 3.5: needs at least Sphinx v1.8

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

Larry merged my fix:

commit edd9bc9cc99c919bdc87e5955ec8ad93c295fbe2
Author: Victor Stinner 
Date:   Tue Oct 8 19:12:21 2019 +0200

[3.7] Doc: Bump sphinx. (GH-10676) (GH-10803) (#16522)

(cherry picked from commit 2db96ae7444880d66d4ef65abab8a5e6ff328711)

Co-authored-by: Julien Palard 
(cherry picked from commit 23a98abd4256f931ed89b65ec6babd4f06dbff97)


The doc of job Travis CI is back to green ;-)

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



[issue38282] socketmodule.c: _FORTIFY_SOURCE=2 warning in AF_ALG case of getsockaddrarg()

2019-10-10 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue37972] unittest.mock.call does not chain __getitem__ to another _Call object

2019-10-10 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Closing as fixed since PRs were merged. Thanks Ben.

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



[issue38230] A Path Traversal vulnerability in test/ssl_servers.py

2019-10-10 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I would propose closing since it's meant for tests and not for end users. I am 
also not sure if one of the tests depend on this behavior. Adding Victor as 
friendly ping since it's tagged as security.

--
nosy: +vstinner

___
Python tracker 

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



[issue36553] inspect.is_decorator_call(frame)

2019-10-10 Thread Sylvain Marie


Sylvain Marie  added the comment:

Quick update on this feature: for the following example to work:

from inspect import is_decorator_call

def set_hello_tag(tag='world'):
if is_decorator_call():
# called without parenthesis!
# the decorated object is `tag`
return set_hello_tag()(tag)   # note that `is_decorator_call` should 
not return True for this call
else:
def decorate(f):
setattr(f, 'hello', tag)  # set a hello tag on the decorated f
return f
return decorate


Then `is_decorator_call` should be callable without arguments (default to 
current frame) and should return `True` only if the current frame is the one 
directly following decorator application. In nested frames (such as the one 
obtained after first recursive call to `set_hello_tag` above, 
`is_decorator_call` should return `False`.

--

___
Python tracker 

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



[issue38230] A Path Traversal vulnerability in test/ssl_servers.py

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

Lib/test/ssl_servers.py is an internal test helper and not designed to be used 
by any end-user. Don't use it ;-)

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



[issue37931] crash reimporting posix after Py_Finalize on mac

2019-10-10 Thread Benoit Hudson


Benoit Hudson  added the comment:

Ping! The patch has been ready for review for over a month.

If the patch can be backported to 2.7.x before that gets end-of-lifed it would 
be ideal.

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



[issue38431] dataclasses.InitVar breaks with typing.Optional

2019-10-10 Thread Samuel Colvin


New submission from Samuel Colvin :

The following code works fine with python 3.7 but breaks with 3.8:

```
import dataclasses
from typing import Optional

@dataclasses.dataclass
class TestingDataclass:
base_path: dataclasses.InitVar[Optional[str]] = None
```

Exception traceback:

```
Traceback (most recent call last):
  File "test.py", line 6, in 
class TestingDataclass:
  File "/usr/local/lib/python3.8/dataclasses.py", line 995, in dataclass
return wrap(cls)
  File "/usr/local/lib/python3.8/dataclasses.py", line 987, in wrap
return _process_class(cls, init, repr, eq, order, unsafe_hash, frozen)
  File "/usr/local/lib/python3.8/dataclasses.py", line 967, in _process_class
str(inspect.signature(cls)).replace(' -> None', ''))
  File "/usr/local/lib/python3.8/inspect.py", line 3050, in __str__
formatted = str(param)
  File "/usr/local/lib/python3.8/inspect.py", line 2568, in __str__
formatannotation(self._annotation))
  File "/usr/local/lib/python3.8/inspect.py", line 1202, in formatannotation
return repr(annotation)
  File "/usr/local/lib/python3.8/dataclasses.py", line 213, in __repr__
return f'dataclasses.InitVar[{self.type.__name__}]'
  File "/usr/local/lib/python3.8/typing.py", line 757, in __getattr__
raise AttributeError(attr)
AttributeError: __name__
```

The code runs fine with `str` instead of `Optional[str]`.

Tested locally with `Python 3.8.0rc1 (tags/v3.8.0rc1:34214de6ab, Oct 10 2019, 
16:15:14)`. The same error can be seen (in a more involved context) on travis 
[here](https://travis-ci.org/samuelcolvin/pydantic/jobs/596131963)

--
components: Library (Lib)
messages: 354388
nosy: samuelcolvin
priority: normal
severity: normal
status: open
title: dataclasses.InitVar breaks with typing.Optional
type: behavior
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



[issue38431] dataclasses.InitVar breaks with typing.Optional

2019-10-10 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +eric.smith

___
Python tracker 

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



[issue38431] dataclasses.InitVar breaks with typing.Optional

2019-10-10 Thread Samuel Colvin


Samuel Colvin  added the comment:

This is a bug with the `__repr__` method on `InitVar`.

I'm working on a PR now.

--

___
Python tracker 

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



[issue38431] dataclasses.InitVar breaks with typing.Optional

2019-10-10 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

git blame points to 
https://github.com/python/cpython/commit/01ee12ba35a333e8a6a25c4153c4a21838e9585c
 . I am tagging this as a 3.8 regression since the commit was not backported 
and 3.7 works fine. Feel free to remove it if it's a mistake.

--
keywords: +3.8regression
nosy: +xtreak

___
Python tracker 

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



[issue38431] dataclasses.InitVar breaks with typing.Optional

2019-10-10 Thread Samuel Colvin


Change by Samuel Colvin :


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

___
Python tracker 

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



[issue38432] ZeroDivisionError when inf is expected

2019-10-10 Thread Behzad Seyfi


New submission from Behzad Seyfi :

>>> 1/1e-323
inf

>>> 1/1e-324
Traceback (most recent call last):
  File "", line 1, in 
ZeroDivisionError: float division by zero

in a 1/x fraction, up to x = 1e-324 it is inf but when x = 1e-325 or little it 
throws ZeroDivisionError. It is not acceptable and accountable behaviour for 
inf definition.

--
components: Interpreter Core
messages: 354391
nosy: Behzad Seyfi
priority: normal
severity: normal
status: open
title: ZeroDivisionError when inf is expected
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



[issue38431] dataclasses.InitVar breaks with typing.Optional

2019-10-10 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +16287
pull_request: https://github.com/python/cpython/pull/16701

___
Python tracker 

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



[issue38431] dataclasses.InitVar breaks with typing.Optional

2019-10-10 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Oh, Samuel already made a PR. Then I withdraw PR 16701.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue38431] dataclasses.InitVar breaks with typing.Optional

2019-10-10 Thread Samuel Colvin


Change by Samuel Colvin :


--
pull_requests: +16288
pull_request: https://github.com/python/cpython/pull/16702

___
Python tracker 

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



[issue38428] Can't gracefully ctrl+C multiprocessing pool on Python3 & Windows

2019-10-10 Thread Steve Dower


Steve Dower  added the comment:

I think you're right about that change touching the right code, but I'm pretty 
sure it wasn't working before either. (Python 2.7 had totally different code, 
IIRC.)

But the good news is that we should be able to use code similar to what's in 
Modules/timemodule.c#L1878 (the pysleep() function) to also wait on the event 
we use to emulate signals on Windows. But perhaps there's a reason Antoine 
(nosied) didn't do that originally?

--
nosy: +davin, pitrou
stage:  -> test needed
type:  -> behavior
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



[issue38433] 2.7.17rc1 tcl/tk version regression on Windows

2019-10-10 Thread Terry J. Reedy


New submission from Terry J. Reedy :

In my current 2.7.16+ Windows 10-64 repository build, and on at least one 
8.1-64 buildbot, the tcl/tk version is 8.5.19
>>> tk.Tk().tk.call('info', 'patchlevel')
'8.5.19'

In my installed 2.7.17rc1, it is the older 8.5.15.  It would seem to me that we 
should install the same latest 8.5 bugfix release that we test with.  (Or test 
with what we release ;-)  I presume the discrepancy is unintended due to an 
incomplete final 2.7 tcl/tk update.

--
components: Build, Tkinter
messages: 354394
nosy: benjamin.peterson, serhiy.storchaka, terry.reedy, zach.ware
priority: release blocker
severity: normal
status: open
title: 2.7.17rc1 tcl/tk version regression on Windows
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



[issue38432] ZeroDivisionError when inf is expected

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

That's not a bug: 64-bit float of IEEE 754 rounds 1e-324 to 0.0.

vstinner@apu$ python3
Python 3.7.4 (default, Jul  9 2019, 16:32:37) 
[GCC 9.1.1 20190503 (Red Hat 9.1.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 1e-324
0.0
>>> import sys
>>> sys.float_info
sys.float_info(max=1.7976931348623157e+308, max_exp=1024, max_10_exp=308, 
min=2.2250738585072014e-308, min_exp=-1021, min_10_exp=-307, dig=15, 
mant_dig=53, epsilon=2.220446049250313e-16, radix=2, rounds=1)
>>> sys.float_info.min
2.2250738585072014e-308
>>> sys.float_info.min.hex()
'0x1.0p-1022'

>>> 1/0.0
Traceback (most recent call last):
  File "", line 1, in 
ZeroDivisionError: float division by zero
>>> 1/1e-324
Traceback (most recent call last):
  File "", line 1, in 
ZeroDivisionError: float division by zero

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



[issue38434] sys.addaudithook event is not documented

2019-10-10 Thread Steve Dower


New submission from Steve Dower :

The sys.addaudithook raises an audit event 'sys.addaudithook'.

The docs for the function refer to the event, as it has slightly different 
semantics than most, but it is not named explicitly and does not appear in the 
table of events.

--
assignee: docs@python
components: Documentation
messages: 354396
nosy: docs@python, steve.dower
priority: normal
severity: normal
stage: needs patch
status: open
title: sys.addaudithook event is not documented
type: enhancement
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



  1   2   >