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

silx.io.specfile: Fixed SpecFile deallocation issue #4129

Merged
merged 1 commit into from
Jun 13, 2024
Merged

Conversation

t20100
Copy link
Member

@t20100 t20100 commented May 31, 2024

Checklist:


Replaces the use of __dealloc__ in SpecFile with __del__ since the former should not call methods and the later is now supported (it was not with Python 2):

https://cython.readthedocs.io/en/latest/src/userguide/special_methods.html#finalization-methods-dealloc-and-del

You need to be careful what you do in a __dealloc__() method. By the time your __dealloc__() method is called, the object may already have been partially destroyed and may not be in a valid state as far as Python is concerned, so you should avoid invoking any Python operations which might touch the object. In particular, don’t call any other methods of the object or do anything which might cause the object to be resurrected. It’s best if you stick to just deallocating C data.

closes #4128

@t20100 t20100 added this to the Next release milestone May 31, 2024
@stanislavlevin
Copy link

I confirm that I can't see the reported problem with this fix.
Thank you!

@t20100
Copy link
Member Author

t20100 commented May 31, 2024

Thanks for testing!

@payno payno merged commit dfe28be into main Jun 13, 2024
7 of 8 checks passed
@t20100 t20100 deleted the t20100-patch-1 branch June 13, 2024 13:55
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.

tests failures against Pytest 8.2.0
3 participants