Can't pickle overpy.Result
See original GitHub issueIssue type
- Bug Report
OverPy version
0.4
OS
- Windows 7 x64 HP
Python version
- Python 3.5 x64
Summary
Neither pickle nor _pickle Python modules can’t dump query result.
Steps to reproduce
import overpy
import pickle
op = overpy.Overpass()
sample = op.query("""
way(50.746,7.154,50.748,7.157) ["highway"];
(._;>;);
out body;
""")
with open('sample.pcl', 'wb') as pcl:
pickle.dump(sample, pcl)
Expected results
pcl-file full of usefull data =)
Actual results
Empty plc-file and exception:
11 with open('sample.pcl', 'wb') as pcl:
---> 12 pickle.dump(sample, pcl)
AttributeError: Can't pickle local object 'Element.__init__.<locals>.<lambda>'
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Python multiprocessing PicklingError: Can't pickle <type ...
It appears that the result of applying functool.partial to a top-level function is also pickle-able, even if it's defined inside another function. –...
Read more >API Reference — Python Overpass API 0.6 documentation
DataIncomplete – The requested way is not available in the result cache. overpy.exception.DataIncomplete – If resolve_missing is True and the area can't be ......
Read more >How to Make Pickles–3 Rules You Can't Break
Making homemade pickles couldn't be easier. A little prep work with pretty basic ingredients can yield very tasty results.
Read more >cannot pickle '_thread.lock' object when trying to start process ...
The problem here is that self in function run_parallel() can't be pickled as it ... Queue instance to this function is for results,...
Read more >Pickle Science: How to Master the Preserving Power of Acids
Just like lacto-fermented pickles in the crock, these cucumbers need to stay submerged in the pickling solution. A loose pack results in the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for reporting the issue.
I have merged a fix into the master branch and it will be in the next release.
Here’s our workaround for Python 2.7:
Deleting the dictionary is not a problem as it is only needed in the constructor.