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: pickle_complex in copy_reg.py
Type: Stage:
Components: Library (Lib) Versions: Python 2.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: nnorwitz Nosy List: arigo, gvanrossum, loewis, nnorwitz
Priority: normal Keywords:

Created on 2002-08-16 03:28 by nnorwitz, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Messages (5)
msg12014 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2002-08-16 03:28
This code is in copy_reg.py from 1997:

def pickle_complex(c):
    return complex, (c.real, c.imag)

pickle(type(1j), pickle_complex, complex)

I'm not sure if the function pickle_complex() is
necessary, but it definitely seems that the line after
should be commented out or removed.  pickle_complex()
is not in the doc either.

(I was building WITHOUT_COMPLEX and found this problem.)
msg12015 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2002-08-16 03:49
Logged In: YES 
user_id=6380

Without that line you can't pickle complex numbers. Maybe it
should fail gracefully if complex doesn't exist. Feel free
to check in a fix for that.
msg12016 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2002-08-20 19:44
Logged In: YES 
user_id=6380

I'm rejecting this as invalid. Neal, if you disagree, just
reopen and assign to me.
msg12017 - (view) Author: Armin Rigo (arigo) * (Python committer) Date: 2003-06-07 16:21
Logged In: YES 
user_id=4771

proposed patch #750595.
msg12018 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2003-06-07 20:12
Logged In: YES 
user_id=21627

I have committed the patch for 2.2 and 2.3, fixing this bug.
History
Date User Action Args
2022-04-10 16:05:35adminsetgithub: 37044
2002-08-16 03:28:45nnorwitzcreate