[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't real

[issue15988] Inconsistency in overflow error messages of integer argument

2017-08-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Glad to see you again Oren! Maybe first finish issue28261? It looks easier. -- ___ Python tracker ___

[issue15988] Inconsistency in overflow error messages of integer argument

2017-08-03 Thread Oren Milman
Oren Milman added the comment: How do we proceed? should I update (if needed) each of the patches I uploaded in March to eliminate commit conflicts? or can someone review them as they are now? -- ___ Python tracker

[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 raises -- ___

[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: h

[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 fai

[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://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://bu

[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/file4

[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.) -- Added file: ht

[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 fi

[issue15988] Inconsistency in overflow error messages of integer argument

2017-03-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: it is hard to discuss such large patch on GitHub since diffs and comments to all files are shown on one page. Rietveld is more appropriate since it shows only one file at the time. I suggest you Oren to provide the next version of your patch as a patch for r

[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 op

[issue15988] Inconsistency in overflow error messages of integer argument

2017-03-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I agree. It would be better to remove from the PR changes that can be covered by issue29816, issue29819 and other changes that changes visible behavior and open one or several new issues for them. Maybe one meta-issue and few concrete issues? Such methods a

[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 approval. here is what

[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 -- ___ Pytho

[issue15988] Inconsistency in overflow error messages of integer argument

2017-03-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think that raising OverflowError exceptions should be avoided if this is possible. If some function requires non-negative integer and raises ValueError for small negative integers and OverflowError for large negative integers, it is desirable to make it ra

[issue15988] Inconsistency in overflow error messages of integer argument

2017-03-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I just have started reviewing the PR and it looks great! -- ___ Python tracker ___ ___ Python-bugs

[issue15988] Inconsistency in overflow error messages of integer argument

2017-03-15 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- dependencies: +Get rid of C limitation for shift count in right shift, can't set big int-like objects to items in array 'Q', 'L' and 'I' ___ Python tracker

[issue15988] Inconsistency in overflow error messages of integer argument

2017-03-14 Thread Oren Milman
Changes by Oren Milman : -- pull_requests: +551 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[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 __

[issue15988] Inconsistency in overflow error messages of integer argument

2017-03-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The patch no longer applied cleanly (in particular to arraymodule.c). Oren, could you please update it? -- ___ Python tracker ___ ___

[issue15988] Inconsistency in overflow error messages of integer argument

2016-10-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Oren. I'll make a detailed review in next few days. -- stage: needs patch -> patch review versions: +Python 3.7 -Python 3.6 ___ Python tracker _

[issue15988] Inconsistency in overflow error messages of integer argument

2016-10-15 Thread Oren Milman
Changes by Oren Milman : Added file: http://bugs.python.org/file45108/testPatches.py ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue15988] Inconsistency in overflow error messages of integer argument

2016-10-15 Thread Oren Milman
Oren Milman added the comment: Sorry for taking so long to come up with a patch.. proposed changes 1. in Python/getargs.c in seterror, the following patches: - add a parameter 'p_format_code' - a pointer to the format code whose conversion failed.

[issue15988] Inconsistency in overflow error messages of integer argument

2016-07-15 Thread Terry J. Reedy
Terry J. Reedy added the comment: At this point in time, I have nothing further to add. So follow Serhiy's advice. -- ___ Python tracker ___ ___

[issue15988] Inconsistency in overflow error messages of integer argument

2016-07-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: You plan looks good, Oren. I meant what you are planning in the last two items. There are also specific functions for converting to platform-depending integer types (size_t, time_t, uid_t, etc). Two most common patterns: "Python int too large to convert to C

[issue15988] Inconsistency in overflow error messages of integer argument

2016-07-15 Thread Oren Milman
Oren Milman added the comment: I would be happy to write a patch for this issue, if you don't mind. Terry, as you were the one to commit the patch for #21559, I guess you are OK with keeping the OverflowError. Also, I agree that the error message for '_testcapi.getargs_b(-1)' (and for similar

[issue15988] Inconsistency in overflow error messages of integer argument

2014-06-02 Thread Terry J. Reedy
Terry J. Reedy added the comment: I reconsidered this in the light of #21559. getargs_b requires an integer of type int in range(256). A non-int properly raises TypeError. >>> from _testcapi import getargs_b as gb >>> gb(1.0) Traceback (most recent call last): File "", line 1, in gb(1.0)

[issue15988] Inconsistency in overflow error messages of integer argument

2013-01-07 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti stage: -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue15988] Inconsistency in overflow error messages of integer argument

2013-01-07 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue15988] Inconsistency in overflow error messages of integer argument

2012-10-16 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue15988] Inconsistency in overflow error messages of integer argument

2012-10-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- dependencies: +Possible integer overflow of PyLong_AsLong() results ___ Python tracker ___ ___ Python

[issue15988] Inconsistency in overflow error messages of integer argument

2012-09-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: 1) Use PyLong_AsLongAndOverflow instead PyLong_AsLong in PyArg_ParseTuple and in some other functions. 2) Unify an integer overflow error messages in different functions. -- ___ Python tracker

[issue15988] Inconsistency in overflow error messages of integer argument

2012-09-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: The reason for the different messages is clear -- there are different internal tests (I presume in different functions), each of which raises its own error. What do you propose to change? The only thing I can imagine is that when the bytes converter calls the

[issue15988] Inconsistency in overflow error messages of integer argument

2012-09-20 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: PyArg_ParseTuple raises inconsistent overflow error messages for small integer formats. For example: >>> import _testcapi >>> _testcapi.getargs_b(100) 100 >>> _testcapi.getargs_b(1000) Traceback (most recent call last): File "", line 1, in OverflowError: