On Fri, Apr 19, 2013 at 9:42 PM, Grant Edwards invalid@invalid.invalid wrote:
The OP asked for a string, and I thought you were proposing the string
'null'. If one is to use a string, then 'NaN' makes the most sense,
since it can be converted back into a floating point NaN object.
I infer
On 2013-04-19 10:34, Tim Roberts wrote:
Miki Tebeka miki.teb...@gmail.com wrote:
I'm trying to find a way to have json emit float('NaN') as 'N/A'.
No. There is no way to represent NaN in JSON. It's simply not part of the
specification.
I know that. I'm trying to emit the *string* 'N
On 2013-04-18, Wayne Werner wa...@waynewerner.com wrote:
On Wed, 17 Apr 2013, Miki Tebeka wrote:
I'm trying to find a way to have json emit float('NaN') as 'N/A'.
No. There is no way to represent NaN in JSON. It's simply not part of the
specification.
I know that. I'm trying to emit
On Fri, Apr 19, 2013 at 4:54 PM, Grant Edwards invalid@invalid.invalid wrote:
On 2013-04-18, Wayne Werner wa...@waynewerner.com wrote:
On Wed, 17 Apr 2013, Miki Tebeka wrote:
I'm trying to find a way to have json emit float('NaN') as 'N/A'.
No. There is no way to represent NaN in JSON. It's
float('NaN') as 'N/A'.
No. There is no way to represent NaN in JSON. It's simply not part of
the
specification.
I know that. I'm trying to emit the *string* 'N/A' for every NaN.
Why not use `null` instead? It seems to be semantically more similar...
Why not use 'NaN' instead? It seems
You understand that this will result in a chunk of text that is not JSON?
I think he means something like this:
json.dumps([float('nan')])
'[N/A]'
That's exactly what I mean :)
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, Apr 18, 2013 at 11:46:37AM +1000, Chris Angelico wrote:
Wait... you can do that? It's internal to iterencode, at least in
Python 3.3 and 2.7 that I'm looking at here.
In Python 2.6 it wasn't internal to iterencode; in Python 2.7 and 3.x
you probably would have to monkey-patch iterencode.
On Wed, 17 Apr 2013, Miki Tebeka wrote:
I'm trying to find a way to have json emit float('NaN') as 'N/A'.
No. There is no way to represent NaN in JSON. It's simply not part of the
specification.
I know that. I'm trying to emit the *string* 'N/A' for every NaN.
Why not use `null` instead
Miki Tebeka miki.teb...@gmail.com wrote:
I'm trying to find a way to have json emit float('NaN') as 'N/A'.
No. There is no way to represent NaN in JSON. It's simply not part of the
specification.
I know that. I'm trying to emit the *string* 'N/A' for every NaN.
You understand
I'm trying to find a way to have json emit float('NaN') as 'N/A'.
No. There is no way to represent NaN in JSON. It's simply not part of the
specification.
I know that. I'm trying to emit the *string* 'N/A' for every NaN.
--
http://mail.python.org/mailman/listinfo/python-list
In c37a3b9c-6fe8-48aa-b703-9b4f922c3...@googlegroups.com Miki Tebeka
miki.teb...@gmail.com writes:
I'm trying to find a way to have json emit float('NaN') as 'N/A'.
No. There is no way to represent NaN in JSON. It's simply not part of the
specification.
I know that. I'm trying to emit
Miki Tebeka miki.teb...@gmail.com writes:
I'm trying to find a way to have json emit float('NaN') as 'N/A'.
No. There is no way to represent NaN in JSON. It's simply not part of the
specification.
I know that. I'm trying to emit the *string* 'N/A' for every NaN.
Easiest way is probably
I'm trying to find a way to have json emit float('NaN') as 'N/A'.
Easiest way is probably to transform your object before you try to write
Yeah, that's what I ended up doing. Wondered if there's a better way ...
Thanks,
--
Miki
--
http://mail.python.org/mailman/listinfo/python-list
On 04/17/2013 03:05 PM, Johann Hibschman wrote:
Miki Tebeka miki.teb...@gmail.com writes:
I'm trying to find a way to have json emit float('NaN') as 'N/A'.
No. There is no way to represent NaN in JSON. It's simply not part of the
specification.
I know that. I'm trying to emit the *string
):
if some-check-if-obj-is-NaN:
return 'NaN'
return json.JSONEncoder.default(self, obj)
Roland
--
http://mail.python.org/mailman/listinfo/python-list
[Roland]
yes, there is: subclass+extend the JSON-encoder, see pydoc json.
Please read the original post before answering. What you suggested does not
work since NaN is of float type.
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
yes, there is: subclass+extend the JSON-encoder, see pydoc json.
Please read the original post before answering. What you suggested does not
work since NaN is of float type.
ok, right, default does not work this way.
But I would still suggest to extend the JSON-encoder, since
On Thu, Apr 18, 2013 at 11:01 AM, Miki Tebeka miki.teb...@gmail.com wrote:
[Roland]
yes, there is: subclass+extend the JSON-encoder, see pydoc json.
Please read the original post before answering. What you suggested does not
work since NaN is of float type.
You may be able to override a bit
On Thu, Apr 18, 2013 at 11:39 AM, Roland Koebler r.koeb...@yahoo.de wrote:
as a quickhack, you
could even monkey patch json.encoder.floatstr with a wrapper which
returns N/A for NaN. (I've tested it: It works.)
Wait... you can do that? It's internal to iterencode, at least in
Python 3.3
Greetings,
I'm trying to find a way to have json emit float('NaN') as 'N/A'.
I can't seem to find a way since NaN is a float, which means overriding
default won't help.
Any simple way to do this?
Thanks,
--
Miki
--
http://mail.python.org/mailman/listinfo/python-list
Miki Tebeka miki.teb...@gmail.com wrote:
I'm trying to find a way to have json emit float('NaN') as 'N/A'.
I can't seem to find a way since NaN is a float, which means overriding
default won't help.
Any simple way to do this?
No. There is no way to represent NaN in JSON. It's simply not part
Marc Schlaich added the comment:
I'm +1 for a warning. The current behavior is really unexpectable:
In [6]: sorted([nan, 0, 1, -1])
Out[6]: [nan, -1, 0, 1]
In [7]: sorted([0, 1, -1, nan])
Out[7]: [-1, 0, 1, nan]
In [8]: sorted([0, nan, 1, -1])
Out[8]: [0, nan, -1, 1]
--
nosy
warnings are a bit of PITA to shut-off. For something like NaN ordering,
a warning is likely to inflict more harm on the users than the NaN ordering
issue itself.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11949
Steven D'Aprano wrote:
The list.index method tests for the item with equality. Since NANs are
mandated to compare unequal to anything, including themselves, index
cannot match them.
This is incorrect. .index() uses identity first, then equality, and
will match the same NaN in a list
Am 27.10.2012 06:48 schrieb Dennis Lee Bieber:
I don't know about the more modern calculators, but at least up
through my HP-41CX, HP calculators didn't do (binary) floating
point... They did a form of BCD with a fixed number of significant
/decimal/ digits
Then, what about sqrt(x)**2
On Thu, 25 Oct 2012 22:04:52 -0400, Terry Reedy wrote:
Containment of nan in collection is tested by is, not ==.
AFAICT, it isn't specific to NaN. The test used by .index() and in
appears to be equivalent to:
def equal(a, b):
return a is b or a == b
IOW, it always checks
On Sat, 27 Oct 2012 08:56:16 +0200, Thomas Rachel wrote:
Am 27.10.2012 06:48 schrieb Dennis Lee Bieber:
I don't know about the more modern calculators, but at least up
through my HP-41CX, HP calculators didn't do (binary) floating
point... They did a form of BCD with a fixed number of
On Thu, Oct 25, 2012 at 9:04 PM, Terry Reedy tjre...@udel.edu wrote:
On 10/25/2012 9:46 PM, mambokn...@gmail.com wrote:
a = [float('nan'), 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
a
[nan, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
a.index(float('nan'))
Traceback (most recent call last):
File stdin
On 25Oct2012 22:04, Terry Reedy tjre...@udel.edu wrote:
| Containment of nan in collection is tested by is, not ==.
| nan = float('nan')
| nan2 = float('nan')
| nan2 is nan
| False
This argues otherwise, and for use of math.isnan() instead.
I expect you were making the point that another
On 10/25/2012 10:44 PM, Steven D'Aprano wrote:
On Thu, 25 Oct 2012 22:04:52 -0400, Terry Reedy wrote:
It is a consequence of the following, which some people (but not all)
believe is mandated by the IEEE standard.
nan = float('nan')
nan is nan
True
The IEEE 754 standard says nothing
On 10/25/2012 10:19 PM, MRAB wrote:
On 2012-10-26 03:04, Terry Reedy wrote:
On 10/25/2012 9:46 PM, mambokn...@gmail.com wrote:
a = [float('nan'), 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
a
[nan, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
a.index(float('nan'))
This is a second nan object
On Fri, 26 Oct 2012 03:54:02 -0400, Terry Reedy wrote:
On 10/25/2012 10:44 PM, Steven D'Aprano wrote:
On Thu, 25 Oct 2012 22:04:52 -0400, Terry Reedy wrote:
It is a consequence of the following, which some people (but not all)
believe is mandated by the IEEE standard.
nan = float('nan
On Fri, 26 Oct 2012 04:00:03 -0400, Terry Reedy wrote:
On 10/25/2012 10:19 PM, MRAB wrote:
In summary, .index() looks for an item which is equal to its argument,
but it's a feature of NaN (as defined by the standard) that it doesn't
equal NaN, therefore .index() will never find it.
Except
On 2012-10-26 17:23, Steven D'Aprano wrote:
On Fri, 26 Oct 2012 04:00:03 -0400, Terry Reedy wrote:
On 10/25/2012 10:19 PM, MRAB wrote:
In summary, .index() looks for an item which is equal to its argument,
but it's a feature of NaN (as defined by the standard) that it doesn't
equal NaN
On Sat, Oct 27, 2012 at 3:23 AM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
In real life, you are *much* more likely to run into these examples of
insanity of floats than to be troubled by NANs:
- associativity of addition is lost
- distributivity of multiplication is lost
-
On Sat, 27 Oct 2012 03:45:46 +1100, Chris Angelico wrote:
On Sat, Oct 27, 2012 at 3:23 AM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
In real life, you are *much* more likely to run into these examples of
insanity of floats than to be troubled by NANs:
- associativity of
is mandated by the IEEE standard.
nan = float('nan')
nan is nan
True
The IEEE 754 standard says nothing about object identity. It only
discusses value equality.
nan == nan
False
IEEE 754 states that all NANs compare unequal to everything, including
NANs with the same bit value. It doesn't
On 10/26/2012 12:23 PM, Steven D'Aprano wrote:
On Fri, 26 Oct 2012 04:00:03 -0400, Terry Reedy wrote:
This inconsistency is an intentional decision to
not propagate the insanity of nan != nan to Python collections.
That's a value judgement about NANs which is not shared by everyone.
Quite
On Fri, Oct 26, 2012 at 2:40 PM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
The problem isn't with the associativity, it's with the equality
comparison. Replace x == y with abs(x-y)epsilon for some epsilon
and all your statements fulfill people's expectations.
O RYLY?
Would
a = [float('nan'), 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
a
[nan, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
a.index(float('nan'))
Traceback (most recent call last):
File stdin, line 1, in module
ValueError: list.index(x): x not in list
That means, the function .index() cannot detect nan values
On 10/25/2012 9:46 PM, mambokn...@gmail.com wrote:
a = [float('nan'), 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
a
[nan, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
a.index(float('nan'))
Traceback (most recent call last):
File stdin, line 1, in module
ValueError: list.index(x): x not in list
That means
On 25Oct2012 18:46, mambokn...@gmail.com mambokn...@gmail.com wrote:
| a = [float('nan'), 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
| a
| [nan, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
| a.index(float('nan'))
| Traceback (most recent call last):
| File stdin, line 1, in module
| ValueError: list.index(x): x
On 2012-10-26 03:04, Terry Reedy wrote:
On 10/25/2012 9:46 PM, mambokn...@gmail.com wrote:
a = [float('nan'), 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
a
[nan, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
a.index(float('nan'))
Traceback (most recent call last):
File stdin, line 1, in module
ValueError
On Thursday, October 25, 2012 7:16:02 PM UTC-7, Cameron Simpson wrote:
Of course!! How could I get into that trap??
Thanks to you to Terry
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 25 Oct 2012 18:46:20 -0700, mamboknave wrote:
That means, the function .index() cannot detect nan values. It happens
on both Python 2.6 and Python 3.1
Is this a bug? Or I am not using .index() correctly?
You shouldn't be using index() or == to detect NANs. The right way to
detect
On Thu, 25 Oct 2012 22:04:52 -0400, Terry Reedy wrote:
It is a consequence of the following, which some people (but not all)
believe is mandated by the IEEE standard.
nan = float('nan')
nan is nan
True
The IEEE 754 standard says nothing about object identity. It only
discusses value
Roundup Robot added the comment:
New changeset 31a7ff299698 by Mark Dickinson in branch '2.7':
Remove overeager test (don't depend on the sign of a nan; cf. issue #14521)
http://hg.python.org/cpython/rev/31a7ff299698
--
___
Python tracker rep
Roundup Robot added the comment:
New changeset 121cb9596e7d by Mark Dickinson in branch '3.2':
Remove overeager test (don't depend on the sign of a nan; cf. issue #14521)
http://hg.python.org/cpython/rev/121cb9596e7d
--
___
Python tracker rep
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset c468511fc887 by Mark Dickinson in branch 'default':
Issue #14521: Make result of float('nan') and float('-nan') more consistent
across platforms. Further, don't rely on Py_HUGE_VAL for float('inf').
http
Mark Dickinson dicki...@gmail.com added the comment:
Now fixed.
--
resolution: - fixed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14521
___
Changes by Mark Dickinson dicki...@gmail.com:
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14521
___
___
Mark Dickinson dicki...@gmail.com added the comment:
[Dirkjan]
Could we reconsider ARM support at this time?
Note that it's just the Linux old ABI (OABI) that needs this patch; ARM /
Linux using the new family of ABIs (EABI) should be fine. IIUC, this old ABI
is being phased out, but I
Martin v. Löwis mar...@v.loewis.de added the comment:
This issue remains as won't fix. ARM is supported; just OABI is not, and
never will be. If anybody needs that, they will have to maintain their own fork
of Python.
--
___
Python tracker
Éric Araujo mer...@netwok.org added the comment:
See http://patch-tracker.debian.org/package/python2.7 for the list of patches
applied to Python 2.7 in Debian. I don’t know if there are more patches in
Ubuntu.
--
nosy: +eric.araujo
___
Python
Changes by STINNER Victor victor.stin...@gmail.com:
--
title: time.time can return None or NaN - time.time can return NaN
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14613
STINNER Victor victor.stin...@gmail.com added the comment:
So NaN is a possible result from time.time()?
Oops. I don't know if it is possible. I just know that it cannot return None :-)
_PyTime_gettimeofday() fills a structure having two integer fields (tv_sec,
tv_usec), and floattime() uses
New submission from Michael Foord mich...@voidspace.org.uk:
time.time() can return None, or sometimes NaN. If it can't get a proper value
from the OS then I would expect it to throw an exception. The docs don't
mention anything about error conditions.
This was originally reported to Ubuntu
Changes by Michael Foord mich...@voidspace.org.uk:
--
stage: - test needed
type: - behavior
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14613
___
Changes by Michael Foord mich...@voidspace.org.uk:
--
versions: +Python 2.7, Python 3.2, Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14613
___
Mark Dickinson dicki...@gmail.com added the comment:
Issue 14028 is related.
--
nosy: +mark.dickinson
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14613
___
Changes by Roman roman.yepis...@canonical.com:
--
nosy: +rye
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14613
___
___
Python-bugs-list mailing
Martin v. Löwis mar...@v.loewis.de added the comment:
What exact version of Python was used? What's the complete list of patches that
was applied to this Python version?
As discussed in #14028, this behavior doesn't correspond to the code at all. So
hardware error, compiler error, and
STINNER Victor victor.stin...@gmail.com added the comment:
time.time() can return None, or sometimes NaN
It is possible that it returns NaN, but it cannot return None. time.time()
implementation of Python 2.7:
static PyObject *
time_time(PyObject *self, PyObject *unused)
{
double secs
Michael Foord mich...@voidspace.org.uk added the comment:
So NaN is a possible result from time.time()? Perhaps that should be mentioned
in the docs. Is returning NaN preferable to failing with an exception?
--
___
Python tracker rep
Mark Dickinson dicki...@gmail.com added the comment:
It is possible that it returns NaN
How is that possible? I can't see any way that the Python 2.7 implementation
of floattime could return a NaN. In each case, floattime appears to be
extracting integer fields from some suitable struct
Dirkjan Ochtman dirk...@ochtman.nl added the comment:
Could we reconsider ARM support at this time? Seems like ARM support has been
surging over the past few years, and it's becoming more supported by Linux
distributions. Seems like a pity to leave a patch like this out here.
--
nosy:
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
nosy: +Arfrever
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1762561
___
Mark Dickinson dicki...@gmail.com added the comment:
The pickle issue occurs in the numpy module, on windows
I'm still not clear what the issue is. Is there something wrong in the output
of the pickle example you show?
--
___
Python tracker
mattip matti.pi...@gmail.com added the comment:
The pickle output has the sign-bit set. Ignoring the sign-bit, it is unpickled
correctly. However math.copysign using this value will now return minus on
platforms where copysign(3., float('nan')) is known to work.
Perhaps the whole can of worms
, I don't see this as a bug: pickle is transferring the sign bit
correctly, so the only issue again is that float('nan') happens to produce a
nan whose sign bit is set (depending on platform, compiler options, etc.). I
don't see it as a problem that one can end up with some 'positive' nans
Mark Dickinson dicki...@gmail.com added the comment:
Thanks for the updated patch! (BTW, you can attach patches as files to the
issue rather than writing them inline.)
Yes, this patch is more along the lines that I was thinking of. There are some
issues, though: (1) we need to deal with
Mark Dickinson dicki...@gmail.com added the comment:
Here's an example based on the dtoa.c code. It only changes the return value
of float('nan'), and doesn't affect any other existing uses of the Py_NAN
macro. It needs tests.
--
keywords: +patch
Added file: http://bugs.python.org
Serhiy Storchaka storch...@gmail.com added the comment:
May be it would be more reasonable if math.copysign(1., float('nan')) return a
float('nan')?
--
nosy: +storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14521
Mark Dickinson dicki...@gmail.com added the comment:
May be it would be more reasonable if math.copysign(1., float('nan'))
return a float('nan')?
-1. That would go against all the existing standards.
--
___
Python tracker rep...@bugs.python.org
mattip matti.pi...@gmail.com added the comment:
Your patch is much more reasonable than mine.
Should I add a test that fails pre-patch and passes with the patch, or one that
is skipped pre-patch and passes post-patch? I'm not sure what is accepted in
the cpython development cycle
--
Martin v. Löwis mar...@v.loewis.de added the comment:
The test should fail pre-patch and pass post-patch. There will be no state in
the repository where the patch is present and fails, since it will be committed
along with the patch.
Skipping tests is only ok for tests that lack
Martin v. Löwis mar...@v.loewis.de added the comment:
Also, mattip: if you want to contribute some chunk of code (such as the test),
please submit a contributor form.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14521
mattip matti.pi...@gmail.com added the comment:
I added tests to the mark.dickinson patch, test.test_math passes.
--
Added file: http://bugs.python.org/file25165/math_patch2.txt
___
Python tracker rep...@bugs.python.org
mattip matti.pi...@gmail.com added the comment:
I also submitted a form. Sorry about the patch name, still learning.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14521
___
mattip matti.pi...@gmail.com added the comment:
The pickle issue occurs in the numpy module, on windows
cPickle.dumps(numpy.array(float('nan')))
yeilds
cnumpy.core.multiarray\n_reconstruct\np1\n(cnumpy\nndarray\np2\n(I0\ntS'b'\ntRp3\n(I1\n(tcnumpy\ndtype\np4\n(S'f8'\nI0\nI1\ntRp5\n(I3\nS
mattip matti.pi...@gmail.com added the comment:
I was going to add a test for this to Lib/test/test_math.py, but found this
comment:
# copysign(INF, NAN) may be INF or it may be NINF, since
# we don't know whether the sign bit of NAN is set on any
# given platform.
I
Changes by Antoine Pitrou pit...@free.fr:
--
components: +Interpreter Core -None
nosy: +mark.dickinson
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14521
___
Mark Dickinson dicki...@gmail.com added the comment:
Hmm. I don't see this as a bug: the sign of a nan isn't really all that
meaningful anyway, and this doesn't (AFAIK) contradict any documentation.
On the other hand, given that most other aspects of floating-point are now
reasonably
of Py_NAN to a unsigned char[].
It passes the tests in test.test_math and handles the copysign in a more
intuitive way
math.copysign(1., float('nan')) = 1. on win32, microsoft compiler
diff -r efeca6ff2751 Include/pymath.h
--- a/Include/pymath.h Thu Apr 05 22:51:00 2012 +0200
+++ b/Include
math.copysign(1., float('nan'))
-1.0
math.copysign(1., float('-nan'))
1.0
--
components: None
messages: 157746
nosy: mattip
priority: normal
severity: normal
status: open
title: math.copysign(1., float('nan')) returns -1.
type: behavior
versions: Python 2.7
Martin v. Löwis mar...@v.loewis.de added the comment:
This is a near duplicate of issue7281. Most likely, copysign is behaving
correctly, and it's already the float conversion that errs.
For struct.pack('d', float('nan')), I get '\x00\x00\x00\x00\x00\x00\xf8\xff';
for -nan, I get '\x00\x00
mattip matti.pi...@gmail.com added the comment:
It appears that microsoft decided NAN will be represented by
'\x00\x00\x00\x00\x00\x00\xf8\xff', which has the sign bit set.
Compiling this c code with visual 9.0 gives the correct answers for the first
value, and a mess for the second
mattip matti.pi...@gmail.com added the comment:
Sorry for the garbage c code, the comment however is correct: Py_NAN is created
with the sign bit set (on windows), and then _copysign on windows uses the sign
bit to determine the output, which results in the wrong answer.
--
Nir Soffer nir...@gmail.com added the comment:
As someone who has to develop on ARM OABI, I find this won't fix policy rather
frustrating.
If you happen to need this patch on 2.7, this is the same patch as
arm-float2.diff, which can be applied cleanly to release 2.7.2.
Changes from
Changes by Gregory P. Smith g...@krypto.org:
--
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14028
___
___
Python-bugs-list
Changes by Martin v. Löwis mar...@v.loewis.de:
--
versions: -Python 2.6, Python 3.1
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14028
___
___
Gregory P. Smith g...@krypto.org added the comment:
FYI - A similar NaN appearing in an unexpected place (the random module in
this case) bug that I just filed - http://bugs.python.org/issue14028.
I don't actually know if these will be related or not.
--
nosy: +gregory.p.smith
Changes by Mark Dickinson dicki...@gmail.com:
--
nosy: +mark.dickinson
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14028
___
___
Mark Dickinson dicki...@gmail.com added the comment:
My guess would be not related. My best guess for this issue is that it's
caused by some mismatch in the struct stat declarations / uses on MIPS / Linux.
A Google search for MIPS and stat suggests that there are problems in this
area.
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
assignee: - rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14028
___
___
that the error is really coming from the int() call in
the traceback. But now that implies that the random call is returning NaN,
which looks unpossible from the code (random_random in Modules/_randommodule.c).
static PyObject *
random_random(RandomObject *self)
{
unsigned long
Mark Dickinson dicki...@gmail.com added the comment:
The bugs.launchpad.net URL shows a call to 'entropy.choice'. Any idea what
'entropy' is? Could it be that they're using their own Random subclass, not
tied to the Python MT implementation?
--
Raymond Hettinger raymond.hettin...@gmail.com added the comment:
The hypothesis that time.time() is returning NaN doesn't match the provided
traceback. If time.time() had returned NaN, the exception would have happened
earlier, on line 113 in random.py: long(time.time() * 256)
I'm wondering
Mark Dickinson dicki...@gmail.com added the comment:
I'm wondering if the NaN arises in the C code for random():
I don't think that's possible. In the second line:
return PyFloat_FromDouble((a*67108864.0+b)*(1.0/9007199254740992.0));
a and b are already C unsigned longs, so no matter
Gregory P. Smith g...@krypto.org added the comment:
I think my claim the hardware appears healthy was premature. I misunderstood
our initial error report internally on where the code ran and was looking at
the wrong host. doh. my bad.
Several more of these have been found in the last week
601 - 700 of 1188 matches
Mail list logo