This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Float infinity unpicklable with BINFLOAT-using protocols
Type: Stage:
Components: Library (Lib) Versions: Python 2.3
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: tim.peters Nosy List: exarkun, tim.peters
Priority: normal Keywords:

Created on 2004-01-21 00:20 by exarkun, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg19730 - (view) Author: Jean-Paul Calderone (exarkun) * (Python committer) Date: 2004-01-21 00:20
>>> import pickle
>>> pickle.dumps(1e100000, 2)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.3/pickle.py", line 1386, in dumps
    Pickler(file, protocol, bin).dump(obj)
  File "/usr/lib/python2.3/pickle.py", line 231, in dump
    self.save(obj)
  File "/usr/lib/python2.3/pickle.py", line 293, in save
    f(self, obj) # Call unbound method with explicit self
  File "/usr/lib/python2.3/pickle.py", line 489, in
save_float
    self.write(BINFLOAT + pack('>d', obj))
SystemError: frexp() result out of range


Prior to BINFLOAT, float infinity could successfully be
pickled.  The right thing to do here seems to be to
catch the exception and fall back to a FLOAT (string
representation) token.
msg19731 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2004-01-21 01:28
Logged In: YES 
user_id=31435

Closed as Duplicate.  See 
<http://www.python.org/sf/445484>.  The feature request is 
part of PEP 42.  Python currently has no support for infinities, 
NaNs, or signed zeroes in pickles; if you think you saw one of 
those work now, it's a platform accident (in particular, 
whether the string form of an infinity works depends entirely 
on your platform C library, and such pickles are not portable).
History
Date User Action Args
2022-04-11 14:56:02adminsetgithub: 39841
2004-01-21 00:20:07exarkuncreate