Comments (5)
Hi, I couldn't replicate your use case. Can you help me with some more information? The code, perhaps?
from tendo.
Hi, in order to understand this issue I'd be happy to receive a code example which fails - I tried running yours but it ran successfully.
Therefore, I suspect it has something to do with your dependencies.
from tendo.
Hi, It seems like this only happens with a library I was using which was qasync, it's a PyQt async wrapper.
import sys
import qasync
import tendo
from tendo import singleton
try:
me = singleton.SingleInstance()
except tendo.singleton.SingleInstanceException:
sys.exit(0)
def cleanup():
...
sys.exit(0)
async def window():
cleanup()
qasync.run(window())
Which produces
Exception ignored in: <function SingleInstance.__del__ at 0x0000023F40D696C0>
Traceback (most recent call last):
File "C:\Users\sarah\PycharmProjects\stella_manager_gui\venv\lib\site-packages\tendo\singleton.py", line 91, in __del__
AttributeError: 'NoneType' object has no attribute 'exit'
Unloggable error: 'NoneType' object has no attribute 'platform'
So technically it's a dependency issue.
from tendo.
This occurs because of the way singleton is cleared using del. We should implement something such as context manager with enter and exit, since using del exposes us to bugs like this.
from tendo.
Using context manager seems solid, better code flow for edge cases like this.
from tendo.
Related Issues (20)
- Python 3.6.6, ModuleNotFoundError: import of os halted; None in sys.modules HOT 3
- logger.error vs logger.warning HOT 2
- Is necessary to include 'quitting' in log message? HOT 3
- Window flashing when packaged with PyInstaller. HOT 1
- SingleInstance prints log messages twice HOT 3
- Adding non blocking behavior in locking mechanism HOT 1
- BlockingIOError: [Errno 35] Resource temporarily unavailable HOT 1
- Compatibility with Python 3.7? HOT 1
- Opening in U mode has been deprecated and will be removed in Python 3.10 HOT 1
- 💖 looking for maintainers (cores) HOT 4
- Is singleton multi-threading safe? HOT 1
- NameError: name 'SingleInstance' is not defined HOT 1
- run process in popen and send kill will not remove the lock file HOT 3
- v0.3 checklist
- New version on pypi? HOT 1
- BlockingIOError when running on Python 3.6 HOT 1
- Documentation link is broken (404)
- singleton.SingleInstance not releasing on program end
- Latest version on PyPi is 0.3.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tendo.