Alexey Izbyshev 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 to cl
Alexey Izbyshev 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 descriptors
ass
Alexey Izbyshev 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 has an option to redirect std
Change by Alexey Izbyshev :
--
keywords: +patch
pull_requests: +5552
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue32849>
___
___
Py
New submission from Alexey Izbyshev :
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 "", line 1,
Change by Alexey Izbyshev :
--
nosy: +larry
___
Python tracker
<https://bugs.python.org/issue32887>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Alexey Izbyshev :
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 throughout
Change by Alexey Izbyshev :
--
keywords: +patch
pull_requests: +5565
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue32890>
___
___
Py
Alexey Izbyshev 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 open only because there is no NEWS
New submission from Alexey Izbyshev :
'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: normal
severi
Change by Alexey Izbyshev :
--
keywords: +patch
pull_requests: +5579
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue32903>
___
___
Py
New submission from Alexey Izbyshev :
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 turn out to be
still not
Change by Alexey Izbyshev :
--
keywords: +patch
pull_requests: +5580
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue32904>
___
___
Py
Change by Alexey Izbyshev :
--
versions: +Python 2.7
___
Python tracker
<https://bugs.python.org/issue32903>
___
___
Python-bugs-list mailing list
Unsubscribe:
Alexey Izbyshev 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
___
Python tracker
<
New submission from Alexey Izbyshev :
==
FAIL: test_resolve_common (test.test_pathlib.PathTest)
--
Traceback (most recent call last):
File "C:\work
Change by Alexey Izbyshev :
--
keywords: +patch
pull_requests: +5587
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue32907>
___
___
Py
Change by Alexey Izbyshev :
--
nosy: +izbyshev
___
Python tracker
<https://bugs.python.org/issue32920>
___
___
Python-bugs-list mailing list
Unsubscribe:
Alexey Izbyshev 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 still open?
--
nosy
Change by Alexey Izbyshev :
--
nosy: +izbyshev
___
Python tracker
<https://bugs.python.org/issue31512>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Alexey Izbyshev :
--
pull_requests: +5715
___
Python tracker
<https://bugs.python.org/issue32903>
___
___
Python-bugs-list mailing list
Unsubscribe:
Alexey Izbyshev added the comment:
@ajk225 It may be useful to look at #25942 before working on this.
--
nosy: +izbyshev
___
Python tracker
<https://bugs.python.org/issue32
New submission from Alexey Izbyshev :
Demo:
>>> from abc import ABC
>>> issubclass(1, ABC)
Segmentation fault (core dumped)
The stack trace is attached.
Before reimplementation of abc in C, the result was confusing too:
Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40)
Alexey Izbyshev added the comment:
In debug mode, the following assertion fails:
python: ./Modules/_abc.c:642: _abc__abc_subclasscheck_impl: Assertion
`((PyObject*)(mro))->ob_type))->tp_flags & ((1UL << 26))) != 0)' failed.
--
_
Alexey Izbyshev added the comment:
> Is there any sense in accepting non-types as the first argument of
> issubclass()?
No, though it is not (clearly) documented. The docs mention TypeError, but only
for the second argument if my reading is correct.
In practice, issubclass() ra
Alexey Izbyshev added the comment:
While judging by the source code it seems that bytes in 3.5 should be fine,
I've got a crash with the latest binary from python.org:
Python 3.5.4 (v3.5.4:3f56838, Aug 8 2017, 02:17:05) [MSC v.1900 64 bit (AMD64)]
on win32
Type "help", "
Alexey Izbyshev added the comment:
> As os.symlink requires administrative privileges on most versions of Windows
The current implementation requires SeCreateSymbolicLinkPrivilege on ALL
versions of Windows because users must pass an additional flag to
CreateSymbolicLink to enable
Alexey Izbyshev added the comment:
I've also checked that ABC.register() doesn't allow non-classes (and PEP 3119
mentions that).
Looking at PyObject_IsSubclass in Objects/abstract.c, the only case in which
its check_class() could be avoided is if there is a custom __subcl
Change by Alexey Izbyshev :
--
versions: +Python 3.7
___
Python tracker
<https://bugs.python.org/issue32999>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Alexey Izbyshev :
os.path.isdir() violates its own documentation by returning True for broken
directory symlinks or junctions, for which os.path.exists() returns False:
>>> os.mkdir('b')
>>> import _winapi
>>> _winapi.Cre
Alexey Izbyshev added the comment:
OK, making a new implementation behave as the old one is fine with me too.
BTW, do TypeErrors related to weak references deserve any treatment? Isn't it a
kind of coincidence that the error raised due to usage of WeakSet in
issubclass(obj, ABC) is wh
Alexey Izbyshev added the comment:
Thank you for the detailed response, Eryk!
> A mount point is always a directory, even if the volume isn't currently
> available.
Do I understand correctly that you propose to additionally change
os.path.exists() to return True for mount
Alexey Izbyshev added the comment:
Hmm, actually, my NFS example is probably bad. I've run an experiment, and
stat() simply hangs in the case if the NFS server is down.
--
___
Python tracker
<https://bugs.python.org/is
New submission from Alexey Izbyshev :
The first call of GetFinalPathNameByHandleW requests the required buffer size
for the NT path (VOLUME_NAME_NT), while the second call receives the DOS path
(VOLUME_NAME_DOS) in the allocated buffer. Usually, NT paths are longer than
DOS ones, for example
Change by Alexey Izbyshev :
--
keywords: +patch
pull_requests: +5775
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue33016>
___
___
Py
Alexey Izbyshev added the comment:
Sorry for status update, this was due to a concurrent modification.
--
nosy: +jab
resolution: -> fixed
status: open -> closed
___
Python tracker
<https://bugs.python.org/i
Alexey Izbyshev added the comment:
@inada.naoki: I don't question your change. My point is the same as in #33018
(I've discovered that PR only after I commented). The error message is
misleading, and it's just a coincidence that a TypeError and not some other
error is
Alexey Izbyshev added the comment:
ABC.register() has an explicit check, and it is mentioned in PEP 3119. The
point here is not to change issubclass(), but to change
ABC.__subclasscheck__(). It may conceivably have stricter requirements than
issubclass() has. But certainly an advice from
Alexey Izbyshev added the comment:
I do not see any point in allowing non-types in ABCMeta.__subclasscheck__.
Currently, ABCs are clearly not designed to support non-types:
1. ABCMeta.register() accepts types only.
2. ABCMeta.__subclasscheck__ implicitly requires its arguments to support weak
Alexey Izbyshev added the comment:
> Isn't it just a limitation?
> Most Python-implemented objects supports weakref. I don't think "requiring
> weakref support implies it must be type object".
Formally, there is no implication. It is the abc module authors who
Alexey Izbyshev added the comment:
PR 5944 changes ABC.__subclasscheck__ (not issubclass) to check its first
argument, so if it's merged there will be no crash even with the revert.
--
___
Python tracker
<https://bugs.python.org/is
Alexey Izbyshev added the comment:
FWIW, GetLastError() docs[1] officially scare us:
Most functions that set the thread's last-error code set it when they fail.
However, some functions also set the last-error code when they succeed. If the
function is not documented to set the last-
Change by Alexey Izbyshev :
--
nosy: +izbyshev
___
Python tracker
<https://bugs.python.org/issue32592>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Alexey Izbyshev :
--
nosy: +izbyshev
___
Python tracker
<https://bugs.python.org/issue29871>
___
___
Python-bugs-list mailing list
Unsubscribe:
Alexey Izbyshev added the comment:
> Ideally, if we don't have to do any work to reacquire the GIL, we shouldn't
> do any work to preserve the error code either.
Before take_gil() knows whether it has to do any work, it calls
MUTEX_LOCK(_PyRuntime.ceval.gil.mutex),
Alexey Izbyshev added the comment:
@eryksun Very interesting! BTW, I looked at CreateFile docs, and the fact that
it may set the last error to zero is even documented there.
@steve.dower
> maybe we don't have to preserve errno on Windows?
There are still places where errno is relied
Alexey Izbyshev added the comment:
Copying the comment of @eryksun from PR 6010 for reference.
Because we only try VOLUME_NAME_DOS, this function always fails for a volume
that's not mounted as either a drive letter or a junction mount point. The
error in this case is ERROR_PATH_NOT_
Alexey Izbyshev added the comment:
> Because we only try VOLUME_NAME_DOS, this function always fails for a volume
> that's not mounted as either a drive letter or a junction mount point.
If a volume is not mounted, users have to use \\?\ or \\.\ either directly or
indirectly via a
Alexey Izbyshev added the comment:
> unless users are not prepared to deal with it
ARE prepared
> What do you think about handling this failure by calling GetFullPathName
> instead (e.g. "C:\Temp\NUL" => "\\.\NUL")?
I think it would indeed be nice if pathlib h
Alexey Izbyshev added the comment:
> We know that the path is valid because we have a handle (in this case the
> file system ensures that no parent directory in the path can be unlinked or
> renamed).
Thank you for pointing this out. I erroneously stated that the length of the
p
Alexey Izbyshev added the comment:
Regarding status quo (expanding the examples of @inada.naoki and @jab):
>>> import typing
>>> import collections.abc as cabc
>>> issubclass(typing.Mapping, cabc.Mapping)
Traceback (most recent call last):
File ""
Alexey Izbyshev added the comment:
I agree except that I'd like to see it in 3.7 too.
--
___
Python tracker
<https://bugs.python.org/issue33018>
___
___
Alexey Izbyshev added the comment:
Actually I've started to work on this with #32844, but got no feedback. This
issue may of course be fixed independently, but the problems with descriptor
ownership for fds <= 2 will remain unless all ownership problems are fixed
Change by Alexey Izbyshev :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Alexey Izbyshev added the comment:
An alternative fix is here:
https://github.com/izbyshev/cpython/commit/b89b52f28490b69142d5c061604b3a3989cec66c
Feel free to use the test if you don't like the approach :)
--
___
Python tracker
&
Alexey Izbyshev 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 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 errors
like in my example
New submission from Alexey Izbyshev :
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:
1. Inconsistent
For example
Alexey Izbyshev 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&quo
Change by Alexey Izbyshev :
--
keywords: +patch
pull_requests: +4663
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue32256>
___
___
Py
New submission from Alexey Izbyshev :
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: izbyshev
priority: n
New submission from Alexey Luchko :
$ python3 -c 'import io, quopri; quopri.decode(io.StringIO("some initial text
data"), io.StringIO())'
Traceback (most recent call last):
File "", line 1, in
File
"/opt/local/Library/Frameworks/Python.framework/V
New submission from Alexey Izbyshev :
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 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 child. OTOH, since
desc
Alexey Izbyshev 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 tracker
<https
Alexey Luchko added the comment:
Yes. With io.BytesIO() output, it works.
However, this kind of error messages is quite very confusing. It better be
possible to distinguish binary and text streams, so one (including quopri
module) could tell it won't work in advance %)
Thanks for refe
Change by Alexey Izbyshev :
--
keywords: +patch
pull_requests: +4731
stage: needs patch -> patch review
___
Python tracker
<https://bugs.python.org/issu
Change by Alexey Izbyshev :
--
keywords: +patch
pull_requests: +4730
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue32236>
___
___
Py
Change by Alexey Izbyshev :
--
pull_requests: +4732
___
Python tracker
<https://bugs.python.org/issue21332>
___
___
Python-bugs-list mailing list
Unsubscribe:
Alexey Izbyshev 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
<https://bugs.python.org/is
New submission from Alexey Izbyshev :
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 & open_fds,
&qu
Change by Alexey Izbyshev :
--
nosy: +gregory.p.smith, pitrou
___
Python tracker
<https://bugs.python.org/issue32369>
___
___
Python-bugs-list mailing list
Unsub
Change by Alexey Izbyshev :
--
keywords: +patch
pull_requests: +4815
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue32369>
___
___
Py
Change by Alexey Izbyshev :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Alexey Luchko added the comment:
I didn't mean type checking. The point is that since string and bytes are
different types, then binary and text files are actually much more different
than before python 3. Therefore they better be of different protocols.
Then inside quopri with String
Alexey Luchko added the comment:
1. On quopri.
It is counter-intuitive despite the clear statement in the doc-string.
Quoted-printable is used mostly for text encoding. (It would be quite awkward
and inefficient to use it for binary data.)
My case: I have a text and I mean to get a text
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: +8302
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue34435>
___
___
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
Change by Alexey Izbyshev :
--
keywords: +patch
pull_requests: +8305
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue34436>
___
___
Py
Alexey Izbyshev added the comment:
Thank you for merging!
--
resolution: -> fixed
___
Python tracker
<https://bugs.python.org/issue34435>
___
___
Python-
New submission from Alexey Izbyshev :
>>> from abc import ABCMeta
>>> class S(metaclass=ABCMeta):
... __subclasses__ = None
...
>>> issubclass(int, S)
Segmentation fault (core dumped)
This is the result of missing NULL check for 'subclasses' in
_abc__a
Change by Alexey Izbyshev :
--
keywords: +patch
pull_requests: +8310
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue34441>
___
___
Py
Change by Alexey Izbyshev :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
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
Change by Alexey Izbyshev :
--
keywords: +patch
pull_requests: +8322
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue34454>
___
___
Py
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 that
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
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
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/is
Change by Alexey Izbyshev :
--
pull_requests: +8329
___
Python tracker
<https://bugs.python.org/issue34457>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Alexey Izbyshev :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
versions: -Python 3.5
___
Python tracker
<https://bugs.python.or
Alexey Izbyshev added the comment:
No, I couldn't find any similar calls in save_global() in 2.7.
However, there is Py_BuildValue() call in initcPickle(), and its result is
passed unchecked to PyDict_SetItemString(), where it's eventually dereferenced.
In fact, all PyDict_Set
New submission from Alexey Izbyshev :
The code at
https://github.com/python/cpython/blob/28853a249b1d0c890b7e9ca345290bb8c1756446/Modules/_xxsubinterpretersmodule.c#L18
checks a wrong variable for NULL:
const char *str = PyUnicode_AsUTF8(strobj);
if (str == NULL) {
return
Change by Alexey Izbyshev :
--
keywords: +patch
pull_requests: +8337
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue34462>
___
___
Py
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_A
Alexey Izbyshev added the comment:
Thank you for benchmarking and merging, Victor!
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
New submission from Alexey Izbyshev :
The return value of new_delta() is not checked for NULL at
https://github.com/python/cpython/blob/ccd99752675042bd5f67d332c5b0ed85ba1f2da3/Modules/_datetimemodule.c#L1292
and then dereferenced.
Reported by Svace static analyzer.
--
components
201 - 300 of 470 matches
Mail list logo