[issue32862] os.dup2(fd, fd, inheritable=False) behaves inconsistently

2018-02-16 Thread Alexey Izbyshev
New submission from Alexey Izbyshev <izbys...@ispras.ru>: os.dup2(fd, fd, inheritable=False) may fail or change fd inheritability in following ways: 1) POSIX without F_DUP2FD_CLOEXEC 1.1) dup3() is available (a common case for Linux): OSError (EINVAL, dup3() doesn't allow equal descr

[issue32859] os.dup2() tests dup3() availability on each call

2018-02-16 Thread Alexey Izbyshev
Change by Alexey Izbyshev <izbys...@ispras.ru>: -- keywords: +patch pull_requests: +5497 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue32859] os.dup2() tests dup3() availability on each call

2018-02-16 Thread Alexey Izbyshev
New submission from Alexey Izbyshev <izbys...@ispras.ru>: os.dup2() tests for dup3() system call availability at runtime, but doesn't remember the result across calls, repeating the test on each call with inheritable=False even if the test fails. Judging by the code, 'dup3_works' was in

[issue32844] subprocess may incorrectly redirect a low fd to stderr if another low fd is closed

2018-02-14 Thread Alexey Izbyshev
Alexey Izbyshev <izbys...@ispras.ru> added the comment: Note that the PR doesn't attempt to fix leaking of low dup'ed fds to the child. I'll file a separate report for that in a while. -- ___ Python tracker <rep...@bugs.python.or

[issue32844] subprocess may incorrectly redirect a low fd to stderr if another low fd is closed

2018-02-14 Thread Alexey Izbyshev
Change by Alexey Izbyshev <izbys...@ispras.ru>: -- keywords: +patch pull_requests: +5482 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue32844] subprocess may incorrectly redirect a low fd to stderr if another low fd is closed

2018-02-14 Thread Alexey Izbyshev
New submission from Alexey Izbyshev <izbys...@ispras.ru>: When redirecting, subprocess attempts to achieve the following state: each fd to be redirected to is less than or equal to the fd it is redirected from, which is necessary because redirection occurs in the ascending

[issue32777] subprocess: child_exec() uses _Py_set_inheritable() which is not async-signal-safe

2018-02-05 Thread Alexey Izbyshev
Alexey Izbyshev <izbys...@ispras.ru> added the comment: > out of curiosity, did you actually diagnose a process deadlocked due to this > or was it noted via code inspection? The latter. I noted it while working on another issue. While it was easy to trigger a malloc() in child_e

[issue32777] subprocess: child_exec() uses _Py_set_inheritable() which is not async-signal-safe

2018-02-05 Thread Alexey Izbyshev
Change by Alexey Izbyshev <izbys...@ispras.ru>: -- keywords: +patch pull_requests: +5382 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue32777] subprocess: child_exec() uses _Py_set_inheritable() which is not async-signal-safe

2018-02-05 Thread Alexey Izbyshev
New submission from Alexey Izbyshev <izbys...@ispras.ru>: _Py_set_inheritable() raises a Python-level exception on error and thus is not async-signal-safe, but child_exec() must use only async-signal-safe functions because it's executed between fork() and exec(). Since a non-raising v

[issue32256] Make patchcheck.py work for out-of-tree builds

2018-01-25 Thread Alexey Izbyshev
Alexey Izbyshev <izbys...@ispras.ru> added the comment: Any objections to the PR? -- nosy: +belopolsky, eric.araujo ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue32236] open() shouldn't silently ignore buffering=1 in binary mode

2018-01-25 Thread Alexey Izbyshev
Alexey Izbyshev <izbys...@ispras.ru> added the comment: Any feedback on the updated PR? -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue32369] test_subprocess: last part of test_close_fds() doesn't check what's intended

2017-12-18 Thread Alexey Izbyshev
Change by Alexey Izbyshev <izbys...@ispras.ru>: -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <https://bu

[issue32369] test_subprocess: last part of test_close_fds() doesn't check what's intended

2017-12-18 Thread Alexey Izbyshev
Change by Alexey Izbyshev <izbys...@ispras.ru>: -- keywords: +patch pull_requests: +4815 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue32369] test_subprocess: last part of test_close_fds() doesn't check what's intended

2017-12-18 Thread Alexey Izbyshev
Change by Alexey Izbyshev <izbys...@ispras.ru>: -- nosy: +gregory.p.smith, pitrou ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue32369] test_subprocess: last part of test_close_fds() doesn't check what's intended

2017-12-18 Thread Alexey Izbyshev
New submission from Alexey Izbyshev <izbys...@ispras.ru>: The last part of test_close_fds() doesn't match its own comment. The following assertion always holds because fds_to_keep and open_fds are disjoint by construction. self.assertFalse(remaining_fds & fds_to_keep

[issue32236] open() shouldn't silently ignore buffering=1 in binary mode

2017-12-18 Thread Alexey Izbyshev
Alexey Izbyshev <izbys...@ispras.ru> added the comment: I had similar thoughts when I was fixing tests that broke due to ValueError. I've updated the PR to issue a RuntimeWarning instead. -- ___ Python tracker <rep...@bugs.python.or

[issue21332] subprocess bufsize=1 docs are misleading

2017-12-13 Thread Alexey Izbyshev
Change by Alexey Izbyshev <izbys...@ispras.ru>: -- pull_requests: +4732 ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue21332> ___

[issue32236] open() shouldn't silently ignore buffering=1 in binary mode

2017-12-13 Thread Alexey Izbyshev
Change by Alexey Izbyshev <izbys...@ispras.ru>: -- keywords: +patch pull_requests: +4730 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue10344] codecs.open() buffering doc needs fix

2017-12-13 Thread Alexey Izbyshev
Change by Alexey Izbyshev <izbys...@ispras.ru>: -- keywords: +patch pull_requests: +4731 stage: needs patch -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue32236] open() shouldn't silently ignore buffering=1 in binary mode

2017-12-10 Thread Alexey Izbyshev
Alexey Izbyshev <izbys...@ispras.ru> added the comment: I'm in favor of raising an exception because it'll expose existing code with incorrect assumptions. I'll check whether it breaks any tests and submit a PR. -- ___ Python tracke

[issue32270] subprocess closes redirected fds even if they are in pass_fds

2017-12-10 Thread Alexey Izbyshev
Alexey Izbyshev <izbys...@ispras.ru> added the comment: Regarding fixing (1), I'm worrying about backward compatibility a bit. Some people who discovered that behavior might rely on such "move" semantics and expect that the redirected descriptor is not leaked into the ch

[issue32270] subprocess closes redirected fds even if they are in pass_fds

2017-12-10 Thread Alexey Izbyshev
New submission from Alexey Izbyshev <izbys...@ispras.ru>: Demonstration: $ cat test.py import os import subprocess import sys fd = os.dup(sys.stdout.fileno()) subprocess.call([sys.executable, '-c', 'import sys;' 'print("Hello stdout");'

[issue32256] Make patchcheck.py work for out-of-tree builds

2017-12-08 Thread Alexey Izbyshev
New submission from Alexey Izbyshev <izbys...@ispras.ru>: Despite some steps made in issue 9860 make patchcheck still doesn't work for out-of-tree builds because it runs git and hg in the current directory instead of the source directory (msg169465). -- messages: 307875 nosy: iz

[issue32256] Make patchcheck.py work for out-of-tree builds

2017-12-08 Thread Alexey Izbyshev
Change by Alexey Izbyshev <izbys...@ispras.ru>: -- keywords: +patch pull_requests: +4663 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue30718] open builtin function: specifying the size of buffer has no effect for text files

2017-12-06 Thread Alexey Izbyshev
Alexey Izbyshev <izbys...@ispras.ru> added the comment: Yes, clarifying buffering for text mode in open() would be nice. @direprobs: just in case you didn't know, you can achieve what you want with something like the following in pre-3.7: with open("/dev/null", "wb&qu

[issue32236] open() shouldn't silently ignore buffering=1 in binary mode

2017-12-06 Thread Alexey Izbyshev
New submission from Alexey Izbyshev <izbys...@ispras.ru>: The fact that "buffering=1" is usable only in text mode is documented for open(). In binary mode, setting buffering to 1 is silently ignored and equivalent to using default buffer size. I argue that such behavior is:

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

2017-12-06 Thread Alexey Izbyshev
Alexey Izbyshev <izbys...@ispras.ru> added the comment: Yes, your claim is confirmed by the fact that there have been little interest in this issue since 2011. Still, non-blocking behavior is incorrectly specified in the docs and is inconsistent (as investigated by Martin). And obscure

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

2017-12-06 Thread Alexey Izbyshev
Alexey Izbyshev <izbys...@ispras.ru> added the comment: For added fun: at least one part of the standard library doesn't expect None returns from read() in the buffering layer. >>> import os >>> r, w = os.pipe2(os.O_NONBLOCK) >>> f = os.fdopen(r, 'r') >>

[issue29326] Blank lines in ._pth file are not ignored

2017-01-27 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: I've encountered this issue too. (FYI, the official 3.6.0 embeddable zip from https://www.python.org/downloads/windows/ does contain a blank line in its ._pth, so all its users get an invalid entry in sys.path). The patch is attached. I couldn't fix tests

[issue28896] Embeddable zip allows Windows registry to override module location

2016-12-08 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: Thanks to Steve and everyone for quick and decisive action! -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue28896] Embeddable zip allows Windows registry to override module location

2016-12-07 Thread Alexey Izbyshev
New submission from Alexey Izbyshev: The docs claim: "... the embedded distribution is (almost) fully isolated from the user’s system, including environment variables, system registry settings, and installed packages." Via ProcessMonitor tool I've discovered that python.exe stil

<    1   2   3   4