Roundup Robot devn...@psf.upfronthosting.co.za 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
Changes by Meador Inge mead...@gmail.com:
--
resolution: - fixed
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9041
___
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
keywords: +needs review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9041
___
___
Meador Inge mead...@gmail.com 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
Pauli Rikula pauli.rik...@gmail.com 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 rep...@bugs.python.org wrote:
Meador Inge mead...@gmail.com added the comment:
That is a good question. While it is true
Meador Inge mead...@gmail.com 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
Changes by Éric Araujo mer...@netwok.org:
--
nosy: -eric.araujo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9041
___
___
Python-bugs-list
Vinay Sajip vinay_sa...@yahoo.co.uk 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
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
nosy: +ezio.melotti
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9041
___
___
Python-bugs-list
Meador Inge mead...@gmail.com 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
Pauli Rikula pauli.rik...@gmail.com 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
Pauli Rikula pauli.rik...@gmail.com 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
New submission from Pauli Rikula pauli.rik...@gmail.com:
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)
Éric Araujo mer...@netwok.org 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
Brian Curtin cur...@acm.org 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 rep...@bugs.python.org
Éric Araujo mer...@netwok.org 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 rep...@bugs.python.org
16 matches
Mail list logo