Skip to content

singleton.py misdesign #775

@Ignalion

Description

@Ignalion

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:

  1. This class has to ensure that lock file is being deleted when app is closed (as far as I understand it). But it won't work. Well, it would, probably, but as it's stated in python doc, it's not guaranteed that __del__ method will ever called. So it can easily lead to situation when lock file remains in system after app shutdown.
  2. There is 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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working as it's supposed to

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions