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
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
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
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
Change by Alexey Izbyshev <izbys...@ispras.ru>:
--
nosy: +gregory.p.smith, pitrou
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python
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
Change by Alexey Izbyshev <izbys...@ispras.ru>:
--
keywords: +patch
pull_requests: +4815
stage: -> patch review
___
Python tracker <rep...@bugs.python.org>
<https://bugs.pyt
Change by Alexey Izbyshev <izbys...@ispras.ru>:
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker <rep...@bugs.python.org>
<https://bu
Change by Alexey Izbyshev <izbys...@ispras.ru>:
--
keywords: +patch
pull_requests: +4730
stage: -> patch review
___
Python tracker <rep...@bugs.python.org>
<https://bugs.pyt
Change by Alexey Izbyshev <izbys...@ispras.ru>:
--
pull_requests: +4732
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue21332>
___
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
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
Change by Alexey Izbyshev <izbys...@ispras.ru>:
--
keywords: +patch
pull_requests: +4663
stage: -> patch review
___
Python tracker <rep...@bugs.python.org>
<https://bugs.pyt
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')
>>
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
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:
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
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");'
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
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
Alexey Izbyshev <izbys...@ispras.ru> added the comment:
Any feedback on the updated PR?
--
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python
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
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
Change by Alexey Izbyshev <izbys...@ispras.ru>:
--
keywords: +patch
pull_requests: +5382
stage: -> patch review
___
Python tracker <rep...@bugs.python.org>
<https://bugs.pyt
Change by Alexey Izbyshev <izbys...@ispras.ru>:
--
keywords: +patch
pull_requests: +5482
stage: -> patch review
___
Python tracker <rep...@bugs.python.org>
<https://bugs.pyt
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
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
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
Change by Alexey Izbyshev <izbys...@ispras.ru>:
--
keywords: +patch
pull_requests: +5503
stage: -> patch review
___
Python tracker <rep...@bugs.python.org>
<https://bugs.pyt
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
Alexey Izbyshev <izbys...@ispras.ru> added the comment:
ktrace shows that dup(0) succeeded but fstat(0) failed. The symptom is the same
as in #30225. Could you check whether any of the following quick tests produces
the same error?
python3 -c 'import os, subprocess, sys; r, w = o
Alexey Izbyshev <izbys...@ispras.ru> added the comment:
>Also, it has to skip this check if the FD is flagged as a pipe, because a pipe
>is likely opened in synchronous mode and blocked on a read in the parent, in
>which case calling GetFileType would deadlock.
Does an
Alexey Izbyshev <izbys...@ispras.ru> added the comment:
@eryksun: Thank you for the note! I've commented on #32865. This adds even more
inconsistency to this corner case.
--
___
Python tracker <rep...@bugs.python.org>
<https://
Alexey Izbyshev <izbys...@ispras.ru> added the comment:
> I think that we can even drop dup-based validation from is_valid_fd()
For POSIX, that is. There is no fstat on Windows, and dup is probably OK there
(or, even better, dup2(fd, fd) -- no need
Alexey Izbyshev <izbys...@ispras.ru> added the comment:
OK, never mind with the test. I've finally got to a FreeBSD box and reproduced
the problem. It has to do with 'revoke' feature of *BSD. When revoke is called
on a terminal device (as part of logout process, for example), all descr
New submission from Alexey Izbyshev <izbys...@ispras.ru>:
Demo:
>>> os.execve('', ['a'], {})
Traceback (most recent call last):
File "", line 1, in
OSError: [WinError 0] The operation completed successfully: ''
The reason is that path_error() used through
Change by Alexey Izbyshev <izbys...@ispras.ru>:
--
keywords: +patch
pull_requests: +5565
stage: -> patch review
___
Python tracker <rep...@bugs.python.org>
<https://bugs.pyt
Alexey Izbyshev <izbys...@ispras.ru> added the comment:
The failed test is test_posix_fallocate, not test_posix_fallocate_errno. The
former special-cases Solaris for EINVAL already, and the latter merely passes
an invalid descriptor.
It seems that this particular issue is still ope
New submission from Alexey Izbyshev <izbys...@ispras.ru>:
win32_wchdir() retries GetCurrentDirectory() with a larger buffer if necessary,
but doesn't check whether the new buffer is large enough. Another thread could
change the current directory in meanwhile, so the buffer could tu
Change by Alexey Izbyshev <izbys...@ispras.ru>:
--
keywords: +patch
pull_requests: +5579
stage: -> patch review
___
Python tracker <rep...@bugs.python.org>
<https://bugs.pyt
Change by Alexey Izbyshev <izbys...@ispras.ru>:
--
keywords: +patch
pull_requests: +5580
stage: -> patch review
___
Python tracker <rep...@bugs.python.org>
<https://bugs.pyt
Alexey Izbyshev <izbys...@ispras.ru> added the comment:
The same issue applies to os.getcwd().
--
title: os.chdir() may crash on Windows in presence of races -> os.chdir(),
os.getcwd() may crash on Windows in presence of races
___
Pytho
Change by Alexey Izbyshev <izbys...@ispras.ru>:
--
versions: +Python 2.7
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32903>
___
New submission from Alexey Izbyshev <izbys...@ispras.ru>:
'new_path' is not freed if the new directory is a UNC path longer than MAX_PATH.
--
components: Extension Modules, Windows
messages: 312522
nosy: izbyshev, paul.moore, steve.dower, tim.golden, vstinner, zach.ware
priority:
Change by Alexey Izbyshev <izbys...@ispras.ru>:
--
keywords: +patch
pull_requests: +5587
stage: -> patch review
___
Python tracker <rep...@bugs.python.org>
<https://bugs.pyt
New submission from Alexey Izbyshev <izbys...@ispras.ru>:
==
FAIL: test_resolve_common (test.test_pathlib.PathTest)
--
Traceback (most recent call last):
Change by Alexey Izbyshev <izbys...@ispras.ru>:
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker <rep...@bugs.python.org>
<https://bu
Change by Alexey Izbyshev <izbys...@ispras.ru>:
--
keywords: +patch
pull_requests: +5552
stage: -> patch review
___
Python tracker <rep...@bugs.python.org>
<https://bugs.pyt
Alexey Izbyshev <izbys...@ispras.ru> added the comment:
> But I'm not sure why it can be solved, sometimes, by restarting the the
> daemon.
Could it be simply because daemon is respawned from a process that does have a
valid stdin at the time of respawn?
Note that daemon h
New submission from Alexey Izbyshev <izbys...@ispras.ru>:
Demo:
>>> import os
>>> os.chdir(-1)
Traceback (most recent call last):
File "", line 1, in
OSError: [Errno 14] Bad address: -1
>>> os.chdir(-2)
Traceback (most recent call last):
File
Change by Alexey Izbyshev <izbys...@ispras.ru>:
--
nosy: +larry
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32887>
___
__
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
Change by Alexey Izbyshev <izbys...@ispras.ru>:
--
keywords: +patch
pull_requests: +5497
stage: -> patch review
___
Python tracker <rep...@bugs.python.org>
<https://bugs.pyt
Alexey Izbyshev <izbys...@ispras.ru> added the comment:
Thank you for checking. If this issue happens even when Python is run manually
from an ordinary shell, fixing it in the same way as in #30225 is probably not
what you want because while the error message will be gone the corresp
New submission from Alexey Izbyshev <izbys...@ispras.ru>:
MultiByteToWideChar expects the destination buffer size to be given in wide
characters, not bytes.
This is currently not a real issue since _Py_fopen_obj is only used internally
with mode being a short constant string in all call
Change by Alexey Izbyshev <izbys...@ispras.ru>:
--
keywords: +patch
pull_requests: +5517
stage: -> patch review
___
Python tracker <rep...@bugs.python.org>
<https://bugs.pyt
Change by Alexey Izbyshev <izbys...@ispras.ru>:
--
nosy: +izbyshev
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32920>
___
_
Alexey Izbyshev <izbys...@ispras.ru> added the comment:
This behavior is not specific to just Windows 8. Symlinks to directories are
treated as directories on Windows, in particular, they should be removed with
RemoveDirectory, not DeleteFile.
Is there any reason this issue is stil
Change by Alexey Izbyshev :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
New submission from Alexey Izbyshev :
The return value of PyUnicode_InternFromString() is dereferenced without
checking at
https://github.com/python/cpython/blob/ef8861c112ed1dac9351958c121bc24ca4ecdb08/Python/ast.c#L3256
Reported by Svace static analyzer.
--
components: Interpreter
Alexey Izbyshev added the comment:
I will be glad to rebase my PR and remove the try/except from the test if you
remove the dependency of separator searching code on PyUnicode_AsUTF8AndSize()
as you suggest. Or we can go the other way and merge mine first -- whatever you
prefer.
Note
Change by Alexey Izbyshev :
--
keywords: +patch
pull_requests: +8324
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue34457>
___
___
Py
Alexey Izbyshev added the comment:
The NULL dereference seems to be hard to trigger due to caching for
one-character Latin-1 strings, but being safe probably won't hurt.
--
___
Python tracker
<https://bugs.python.org/issue34
New submission from Alexey Izbyshev :
The return value of Py_BuildValue() is dereferenced without checking at
https://github.com/python/cpython/blob/ef8861c112ed1dac9351958c121bc24ca4ecdb08/Modules/_pickle.c#L3457
Reported by Svace static analyzer.
--
components: Extension Modules
Change by Alexey Izbyshev :
--
keywords: +patch
pull_requests: +8323
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue34456>
___
___
Py
Change by Alexey Izbyshev :
--
keywords: +patch
pull_requests: +8350
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue34474>
___
___
Py
Change by Alexey Izbyshev :
--
keywords: +patch
pull_requests: +8351
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue34477>
___
___
Py
New submission from Alexey Izbyshev :
The return value of PyFloat_FromDouble() at
https://github.com/python/cpython/blob/48ce4897f8f8d91d948ecd1241ffab002df2be9e/Python/bltinmodule.c#L2403
is not checked for NULL and then dereferenced.
Reported by Svace static analyzer.
A similar issue
New submission from Alexey Izbyshev :
The return value of PyTuple_GetSlice() at
https://github.com/python/cpython/blob/48ce4897f8f8d91d948ecd1241ffab002df2be9e/Objects/typeobject.c#L2297
is not checked for NULL and then dereferenced.
Reported by Svace static analyzer.
Currently
New submission from Alexey Izbyshev :
range_repr() contains the following snippet:
/* Check for special case values for printing. We don't always
need the step value. We don't care about errors
(it means overflow), so clear the errors. */
istep = PyNumber_AsSsize_t(r
New submission from Alexey Izbyshev :
The C datetime implementation uses PyUnicode_AsUTF8AndSize() in wrap_strftime()
and rejects strings containing surrogate code points (0xD800 - 0xDFFF) since
they can't be encoded in UTF-8. On the other hand, the pure-Python datetime
implementation
Change by Alexey Izbyshev :
--
pull_requests: +8355
___
Python tracker
<https://bugs.python.org/issue34482>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Alexey Izbyshev :
This is a follow-up of #34454. 'datetime' extension module attempts to encode
input strings into UTF-8 in several places, which requires special care because
some valid Python strings can't be represented in UTF-8. It makes sense to add
more tests
Change by Alexey Izbyshev :
--
keywords: +patch
pull_requests: +8353
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue34482>
___
___
Py
Change by Alexey Izbyshev :
--
pull_requests: +8354
___
Python tracker
<https://bugs.python.org/issue34454>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Alexey Izbyshev :
--
keywords: +patch
pull_requests: +8357
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue34468>
___
___
Py
Alexey Izbyshev added the comment:
Thank you, Brett, I've submitted a PR.
--
___
Python tracker
<https://bugs.python.org/issue34468>
___
___
Python-bugs-list m
New submission from Alexey Izbyshev :
A failure of PyUnicode_AsUTF8AndSize() in various fromisoformat() functions in
Modules/_datetimemodule.c leads to NULL dereference due to the missing check,
e.g.:
>>> from datetime import date
>>> date.fromisoformat('\ud800')
Segmen
Change by Alexey Izbyshev :
--
keywords: +patch
pull_requests: +8322
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue34454>
___
___
Py
New submission from Alexey Izbyshev :
The return value of PyTuple_New() is not checked for NULL at
https://github.com/python/cpython/blob/ef8861c112ed1dac9351958c121bc24ca4ecdb08/Objects/genobject.c#L1130
and then dereferenced.
--
components: Interpreter Core
messages: 324022
nosy
Change by Alexey Izbyshev :
--
keywords: +patch
pull_requests: +8383
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue34493>
___
___
Py
Change by Alexey Izbyshev :
--
pull_requests: +8395
___
Python tracker
<https://bugs.python.org/issue34492>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Alexey Izbyshev :
--
versions: +Python 3.7
___
Python tracker
<https://bugs.python.org/issue34492>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Alexey Izbyshev :
--
title: Python/coreconfig.c: Missing NULL check in _Py_wstrlist_copy() ->
Python/coreconfig.c: Fix _Py_wstrlist_copy()
___
Python tracker
<https://bugs.python.org/issu
New submission from Alexey Izbyshev :
In the following snippet from PyType_FromSpecWithBases() in
Objects/typeobject.c, spec->name is dereferenced by strrchr() but then is
checked for NULL:
/* Set the type name and qualname */
s = strrchr(spec->name, '.');
if (s =
Change by Alexey Izbyshev :
--
keywords: +patch
pull_requests: +8400
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue34502>
___
___
Py
New submission from Alexey Izbyshev :
Docs for sys.exit() contain the following note added in
https://github.com/python/cpython/blame/1871a4a35123b278443b960255cb14314ce196f6/Doc/library/sys.rst#L336
Changed in version 3.7: Added utf8_mode attribute for the new -X utf8 flag.
Does it belong
New submission from Alexey Izbyshev :
'exc_value' reference is leaked at
https://github.com/python/cpython/blob/5f79b50763d687aeeed8edcb4efcc7ac9f8fa186/Python/errors.c#L113
--
components: Interpreter Core
messages: 324099
nosy: benjamin.peterson, berker.peksag, izbyshev
New submission from Alexey Izbyshev :
The argument of PySequence_Check() is dereferenced at
https://github.com/python/cpython/blob/5f79b50763d687aeeed8edcb4efcc7ac9f8fa186/Objects/abstract.c#L1511
and then checked for NULL.
Reported by Svace static analyzer.
Since other PySomething_Check
Change by Alexey Izbyshev :
--
keywords: +patch
pull_requests: +8402
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue34501>
___
___
Py
Change by Alexey Izbyshev :
--
keywords: +patch
pull_requests: +8407
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue34504>
___
___
Py
Alexey Izbyshev added the comment:
@enedil It seems that all later check either set a message or simply propagate
the error set by a called function. Did you mean any specific later check?
--
___
Python tracker
<https://bugs.python.org/issue34
Change by Alexey Izbyshev :
--
keywords: +patch
pull_requests: +8406
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue34503>
___
___
Py
New submission from Alexey Izbyshev :
The return value of PyMem_RawMalloc() is not checked for NULL at
https://github.com/python/cpython/blob/ef8861c112ed1dac9351958c121bc24ca4ecdb08/Python/coreconfig.c#L71.
Reported by Svace static analyzer.
--
components: Interpreter Core
messages
Change by Alexey Izbyshev :
--
keywords: +patch
pull_requests: +8382
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue34492>
___
___
Py
New submission from Alexey Izbyshev :
If a format string contains code points outside of ASCII range, time.strftime()
can behave in four different ways depending on the platform, the current locale
and the code points:
* raise a UnicodeEncodeError
* return an empty string
* for surrogates
Alexey Izbyshev added the comment:
Yes, I've referenced the relevant message from #6697 in #34454.
The specific test you've referenced should be changed after #34481 is fixed --
it highlights inconsistency between C and Python implementations
New submission from Alexey Izbyshev :
A possible NULL return on out-of-memory condition at
Objects/unicodeobject.c:6835 is not handled.
Reported by Svace static analyzer.
--
components: Interpreter Core
messages: 323762
nosy: inada.naoki, izbyshev, serhiy.storchaka, vstinner
priority
Change by Alexey Izbyshev :
--
keywords: +patch
pull_requests: +8305
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue34436>
___
___
Py
New submission from Alexey Izbyshev :
The condition for disabling overallocation at 225b055/Objects/bytesobject.c:822
is always false.
Reported by Svace static analyzer.
--
components: Interpreter Core
messages: 323763
nosy: inada.naoki, izbyshev, serhiy.storchaka, vstinner
priority
1 - 100 of 331 matches
Mail list logo