Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RecursionError when pickle dump/loading dxf file #1231

Closed
zassoulin opened this issue Jan 22, 2025 · 4 comments · Fixed by #1232
Closed

RecursionError when pickle dump/loading dxf file #1231

zassoulin opened this issue Jan 22, 2025 · 4 comments · Fixed by #1232

Comments

@zassoulin
Copy link

Describe the bug
when running pickle load/dump on a dxf object (ezdxf.document.Drawing) an RecursionError: maximum recursion depth exceeded is recived.

To Reproduce
Information and data needed to reproduce the error:
read a dxf file and try to dump it into a file using pickle, i saved the file and read it as gzip.
when trying to load the saved file a RecursionError occures.

Expected behavior
the dxf object should be loaded correctly.
Screenshots
inorder to replecate the problem i have created a small notebook for it with a random dxf i found online.

EzdxfRecursionErrorNotebook.zip

@mozman
Copy link
Owner

mozman commented Jan 22, 2025

Pickle protocol is not supported!

@mbway
Copy link
Contributor

mbway commented Jan 22, 2025

ezdxf.document.Drawing is an in-memory representation of a DXF file, so dxf seems like it would be an appropriate storage format rather than a pickled ezdxf object.

If pickle as a format is a hard requirement you can pickle a string containing the contents of a DXF file?

@zassoulin
Copy link
Author

zassoulin commented Jan 22, 2025

pickle is not a hard requirement but i need to read alot of dxf files in a short amount of time and reading&parsing a dxf file takes significantly longer than using pickle(the same dxf file will be read multiple times), thus the whole idea of using pickle came to be.
thanks alot for the response and if you have any idea/suggestion about how might i tackle the issue i would love to hear it

@mbway
Copy link
Contributor

mbway commented Jan 22, 2025

fair enough. I opened a PR that hopefully works for you #1232

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants