Changes by Oren Milman :
--
pull_requests: +3586
___
Python tracker
<https://bugs.python.org/issue31471>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Oren Milman :
--
keywords: +patch
pull_requests: +3587
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue31478>
___
___
Py
Oren Milman added the comment:
i opened a PR that implements the first option, but of course I wouldn't
mind if you decide another option is better.
--
___
Python tracker
<https://bugs.python.org/is
New submission from Oren Milman:
the following code causes a SystemError:
import json.encoder
class BadDict(dict):
def items(self):
return ()
encoder = json.encoder.c_make_encoder(None, None, None, None, 'foo', 'bar',
True,
New submission from Oren Milman:
The following code causes an assertion failure:
import ctypes
class BadStruct(ctypes.Structure):
_fields_ = []
_anonymous_ = ['foo']
foo = None
this is because MakeAnonFields() (in Modules/_ctypes/stgdict.c) goes over the
names sp
Changes by Oren Milman :
--
keywords: +patch
pull_requests: +3606
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue31490>
___
___
Py
New submission from Oren Milman:
The following code causes an assertion failure:
import os
os.__name__ = None
os.does_not_exist
this is because module_getattro() (in Objects/moduleobject.c) assumes that
__name__ is a string, and passes it to PyErr_Format(), which asserts it is a
string.
if we
Changes by Oren Milman :
--
components: +Interpreter Core -Extension Modules
___
Python tracker
<https://bugs.python.org/issue31492>
___
___
Python-bugs-list m
Changes by Oren Milman :
--
keywords: +patch
pull_requests: +3611
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue31492>
___
___
Py
New submission from Oren Milman:
The following code causes an assertion failure:
import _json
def _bad_encoder(*args):
return None
enc = _json.make_encoder(None, None, _bad_encoder, None,
'foo', 'bar', None, None, None)
enc(obj='spam&
Changes by Oren Milman :
--
title: assertion failure in _json.make_encoder() in case of a bad encoder()
argument -> assertion failure in json, in case _json.make_encoder() received a
bad encoder() argument
___
Python tracker
<
Changes by Oren Milman :
--
keywords: +patch
pull_requests: +3638
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue31505>
___
___
Py
New submission from Oren Milman:
The following code causes the interpreter to crash (in case 'foo.zip' exists):
import zipimport
zipimport._zip_directory_cache['foo.zip'] = None
importer = zipimport.zipimporter('foo.zip')
importer.find_
New submission from Oren Milman:
I am not sure whether such a platform exists, but on a platform where
SIZEOF_VOID_P < SIZEOF_LONG, PyLong_AsVoidPtr (which is in
Objects/longobject.c) is:
long x;
if (PyLong_Check(vv) && _PyLong_Sign(vv) < 0)
x = PyLong_AsLong
New submission from Oren Milman:
current state
if (PyNumber_Check(obj)) {
someVar = PyNumber_AsSsize_t(obj, SomeError);
if (someVar == -1 && PyErr_Occurred()) {
return errVal;
}
}
else {
PyErr_Format(PyExc_TypeError,
New submission from Oren Milman:
current state
import io
class IntLike():
def __init__(self, num):
self._num = num
def __index__(self):
return self._num
__int__ = __index__
io.StringIO('blah blah').read(IntLike(2))
io.StringIO(
Oren Milman added the comment:
I don't have a use case for that. (I noticed this behavior by
chance, while working on some other issue.)
However, IIUC, commit 4fa88fa0ba35e25ad9be66ebbdaba9aca553dc8b,
by Benjamin Peterson, Antoine Pitrou and Amaury Forgeot d'Arc,
includes pa
Oren Milman added the comment:
using _PyIO_ConvertSsize_t sounds great.
with regard to tests for accepting integer types in other classes,
there aren't a lot of them, so I guess it is not always tested.
still, it is tested in (excluding tests of the actual feature of
treating integer typ
Oren Milman added the comment:
also with regard to adding tests, consider the following scenario:
in the future, someone writes a patch for these functions, which
makes them not accept integer types anymore.
assuming the tests don't exist, the writer of the patch doesn't
realize the p
Oren Milman added the comment:
I wrote a patch, but I attach it here and not in a PR, as you haven't approved
adding tests. (I would be happy to open a PR with or without the tests.)
I ran the test module (on my Windows 10), and seems like the patch doesn't
break anything.
also, whi
Oren Milman added the comment:
should I open a PR (even though we didn't give Florent enough time to
respond)?
--
___
Python tracker
<http://bugs.python.org/is
Oren Milman added the comment:
sure.
In general, should drafts (like this one) be uploaded here?
or is it always better to open a PR?
--
___
Python tracker
<http://bugs.python.org/issue29
Changes by Oren Milman :
--
pull_requests: +461
___
Python tracker
<http://bugs.python.org/issue29741>
___
___
Python-bugs-list mailing list
Unsubscribe:
Oren Milman added the comment:
yes and yes.
I would start with a PR for 3.7.
and thanks for the review :)
--
___
Python tracker
<http://bugs.python.org/issue28
Changes by Oren Milman :
--
pull_requests: +466
___
Python tracker
<http://bugs.python.org/issue28298>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Oren Milman :
--
pull_requests: +476
___
Python tracker
<http://bugs.python.org/issue28298>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Oren Milman :
--
pull_requests: +485
___
Python tracker
<http://bugs.python.org/issue28298>
___
___
Python-bugs-list mailing list
Unsubscribe:
Oren Milman added the comment:
Thanks for the reviews :)
--
___
Python tracker
<http://bugs.python.org/issue28298>
___
___
Python-bugs-list mailing list
Unsub
Oren Milman added the comment:
of course :)
but some time has passed, so i would re-check stuff, and run tests
etc., so it would probably take me some time.
--
___
Python tracker
<http://bugs.python.org/issue15
Changes by Oren Milman :
--
pull_requests: +501
___
Python tracker
<http://bugs.python.org/issue29741>
___
___
Python-bugs-list mailing list
Unsubscribe:
Oren Milman added the comment:
done
--
___
Python tracker
<http://bugs.python.org/issue29741>
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.pyth
Oren Milman added the comment:
thanks :)
I would update the original PR soon.
--
___
Python tracker
<http://bugs.python.org/issue29741>
___
___
Python-bugs-list m
Oren Milman added the comment:
or maybe git is smart enough to realize what happened, and I don't have
to update PR 560?
--
___
Python tracker
<http://bugs.python.org/is
Oren Milman added the comment:
after some closer examination, ISTM that in Objects/exceptions.c, we can't
remove PyNumber_Check to optimize or simplify the code, as the argument
'filename' can be either an integer type (only in case the error is a
BlockingIOError), or quite anythi
Changes by Oren Milman :
--
pull_requests: +510
___
Python tracker
<http://bugs.python.org/issue29730>
___
___
Python-bugs-list mailing list
Unsubscribe:
Oren Milman added the comment:
"In bytes/bytearray methods -- integers and bytes-like objects."
(I guess you refer to parse_args_finds_byte (in Objects/bytes_methods.c))
so you suggest that in case (!PyIndex_Check(tmp_subobj)), we also check whether
(PyByteArray_Check(tmp_
Oren Milman added the comment:
"Perhaps some methods need to check also PyTuple_Check()."
which methods?
anyway, a new patch diff file is attached, according to your other seggustions,
Serhiy.
(I ran the test module, and some tests of my own, and it seems that the patch
doesn't
Changes by Oren Milman :
--
pull_requests: +537
___
Python tracker
<http://bugs.python.org/issue29730>
___
___
Python-bugs-list mailing list
Unsubscribe:
Oren Milman added the comment:
I am sorry, but I guess I am missing something about startswith() and
endswith().
ISTM that PyTuple_Check() is already called by unicode_startswith,
unicode_endswith and _Py_bytes_tailmatch, which already raise a TypeError
with an appropriate error message
(e.g
Oren Milman added the comment:
thanks for the reviews :)
--
___
Python tracker
<http://bugs.python.org/issue29730>
___
___
Python-bugs-list mailing list
Unsub
Changes by Oren Milman :
--
pull_requests: +551
___
Python tracker
<http://bugs.python.org/issue15988>
___
___
Python-bugs-list mailing list
Unsubscribe:
Oren Milman added the comment:
Raymond? any suggestions for how to make the code less ugly?
or do you have in mind a different approach for solving this issue?
--
___
Python tracker
<http://bugs.python.org/issue28
Oren Milman added the comment:
now that you opened #29816 and #29819, should I remove from the PR changes in
the following functions, and related tests?
- _io_BytesIO_truncate_impl
- _io_StringIO_truncate_impl
- long_rshift
- long_lshift
Oren Milman added the comment:
also, IMHO, we should open an issue named 'raise ValueError instead of
OverflowError when a negative int is invalid', and leave for that
new issue some the changes (which you commented about in the PR).
I didn't want to open it without your approva
Oren Milman added the comment:
I am sorry, but my 2nd term starts on Monday, so I am short on time,
and feel like I would be lucky to even finish working on PR 668.
because of that, and because you obviously have a much better
understanding of this issue than me, I would be happy if you could
Oren Milman added the comment:
i played a little with a patch earlier today, but stopped because I
am short on time.
anyway, just in case my code is not totally rubbish, I attach my
patch draft, which should avoid OverflowError also for big positive
ints.
(of course, I don't suggest to u
Oren Milman added the comment:
as Serhiy pointed out in PR 668, here are some more functions that produce the
same kind of wrong error messages:
- Modules/timemodule.c - gettmarg()
- Modules/socketmodule.c:
* getsockaddrarg()
* socket_getnameinfo()
ISTM that searching
Oren Milman added the comment:
note that there are functions that rely on the fact that
PyLong_AsUnsignedLong currently raises OverflowError for both cases.
such functions would probably use
PyErr_ExceptionMatches(PyExc_OverflowError)
or something like
PyErr_GivenExceptionMatches(err
New submission from Oren Milman:
1. currently, py_blake2s_new_impl and py_blake2b_new_impl might produce
inconsistent error messages (note that the first one happens on platforms
where sizeof(long) > 4):
>>> hashlib.blake2b(leaf_size=1 << 32)
Traceback (mos
New submission from Oren Milman:
currently (on my Windows 10):
>>> bytes(-1 << 1000)
Traceback (most recent call last):
File "", line 1, in
OverflowError: cannot fit 'int' into an index-sized integer
>>> bytes(-1)
Traceback (most recent call last):
Oren Milman added the comment:
note that #15988 also left 3 changes for this issue to fix, as can be
seen by searching for '29832' in the comments of PR 668.
for example, this issue should also fix the following inconsistent
error messages:
>>> socket.socket(family=socket.A
New submission from Oren Milman:
With regard to ctypes.Array:
currently:
>>> from ctypes import *
>>> class T(Array):
... _type_ = c_int
... _length_ = -1
...
Traceback (most recent call last):
File "", line 1, in
OverflowError: array too large
>&g
Oren Milman added the comment:
A patch draft (which doesn't change anything about the case of _length_ == 0)
is attached.
(I am not opening a PR, because I am not sure the behavior change would be
accepted.)
I ran the test module on my Windows 10, and it seems the patch doesn't brea
Oren Milman added the comment:
"If use _testcapi the tests should be decorated with cpython_only."
at first, I thought so too, but then I searched for 'cpython_only' in
Lib/ctypes/test, and found nothing. then I searched for '_testcapi' there,
and found a top l
Oren Milman added the comment:
yes, you are right, of course.
but regardless of this issue, shouldn't test_structures.py be changed
(in a seperate issue)?
ISTM it has a cpython-specific test not decorated in @cpython_only.
--
___
Python tr
Oren Milman added the comment:
Here is a patch including only changes related to PyLong_As* and PyArg_Parse*
functions.
(I ran the test module, and on my Windows 10, the same tests failed with
and without my patches. However, on my Ubuntu 16.04 VM, none of the tests
failed.)
--
Added
Oren Milman added the comment:
here is the patch updated according to your suggestions, Serhiy.
however, I wonder about the case of a too large _length_.
shouldn't we raise a MemoryError in such a case, in accordance with #29833?
BTW, while inspecting code related to a too large _lengt
Oren Milman added the comment:
Here is a patch including only changes related to formats using
the 'c' specifier.
(I ran the test module, and on my Windows 10, the same tests failed with
and without my patches. However, on my Ubuntu 16.04 VM, none of the tests
failed.)
--
Oren Milman added the comment:
Here is a patch including only changes related to array.
(I ran the test module, and on my Windows 10, the same tests failed with
and without my patches. However, on my Ubuntu 16.04 VM, none of the tests
failed.)
--
Added file: http://bugs.python.org
Oren Milman added the comment:
Here is a patch including only changes related to hashlib, lzma and pickle.
(I ran the test module, and on my Windows 10, the same tests failed with
and without my patches. However, on my Ubuntu 16.04 VM, none of the tests
failed.)
--
Added file: http
Oren Milman added the comment:
Here is a patch including only changes related to time and re.
(I ran the test module, and on my Windows 10, the same tests failed with
and without my patches. However, on my Ubuntu 16.04 VM, none of the tests
failed.)
--
Added file: http
Oren Milman added the comment:
Here is a patch including only changes related to curses, stat, callproc
(ctypes) and sequence_repeat (abstract).
(I ran the test module, and on my Windows 10, the same tests failed with
and without my patches. However, on my Ubuntu 16.04 VM, none of the tests
Oren Milman added the comment:
Here is a patch including only changes related to mmap, posix, socket and
select.
(I ran the test module, and on my Windows 10, the same tests failed with
and without my patches. However, on my Ubuntu 16.04 VM, none of the tests
failed.)
--
Added file
Oren Milman added the comment:
ISTM that what's left is (except for my 7 sub-patches):
- making the error messages of long_rshift and long_lshift consistent
(waits for #29816)
- deciding whether to open an issue for changing the type of errors
PyLong_AsSize_t r
New submission from Oren Tirosh:
Reproduce:
Py_DEBUG build
PYTHONDUMPREFS=1 ./python -c pass
(big dump of reference information)
Segmentation fault
git-bisected to commit 7822f151b68e40376af657d267ff774439d9adb9
--
components: Interpreter Core
messages: 292232
nosy: orent
Oren Tirosh added the comment:
In addition to fixing this - perhaps PYTHONDUMPREFS or something similar should
be added to test automation? It is apparently capable of uncovering some bugs
that none of the other reference and recnt debugging tools could find
New submission from Oren Milman:
The following code causes an assertion failure:
__name__ = b'foo'
__file__ = None
import _warnings
_warnings.warn('bar')
This is because setup_context() (in Python/_warnings.c) assumes that __name__
is a string, an
Changes by Oren Milman :
--
keywords: +patch
pull_requests: +3701
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue31566>
___
___
Py
Oren Milman added the comment:
> But this is a separate issue, 3.7 only.
I don't think i understand what this issue would include.
Anyway, i updated the PR according to your comments.
--
___
Python tracker
<https://bugs.python.org
Changes by Oren Milman :
--
nosy: Oren Milman
priority: normal
severity: normal
status: open
title: struct_rusage
___
Python tracker
<https://bugs.python.org/issue31
New submission from Oren Milman:
The following code causes the interpreter to crash:
import os
import time
import resource
new_pid = os.fork()
if new_pid == 0:
time.sleep(0.5)
else:
resource.struct_rusage = None
os.wait3(0)
We would get a crash also if we replaced 'os.wa
New submission from Oren Milman:
The following code causes the interpreter to crash:
class BadInt:
def __divmod__(*args):
return 42
import os
os.utime('foo.txt', ns=(BadInt(), 1))
This is because split_py_long_to_s_and_ns() (in Modules/posixmodule.c) assumes
that PyNum
Changes by Oren Milman :
--
keywords: +patch
pull_requests: +3739
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue31577>
___
___
Py
Oren Milman added the comment:
I opened a PR.
I think another fix might be to use
PyLong_Type.tp_as_number->long_divmod() instead of PyNumber_Divmod().
--
___
Python tracker
<https://bugs.python.org/issu
New submission from Oren Milman:
The following code causes a SystemError:
class BadMapping:
get = dict.get
__setitem__ = dict.__setitem__
import _collections
_collections._count_elements(BadMapping(), [42])
This is because _count_elements() (in Modules/_collectionsmodule.c) assumes
New submission from Oren Milman:
The following code causes a SystemError:
class BadMetaclass(type):
def __prepare__(*args):
pass
class Foo(metaclass=BadMetaclass):
pass
This is because builtin___build_class__() assumes that __prepare__() returned a
mapping, and passes it to
Changes by Oren Milman :
--
keywords: +patch
pull_requests: +3748
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue31586>
___
___
Py
Changes by Oren Milman :
--
keywords: +patch
pull_requests: +3749
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue31588>
___
___
Py
New submission from Oren Milman:
The following code causes an assertion failure:
import unicodedata
def bad_normalize(*args):
return None
unicodedata.normalize = bad_normalize
import ast
ast.parse('\u03D5')
This is because init_normalization() (in Python/ast.c) as
Changes by Oren Milman :
--
keywords: +patch
pull_requests: +3752
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue31592>
___
___
Py
New submission from Oren Milman :
The following code causes an assertion failure (in case there exists a
compressed zip file named 'foo.zip' with a file called 'bar.py' in it):
import zlib
import zipimport
def bad_decompress(*args):
return None
zlib.decompr
Change by Oren Milman :
--
keywords: +patch
pull_requests: +3769
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue31602>
___
___
Python-
New submission from Oren Milman :
For example, when I search for 'ctypes', I get only two results.
Just in case, i checked and got the same results in multiple browsers, and also
on Ubuntu and on Windows.
--
components: Demos and Tools
messages: 303114
nosy: Oren Milma
Oren Milman added the comment:
I am not 100% sure that issues are showed because they had a recent activity,
but ISTM like the reason..
--
___
Python tracker
<https://bugs.python.org/issue31
Change by Oren Milman :
--
nosy: +ezio.melotti
___
Python tracker
<https://bugs.python.org/issue31605>
___
___
Python-bugs-list mailing list
Unsubscribe:
Oren Milman added the comment:
Nick, maybe you tried to reproduce in release?
In debug (where I got the SystemError), you have in the beginning of
_PyFrame_New_NoTrack():
#ifdef Py_DEBUG
if (code == NULL || globals == NULL || !PyDict_Check(globals) ||
(locals != NULL
New submission from Oren Milman :
The following code causes the interpreter to crash:
import _collections
class BadDeque(_collections.deque):
def __new__(cls, *args):
if len(args):
return 42
return _collections.deque.__new__(cls)
BadDeque() * 42
(The
Change by Oren Milman :
--
keywords: +patch
pull_requests: +3774
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue31608>
___
___
Python-
Oren Milman added the comment:
I would be happy to open such a PR, if you don't mind.
--
nosy: +Oren Milman
___
Python tracker
<https://bugs.python.org/i
Change by Oren Milman :
--
pull_requests: +3775
___
Python tracker
<https://bugs.python.org/issue6986>
___
___
Python-bugs-list mailing list
Unsubscribe:
Oren Milman added the comment:
Yet another code that causes a SystemError:
import zipimport
importer = zipimport.zipimporter('foo.zip')
tup_as_list =
list(zipimport._zip_directory_cache['foo.zip']['foo\\__init__.py'])
tup_as_list[0] = None
zipimport._zip_d
Oren Milman added the comment:
thanks :)
opened http://psf.upfronthosting.co.za/roundup/meta/issue642
--
___
Python tracker
<https://bugs.python.org/issue31
Oren Milman added the comment:
fixed indeed. thanks! :)
--
___
Python tracker
<https://bugs.python.org/issue31605>
___
___
Python-bugs-list mailing list
Unsub
Oren Milman added the comment:
Serhiy, you suggested in https://bugs.python.org/issue15988#msg289799 that
uploading
diff files here is more convenient than in a github PR, so I uploaded my fixes
here,
and so https://github.com/python/cpython/pull/668 is now outdated, and merging
it
isn
Oren Milman added the comment:
With regard to backporting to 2.7:
In 2.7 also, PyNumber_Absolute() is called, and its return value is stored in
the variable n.
However, there is no _PyLong_NumBits(n), so there is no assertion failure.
If n isn't an integer:
- if !PyObject_IsTrue(n), the
Oren Milman added the comment:
Shouldn't we close this issue?
--
___
Python tracker
<https://bugs.python.org/issue28129>
___
___
Python-bugs-list m
Change by Oren Milman :
--
pull_requests: +3789
___
Python tracker
<https://bugs.python.org/issue31285>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Oren Milman :
--
pull_requests: +3791
___
Python tracker
<https://bugs.python.org/issue31285>
___
___
Python-bugs-list mailing list
Unsubscribe:
Oren Milman added the comment:
In 2.7, PyUnicode_Splitlines() first does:
string = PyUnicode_FromObject(string);
So i thought that PyUnicode_Splitlines() would be fine with receiving a string.
But now i realize that even in case i was right there, PyUnicode_Splitlines()
returns a unicode, and
Oren Milman added the comment:
Another thought - the existing code assumes that splitlines() returned a string.
So maybe we could just check that get_source() returned a string, and then call
the method str.splitlines() on it?
--
___
Python tracker
101 - 200 of 383 matches
Mail list logo