Message288401
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. |
|
Date |
User |
Action |
Args |
2017-02-23 03:55:46 | mesheb82 | set | recipients:
+ mesheb82, paul.moore, tim.golden, zach.ware, steve.dower |
2017-02-23 03:55:46 | mesheb82 | set | messageid: <1487822146.07.0.247102500299.issue29628@psf.upfronthosting.co.za> |
2017-02-23 03:55:45 | mesheb82 | link | issue29628 messages |
2017-02-23 03:55:44 | mesheb82 | create | |
|