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

Strange cleanup failures (during atexit) #248

Closed
cipriancraciun opened this issue Jul 6, 2015 · 3 comments · Fixed by #459
Closed

Strange cleanup failures (during atexit) #248

cipriancraciun opened this issue Jul 6, 2015 · 3 comments · Fixed by #459
Milestone

Comments

@cipriancraciun
Copy link

@cipriancraciun cipriancraciun commented Jul 6, 2015

I am using Wand to compose some images in a CLI tool. However after the tool exists (i.e. during the Python atexit callbacks), I get some errors like bellow:

Exception TypeError: TypeError("'NoneType' object is not callable",) in  ignored
Exception AttributeError: AttributeError("'NoneType' object has no attribute 'NewPixelWand'",) in  ignored

I've tried debugging the code (both mine and Wand's), and from what I gather, that exception is thrown for Color objects during the __del__ method (inherited from Resource). (See the empty space between in and ignored which if I replace __repr__ for Color yields the culprit method.)

The actual error I guess is generated either because some objects that get called do not exist anymore (maybe Python replaces them with None?) during atexit callbacks.

@emcconville
Copy link
Owner

@emcconville emcconville commented Jul 6, 2015

Please provide a unit-test that is failing. Both TypeError and AttributeError exceptions are expected when attempting to work with None, or NULL pointer, variables.

@cipriancraciun
Copy link
Author

@cipriancraciun cipriancraciun commented Jul 6, 2015

The issue is that I can't reproduce this issue with minimum code... I've tried finding a minimum set of code that uses wand and fails as above but my guess is that it manifests only when the Color instances get reused, thus their references go above 1.

Just to be clear, the errors above are not encountered while wand is called by my code, but after my code exits and Python atexit callbacks are called.

@sdawodu
Copy link

@sdawodu sdawodu commented Oct 6, 2016

Same behaviour observed

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