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.

Author mesheb82
Recipients mesheb82, paul.moore, steve.dower, tim.golden, zach.ware
Date 2017-02-23.03:55:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1487822146.07.0.247102500299.issue29628@psf.upfronthosting.co.za>
In-reply-to
Content
When I run the following code on Windows/Linux for < Python 3.6, I have no problems.  When I run in Python 3.6.0, I get the subsequent traceback.

I checked the release notes and only saw the following struct module note related to half-floats: Issue #11734

from struct import Struct
import copy
this_fails = Struct('<i')
copy.deepcopy(this_fails)


Traceback (most recent call last):
  File "test_script.py", line 12, in <module>
    copy.deepcopy(this_fails)
  File "F:\Anaconda\envs\py36\lib\copy.py", line 169, in deepcopy
    rv = reductor(4)
TypeError: can't pickle Struct objects


To be clear, I'm copying struct objects as part of a larger class.  As I'm running many function calls where I create the same struct objects, saving the common struct objects allows me to get a factor of 2x speedup on my code.  Deleting the saved struct objects at the end of file reading (and before the deepcopy takes place) fixes the problem.
History
Date User Action Args
2017-02-23 03:55:46mesheb82setrecipients: + mesheb82, paul.moore, tim.golden, zach.ware, steve.dower
2017-02-23 03:55:46mesheb82setmessageid: <1487822146.07.0.247102500299.issue29628@psf.upfronthosting.co.za>
2017-02-23 03:55:45mesheb82linkissue29628 messages
2017-02-23 03:55:44mesheb82create