singleton.py misdesign #775
Labels
No Label
bug
build
dependencies
developers
documentation
duplicate
enhancement
formatting
invalid
legal
mobile
obsolete
packaging
performance
protocol
question
refactoring
regression
security
test
translation
usability
wontfix
No Milestone
No project
No Assignees
1 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Bitmessage/PyBitmessage-2024-12-11#775
Loading…
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