[issue9041] raised exception is misleading

2012-05-28 Thread Meador Inge
Changes by Meador Inge : -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___ _

[issue9041] raised exception is misleading

2012-05-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8a65eceea56c by Meador Inge in branch '2.7': Issue #9041: raised exception is misleading http://hg.python.org/cpython/rev/8a65eceea56c New changeset a2e140b083e0 by Meador Inge in branch '3.2': Issue #9041: raised exception is misleading http://hg.

[issue9041] raised exception is misleading

2012-02-29 Thread Ezio Melotti
Changes by Ezio Melotti : -- keywords: +needs review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue9041] raised exception is misleading

2012-02-13 Thread Meador Inge
Meador Inge added the comment: After thinking about it a bit more I am OK with Vinay's proposal. Attached is an updated patch. Also, I also noticed that the 'struct' module has the same problem: >>> big_int = int(sys.float_info.max) * 2 >>> struct.pack('d', big_int) Traceback (most recent ca

[issue9041] raised exception is misleading

2012-02-08 Thread Pauli Rikula
Pauli Rikula added the comment: Could we overcome these issues by some kind of exception inheritance? On Tue, Aug 30, 2011 at 5:28 PM, Meador Inge wrote: > > Meador Inge added the comment: > > That is a good question.  While it is true that errors other than > 'PyExc_OverflowError', will be

[issue9041] raised exception is misleading

2011-08-30 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: -eric.araujo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue9041] raised exception is misleading

2011-08-30 Thread Meador Inge
Meador Inge added the comment: That is a good question. While it is true that errors other than 'PyExc_OverflowError', will be mapped onto a 'TypeError' I don't think that is a bad thing. Any errors that come out of 'PyFloat_AsDouble' should be handled on a case-by-case basis and not blindl

[issue9041] raised exception is misleading

2011-08-29 Thread Vinay Sajip
Vinay Sajip added the comment: While the patch might improve over the current situation, doesn't it potentially mask other errors which might be raised by PyFloat_AsDouble()? Why not just x = PyFloat_AsDouble(value); if (PyErr_Occurred()) return NULL; which would not mask any exception?

[issue9041] raised exception is misleading

2011-04-17 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue9041] raised exception is misleading

2011-04-16 Thread Meador Inge
Meador Inge added the comment: This problem still occurs in the main development branch. I think the 'PyErr_ExceptionMatches' check that Pauli suggested will work. The same problem exist for 'c_float', 'c_double', and 'c_longdouble'. Attached is a patch that fixes the issue and includes cov

[issue9041] raised exception is misleading

2010-06-22 Thread Pauli Rikula
Pauli Rikula added the comment: If d_set makes the conversion, py3k does the same thing: http://svn.python.org/projects/python/branches/py3k/Modules/_ctypes/cfield.c It has a function d_set_sw, which might have same issues as well. The same function can be found from 2.6 too: http://svn.python

[issue9041] raised exception is misleading

2010-06-22 Thread Pauli Rikula
Pauli Rikula added the comment: I'm a newbie what it comes to Python's C-sources, so please do not take me too seriously. I fetched the sources 'svn checkout http://svn.python.org/projects/python/branches/release26-maint ' studied the issue, and my best guess is that Modules/_ctypes/cfield.c 's

[issue9041] raised exception is misleading

2010-06-21 Thread Éric Araujo
Éric Araujo added the comment: Thanks Brian, I’ll note that somewhere and be exact in the future. *has to check the bugs he’s nosy on now to correct comments* -- ___ Python tracker _

[issue9041] raised exception is misleading

2010-06-21 Thread Brian Curtin
Brian Curtin added the comment: "they only get security and documentation fixes" 2.6 does receive bug fixes. 2.5 is the version in security fix only mode. -- nosy: +brian.curtin ___ Python tracker

[issue9041] raised exception is misleading

2010-06-21 Thread Éric Araujo
Éric Araujo added the comment: Thanks for your report. Unfortunately, 2.6 and 3.1 are stable releases, they only get security and documentation fixes. 2.7 is nearly in the same state, since it’s at the release candidate stage. Can you check if your bug still applies to 3.2 (branch named “py3k

[issue9041] raised exception is misleading

2010-06-21 Thread Pauli Rikula
New submission from Pauli Rikula : Python 2.6.4 (r264:75706, Dec 7 2009, 18:45:15) [GCC 4.4.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import ctypes >>> ctypes.c_double(-10L) c_double(-10.0) >>> ctypes.c_double(-16158503035655503650357438344334975980