[issue31471] assertion failure in subprocess.Popen() in case the env arg has a bad keys() method

2017-09-15 Thread Oren Milman
Changes by Oren Milman : -- pull_requests: +3586 ___ Python tracker <https://bugs.python.org/issue31471> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31478] assertion failure in random.seed() in case the seed argument has a bad __abs__() method

2017-09-15 Thread Oren Milman
Changes by Oren Milman : -- keywords: +patch pull_requests: +3587 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue31478> ___ ___ Py

[issue31478] assertion failure in random.seed() in case the seed argument has a bad __abs__() method

2017-09-15 Thread Oren Milman
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

[issue31486] calling a _json.Encoder object raises a SystemError in case obj.items() returned a tuple

2017-09-15 Thread Oren Milman
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,

[issue31490] assertion failure in ctypes in case an _anonymous_ attr appears outside _fields_

2017-09-16 Thread Oren Milman
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

[issue31490] assertion failure in ctypes in case an _anonymous_ attr appears outside _fields_

2017-09-16 Thread Oren Milman
Changes by Oren Milman : -- keywords: +patch pull_requests: +3606 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue31490> ___ ___ Py

[issue31492] assertion failures in case a module has a bad __name__ attribute

2017-09-16 Thread Oren Milman
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

[issue31492] assertion failures in case a module has a bad __name__ attribute

2017-09-16 Thread Oren Milman
Changes by Oren Milman : -- components: +Interpreter Core -Extension Modules ___ Python tracker <https://bugs.python.org/issue31492> ___ ___ Python-bugs-list m

[issue31492] assertion failures in case a module has a bad __name__ attribute

2017-09-16 Thread Oren Milman
Changes by Oren Milman : -- keywords: +patch pull_requests: +3611 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue31492> ___ ___ Py

[issue31505] assertion failure in _json.make_encoder() in case of a bad encoder() argument

2017-09-18 Thread Oren Milman
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&

[issue31505] assertion failure in json, in case _json.make_encoder() received a bad encoder() argument

2017-09-18 Thread Oren Milman
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 <

[issue31505] assertion failure in json, in case _json.make_encoder() received a bad encoder() argument

2017-09-18 Thread Oren Milman
Changes by Oren Milman : -- keywords: +patch pull_requests: +3638 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue31505> ___ ___ Py

[issue31531] crash and SystemError in case of a bad zipimport._zip_directory_cache

2017-09-20 Thread Oren Milman
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_

[issue29720] potential silent truncation in PyLong_AsVoidPtr

2017-03-04 Thread Oren Milman
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

[issue29730] unoptimal calls to PyNumber_Check

2017-03-05 Thread Oren Milman
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,

[issue29741] BytesIO methods don't accept integer types, while StringIO counterparts do

2017-03-06 Thread Oren Milman
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(

[issue29741] BytesIO methods don't accept integer types, while StringIO counterparts do

2017-03-06 Thread Oren Milman
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

[issue29741] BytesIO methods don't accept integer types, while StringIO counterparts do

2017-03-07 Thread Oren Milman
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

[issue29741] BytesIO methods don't accept integer types, while StringIO counterparts do

2017-03-07 Thread Oren Milman
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

[issue29741] BytesIO methods don't accept integer types, while StringIO counterparts do

2017-03-08 Thread Oren Milman
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

[issue29741] BytesIO methods don't accept integer types, while StringIO counterparts do

2017-03-08 Thread Oren Milman
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

[issue29741] BytesIO methods don't accept integer types, while StringIO counterparts do

2017-03-08 Thread Oren Milman
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

[issue29741] BytesIO methods don't accept integer types, while StringIO counterparts do

2017-03-08 Thread Oren Milman
Changes by Oren Milman : -- pull_requests: +461 ___ Python tracker <http://bugs.python.org/issue29741> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue28298] can't set big int-like objects to items in array 'Q', 'L' and 'I'

2017-03-08 Thread Oren Milman
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

[issue28298] can't set big int-like objects to items in array 'Q', 'L' and 'I'

2017-03-08 Thread Oren Milman
Changes by Oren Milman : -- pull_requests: +466 ___ Python tracker <http://bugs.python.org/issue28298> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue28298] can't set big int-like objects to items in array 'Q', 'L' and 'I'

2017-03-09 Thread Oren Milman
Changes by Oren Milman : -- pull_requests: +476 ___ Python tracker <http://bugs.python.org/issue28298> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue28298] can't set big int-like objects to items in array 'Q', 'L' and 'I'

2017-03-09 Thread Oren Milman
Changes by Oren Milman : -- pull_requests: +485 ___ Python tracker <http://bugs.python.org/issue28298> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue28298] can't set big int-like objects to items in array 'Q', 'L' and 'I'

2017-03-10 Thread Oren Milman
Oren Milman added the comment: Thanks for the reviews :) -- ___ Python tracker <http://bugs.python.org/issue28298> ___ ___ Python-bugs-list mailing list Unsub

[issue15988] Inconsistency in overflow error messages of integer argument

2017-03-10 Thread Oren Milman
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

[issue29741] BytesIO methods don't accept integer types, while StringIO counterparts do

2017-03-10 Thread Oren Milman
Changes by Oren Milman : -- pull_requests: +501 ___ Python tracker <http://bugs.python.org/issue29741> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29741] BytesIO methods don't accept integer types, while StringIO counterparts do

2017-03-10 Thread Oren Milman
Oren Milman added the comment: done -- ___ Python tracker <http://bugs.python.org/issue29741> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue29741] BytesIO methods don't accept integer types, while StringIO counterparts do

2017-03-10 Thread Oren Milman
Oren Milman added the comment: thanks :) I would update the original PR soon. -- ___ Python tracker <http://bugs.python.org/issue29741> ___ ___ Python-bugs-list m

[issue29741] BytesIO methods don't accept integer types, while StringIO counterparts do

2017-03-10 Thread Oren Milman
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

[issue29730] unoptimal calls to PyNumber_Check

2017-03-11 Thread Oren Milman
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

[issue29730] unoptimal calls to PyNumber_Check

2017-03-11 Thread Oren Milman
Changes by Oren Milman : -- pull_requests: +510 ___ Python tracker <http://bugs.python.org/issue29730> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29730] unoptimal calls to PyNumber_Check

2017-03-12 Thread Oren Milman
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_

[issue29730] unoptimal calls to PyNumber_Check

2017-03-12 Thread Oren Milman
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

[issue29730] unoptimal calls to PyNumber_Check

2017-03-12 Thread Oren Milman
Changes by Oren Milman : -- pull_requests: +537 ___ Python tracker <http://bugs.python.org/issue29730> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29730] unoptimal calls to PyNumber_Check

2017-03-12 Thread Oren Milman
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

[issue29730] unoptimal calls to PyNumber_Check

2017-03-12 Thread Oren Milman
Oren Milman added the comment: thanks for the reviews :) -- ___ Python tracker <http://bugs.python.org/issue29730> ___ ___ Python-bugs-list mailing list Unsub

[issue15988] Inconsistency in overflow error messages of integer argument

2017-03-14 Thread Oren Milman
Changes by Oren Milman : -- pull_requests: +551 ___ Python tracker <http://bugs.python.org/issue15988> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue28261] wrong error messages when using PyArg_ParseTuple to parse normal tuples

2017-03-15 Thread Oren Milman
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

[issue15988] Inconsistency in overflow error messages of integer argument

2017-03-15 Thread Oren Milman
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

[issue15988] Inconsistency in overflow error messages of integer argument

2017-03-15 Thread Oren Milman
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

[issue15988] Inconsistency in overflow error messages of integer argument

2017-03-15 Thread Oren Milman
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

[issue29816] Get rid of C limitation for shift count in right shift

2017-03-15 Thread Oren Milman
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

[issue28261] wrong error messages when using PyArg_ParseTuple to parse normal tuples

2017-03-16 Thread Oren Milman
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

[issue29834] Raise ValueError rather of OverflowError in PyLong_AsUnsignedLong()

2017-03-17 Thread Oren Milman
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

[issue29835] py_blake2*_new_impl produces inconsistent error messages, and raises OverflowError where ValueError might be better

2017-03-17 Thread Oren Milman
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

[issue29841] errors raised by bytes and bytearray constructors for invalid size argument

2017-03-17 Thread Oren Milman
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):

[issue29832] Don't refer to getsockaddrarg in error messages

2017-03-17 Thread Oren Milman
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

[issue29843] errors raised by ctypes.Array for invalid _length_ attribute

2017-03-18 Thread Oren Milman
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

[issue29843] errors raised by ctypes.Array for invalid _length_ attribute

2017-03-18 Thread Oren Milman
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

[issue29843] errors raised by ctypes.Array for invalid _length_ attribute

2017-03-18 Thread Oren Milman
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

[issue29843] errors raised by ctypes.Array for invalid _length_ attribute

2017-03-18 Thread Oren Milman
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

[issue15988] Inconsistency in overflow error messages of integer argument

2017-03-18 Thread Oren Milman
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

[issue29843] errors raised by ctypes.Array for invalid _length_ attribute

2017-03-18 Thread Oren Milman
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

[issue15988] Inconsistency in overflow error messages of integer argument

2017-03-18 Thread Oren Milman
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.) --

[issue15988] Inconsistency in overflow error messages of integer argument

2017-03-19 Thread Oren Milman
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

[issue15988] Inconsistency in overflow error messages of integer argument

2017-03-19 Thread Oren Milman
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

[issue15988] Inconsistency in overflow error messages of integer argument

2017-03-19 Thread Oren Milman
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

[issue15988] Inconsistency in overflow error messages of integer argument

2017-03-19 Thread Oren Milman
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

[issue15988] Inconsistency in overflow error messages of integer argument

2017-03-19 Thread Oren Milman
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

[issue15988] Inconsistency in overflow error messages of integer argument

2017-03-19 Thread Oren Milman
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

[issue30156] PYTHONDUMPREFS segfaults on exit

2017-04-24 Thread Oren Tirosh
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

[issue30156] PYTHONDUMPREFS segfaults on exit

2017-04-24 Thread Oren Tirosh
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

[issue31566] assertion failure in _warnings.warn() in case of a bad __name__ global

2017-09-23 Thread Oren Milman
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

[issue31566] assertion failure in _warnings.warn() in case of a bad __name__ global

2017-09-24 Thread Oren Milman
Changes by Oren Milman : -- keywords: +patch pull_requests: +3701 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue31566> ___ ___ Py

[issue31311] a SystemError and a crash in PyCData_setstate() when __dict__ is bad

2017-09-25 Thread Oren Milman
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

[issue31573] struct_rusage

2017-09-25 Thread Oren Milman
Changes by Oren Milman : -- nosy: Oren Milman priority: normal severity: normal status: open title: struct_rusage ___ Python tracker <https://bugs.python.org/issue31

[issue31573] crashes in os.wait3() and os.wait4() in case of a bad resource.struct_rusage

2017-09-25 Thread Oren Milman
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

[issue31577] crash in os.utime() in case of a bad ns argument

2017-09-25 Thread Oren Milman
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

[issue31577] crash in os.utime() in case of a bad ns argument

2017-09-25 Thread Oren Milman
Changes by Oren Milman : -- keywords: +patch pull_requests: +3739 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue31577> ___ ___ Py

[issue31577] crash in os.utime() in case of a bad ns argument

2017-09-25 Thread Oren Milman
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

[issue31586] SystemError in _collections._count_element() in case of a bad mapping argument

2017-09-25 Thread Oren Milman
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

[issue31588] SystemError in class creation in case of a metaclass with a bad __prepare__() method

2017-09-26 Thread Oren Milman
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

[issue31586] SystemError in _collections._count_element() in case of a bad mapping argument

2017-09-26 Thread Oren Milman
Changes by Oren Milman : -- keywords: +patch pull_requests: +3748 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue31586> ___ ___ Py

[issue31588] SystemError in class creation in case of a metaclass with a bad __prepare__() method

2017-09-26 Thread Oren Milman
Changes by Oren Milman : -- keywords: +patch pull_requests: +3749 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue31588> ___ ___ Py

[issue31592] assertion failure in Python/ast.c in case of a bad unicodedata.normalize()

2017-09-26 Thread Oren Milman
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

[issue31592] assertion failure in Python/ast.c in case of a bad unicodedata.normalize()

2017-09-26 Thread Oren Milman
Changes by Oren Milman : -- keywords: +patch pull_requests: +3752 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue31592> ___ ___ Py

[issue31602] assertion failure in zipimporter.get_source() in case of a bad zlib.decompress()

2017-09-26 Thread Oren Milman
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

[issue31602] assertion failure in zipimporter.get_source() in case of a bad zlib.decompress()

2017-09-27 Thread Oren Milman
Change by Oren Milman : -- keywords: +patch pull_requests: +3769 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue31602> ___ ___ Python-

[issue31605] meta issue: bugs.python.org search shows only issues with recent activity

2017-09-27 Thread Oren Milman
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

[issue31605] meta issue: bugs.python.org search shows only issues with recent activity

2017-09-27 Thread Oren Milman
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

[issue31605] meta issue: bugs.python.org search shows only issues with recent activity

2017-09-27 Thread Oren Milman
Change by Oren Milman : -- nosy: +ezio.melotti ___ Python tracker <https://bugs.python.org/issue31605> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31588] SystemError in class creation in case of a metaclass with a bad __prepare__() method

2017-09-27 Thread Oren Milman
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

[issue31608] crash in methods of a subclass of _collections.deque with a bad __new__()

2017-09-27 Thread Oren Milman
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

[issue31608] crash in methods of a subclass of _collections.deque with a bad __new__()

2017-09-27 Thread Oren Milman
Change by Oren Milman : -- keywords: +patch pull_requests: +3774 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue31608> ___ ___ Python-

[issue6986] _json crash on scanner/encoder initialization error

2017-09-27 Thread Oren Milman
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

[issue6986] _json crash on scanner/encoder initialization error

2017-09-27 Thread Oren Milman
Change by Oren Milman : -- pull_requests: +3775 ___ Python tracker <https://bugs.python.org/issue6986> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31531] crash and SystemError in case of a bad zipimport._zip_directory_cache

2017-09-27 Thread Oren Milman
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

[issue31605] meta issue: bugs.python.org search shows only issues with recent activity

2017-09-27 Thread Oren Milman
Oren Milman added the comment: thanks :) opened http://psf.upfronthosting.co.za/roundup/meta/issue642 -- ___ Python tracker <https://bugs.python.org/issue31

[issue31605] meta issue: bugs.python.org search shows only issues with recent activity

2017-09-27 Thread Oren Milman
Oren Milman added the comment: fixed indeed. thanks! :) -- ___ Python tracker <https://bugs.python.org/issue31605> ___ ___ Python-bugs-list mailing list Unsub

[issue15988] Inconsistency in overflow error messages of integer argument

2017-09-27 Thread Oren Milman
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&#

[issue31478] assertion failure in random.seed() in case the seed argument has a bad __abs__() method

2017-09-28 Thread Oren Milman
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

[issue28129] assertion failures in ctypes

2017-09-28 Thread Oren Milman
Oren Milman added the comment: Shouldn't we close this issue? -- ___ Python tracker <https://bugs.python.org/issue28129> ___ ___ Python-bugs-list m

[issue31285] a SystemError and an assertion failure in warnings.warn_explicit()

2017-09-28 Thread Oren Milman
Change by Oren Milman : -- pull_requests: +3789 ___ Python tracker <https://bugs.python.org/issue31285> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31285] a SystemError and an assertion failure in warnings.warn_explicit()

2017-09-28 Thread Oren Milman
Change by Oren Milman : -- pull_requests: +3791 ___ Python tracker <https://bugs.python.org/issue31285> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31285] a SystemError and an assertion failure in warnings.warn_explicit()

2017-09-28 Thread Oren Milman
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

[issue31285] a SystemError and an assertion failure in warnings.warn_explicit()

2017-09-28 Thread Oren Milman
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

<    1   2   3   4   >