New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pickle lacks float('inf') #34850
Comments
Support for float('inf') still appears to be missing in Python 2.1.1 (#1, Jul 28 2001, 14:15:01) >>> cPickle.dumps(float('inf'), 1)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
SystemError: frexp() result out of range
>>> pickle.dumps(float('inf'), 1)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/var/ajd111/python/lib/python2.1/pickle.py",
line 943, in dumps
Pickler(file, bin).dump(object)
File "/var/ajd111/python/lib/python2.1/pickle.py",
line 109, in dump
self.save(object)
File "/var/ajd111/python/lib/python2.1/pickle.py",
line 211, in save
f(self, object)
File "/var/ajd111/python/lib/python2.1/pickle.py",
line 273, in save_float
self.write(BINFLOAT + pack('>d', object))
SystemError: frexp() result out of range Both structmodule.c and cPickle.c require changes. if (x == HUGE_VAL) { /* Inf */
e = 1024;
f = 0.0;
}
else {
f = frexp(x, &e);
... and if (e == 1024)
x = HUGE_VAL; /* Inf */
else { is all that is required for all IEEE754 machines? (structmodule.c requires similar changes for Float |
Logged In: YES Note that Python has no intentional support for Infs and Given that, in the absence of a comprehensive plan for |
Logged In: YES Is there a point in keeping this bug report open |
Logged In: YES Changed to Feature Request, and added to new "Non- |
Logged In: YES PEP-754 should make sure to deal with this. |
Logged In: YES This appears to be outside the scope of PEP-754 (as |
Logged In: YES This is in CVS for 2.5. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: