[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

[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

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

2017-09-28 Thread Oren Milman
Oren Milman added the comment: oh, of course, checking that get_source() returned a string before passing it to str.splitlines() is not needed. -- ___ Python tracker <https://bugs.python.org/issue31

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

2017-09-29 Thread Oren Milman
Oren Milman added the comment: But in case get_source() returned a unicode, is it likely that the splitlines() method of this unicode would return a 8-bit string? Currently show_warning() doesn't handle this scenario, as it assumes splitlines() returned an 8-bit string. Or do you think

[issue31637] integer overflow in the size of a ctypes.Array

2017-09-29 Thread Oren Milman
New submission from Oren Milman : The following code: from ctypes import * from _testcapi import PY_SSIZE_T_MAX, LONG_MAX if LONG_MAX == PY_SSIZE_T_MAX == (1 << 31) - 1: class MyArray(Array): _type_ = c_longlong _length_ = 1 << 29 arr = MyArray() for

[issue31637] integer overflow in the size of a ctypes.Array

2017-09-29 Thread Oren Milman
Oren Milman added the comment: oh, i missed that. sorry. -- ___ Python tracker <https://bugs.python.org/issue31637> ___ ___ Python-bugs-list mailing list Unsub

[issue31637] integer overflow in the size of a ctypes.Array

2017-09-29 Thread Oren Milman
Change by Oren Milman : -- resolution: -> duplicate stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue31637> ___ ___

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

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

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

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

[issue28280] Always return a list from PyMapping_Keys/PyMapping_Values/PyMapping_Items

2017-09-29 Thread Oren Milman
Oren Milman added the comment: I would be happy to write a PR that implements that. However, i am not sure which way is better to construct a list from the return value (an iterable, hopefully) of keys() etc.: - Call PyList_Type() (in each of PyMapping_Keys() etc.) on the iterable, and

[issue28280] Always return a list from PyMapping_Keys/PyMapping_Values/PyMapping_Items

2017-09-30 Thread Oren Milman
Oren Milman added the comment: (for knowledge preservation's sake) Resolving this issue would also resolve #31486. -- ___ Python tracker <https://bugs.python.org/is

[issue28280] Always return a list from PyMapping_Keys/PyMapping_Values/PyMapping_Items

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

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

2017-10-01 Thread Oren Milman
Change by Oren Milman : -- pull_requests: +3826 ___ Python tracker <https://bugs.python.org/issue31478> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue21983] segfault in ctypes.cast

2017-10-01 Thread Oren Milman
Oren Milman added the comment: IMHO, Lib/ctypes/test/test_cast.py is the relevant test. Mark, do you still wish to provide a fix for that? (Otherwise, i would be happy to open a PR.) -- nosy: +Oren Milman ___ Python tracker <ht

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

2017-10-02 Thread Oren Milman
Oren Milman added the comment: Should i remove the code that i wasn't able to test from the PR, and leave such changes to someone that is able to test it? (of course, if there is some way i can do it using a VM, please point that out, and i would try to set up th

[issue21983] segfault in ctypes.cast

2017-10-02 Thread Oren Milman
Change by Oren Milman : -- keywords: +patch pull_requests: +3839 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue21983> ___ ___ Python-

[issue21983] segfault in ctypes.cast

2017-10-02 Thread Oren Milman
Change by Oren Milman : -- versions: +Python 3.7 -Python 2.7, Python 3.4 ___ Python tracker <https://bugs.python.org/issue21983> ___ ___ Python-bugs-list mailin

[issue21983] segfault in ctypes.cast

2017-10-02 Thread Oren Milman
Change by Oren Milman : -- versions: +Python 2.7, Python 3.4 ___ Python tracker <https://bugs.python.org/issue21983> ___ ___ Python-bugs-list mailing list Unsub

[issue31271] an assertion failure in io.TextIOWrapper.write

2017-10-02 Thread Oren Milman
Oren Milman added the comment: sure -- ___ Python tracker <https://bugs.python.org/issue31271> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31271] an assertion failure in io.TextIOWrapper.write

2017-10-02 Thread Oren Milman
Oren Milman added the comment: I am not sure, but ISTM that it isn't possible for the encoder to return a unicode and not fail later. This is because _textiowrapper_writeflush() would call _io.BytesIO.write() (after it called _PyBytes_Join()), and bytesio_write() calls PyObject_GetB

[issue31683] a stack overflow on windows in faulthandler._fatal_error()

2017-10-03 Thread Oren Milman
New submission from Oren Milman : On my 64-bit Windows 10, the echo here would print -1073741571: python -c "import faulthandler; faulthandler._fatal_error(b'a' * 2 ** 22)" echo %errorlevel% This is code c0fd, which windbg describes as 'Stack overflow'. This

[issue31092] multiprocessing.Manager() race condition

2017-10-05 Thread Oren Milman
Oren Milman added the comment: IIUC: In Lang's example, doing `queue = None` caused the destruction of the shared queue, which caused a call to BaseProxy._decref() (in multiprocessing/managers.py), which dispatched a decref request to the manager's server process. Meanwhile, the poo

[issue31092] multiprocessing.Manager() race condition

2017-10-05 Thread Oren Milman
Oren Milman added the comment: Prof Plum, i changed the type of the issue to 'behavior', because Lang and me both got a KeyError. if your interpreter actually crashed, please change it back to 'crash'. -- ___ Python tracker <

[issue31165] null pointer deref and segfault in list_slice (listobject.c:455)

2017-10-06 Thread Oren Milman
Oren Milman added the comment: Here is some similar code that crashes for the same reasons: # create a circular reference with a malicious __del__(). class A: def __del__(*args): del list1[0] circ_ref_obj = A() circ_ref_obj._self = circ_ref_obj list1 = [None] list2 = [] del

[issue31092] multiprocessing.Manager() race condition

2017-10-06 Thread Oren Milman
Oren Milman added the comment: Davin and Antoine, i added you to the nosy list because you are listed as multiprocessing experts :) -- nosy: +davin, pitrou ___ Python tracker <https://bugs.python.org/issue31

<    1   2   3   4   >