piskvorky / sqlitedict

Persistent dict, backed by sqlite3 and pickle, multithread-safe.
Apache License 2.0
1.17k stars 131 forks source link

Join thread after close() #9

Closed avian2 closed 10 years ago

avian2 commented 10 years ago

This prevents occasional errors on Python 2.7 when exiting the program:

Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
    File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
    File "/usr/local/lib/python2.7/dist-packages/sqlitedict.py", line 255, in run
    File "/usr/lib/python2.7/Queue.py", line 179, in get
    File "/usr/lib/python2.7/threading.py", line 279, in notify
    <type 'exceptions.TypeError'>: 'NoneType' object is not callable

As far as I know, these errors are benign, but it is good practice to always join your threads.

piskvorky commented 10 years ago

Thanks @avian2 .

This seems to be fully subsumed by @ownport's PR #8 , so closing this PR. Feel free to reopen if I missed something.