singleton.py misdesign #775
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hello
I just had a little overview to the project and found the file singleton.py with singleinstance class especially.
The design of this class is incorrect because of two things as below:
__del__
method will ever called. So it can easily lead to situation when lock file remains in system after app shutdown.try..except
block in__del__
method which would not work ever because, as stated in python doc, any exception that occurs while running__del__
method will be ignored and just printed a warning in stderr instead.Thus, I'd suggest to either make some other method like
release()
that should be called directly or redesign this class\idea.Thanks,
Constantine