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

enable pickle entity #1111

Closed
wants to merge 2 commits into from
Closed

enable pickle entity #1111

wants to merge 2 commits into from

Conversation

GoatWang
Copy link

Enable pickling entity. Since the circular reference of entity.dxf and dxf._entity, causing the fail pickling. To address this, _entity attribute of entity.dxf will be removed before pickle.dump and will be rewired when pickle.load. Also, test function is added to valid the feature.

@mozman
Copy link
Owner

mozman commented Jun 20, 2024

I don't see any need to support the pickle protocol, and I'm not sure if this won't create more problems than it solves.

The DXF structures have many and often deep linkage, just testing with DXFEntity is not sufficient. Test your code with HATCH or MLEADER entities.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify my problem with this change:

When you pickle an entity from a loaded DXF file, the entity contains a reference to this document and the whole DXF document will be included in the data dump.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification, I will continue to learn this issue, try to verify it and keep the changes on my fork for now.

@mozman mozman closed this Jun 26, 2024
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 this pull request may close these issues.

2 participants