unbound icon indicating copy to clipboard operation
unbound copied to clipboard

Garbage in logs when using python module

Open socketpair opened this issue 1 year ago • 0 comments

Sources:

$ fgrep 'deinit called' -iR . -B2
./testdata/pymod_thread.tdir/pymod_thread.py-
./testdata/pymod_thread.tdir/pymod_thread.py-def deinit(id):
./testdata/pymod_thread.tdir/pymod_thread.py:    log_info("pythonmod: deinit called, module id is %d" % id)
--
./testdata/pymod.tdir/pymod.py-
./testdata/pymod.tdir/pymod.py-def deinit(id):
./testdata/pymod.tdir/pymod.py:    log_info("pythonmod: deinit called, module id is %d" % id)
--
./pythonmod/examples/log.py-
./pythonmod/examples/log.py-def deinit(id):
./pythonmod/examples/log.py:   log_info("pythonmod: deinit called, module id is %d" % id)
--
./pythonmod/doc/examples/example0.rst-
./pythonmod/doc/examples/example0.rst-   def deinit(id):
./pythonmod/doc/examples/example0.rst:      log_info("pythonmod: deinit called, module id is %d" % id)
--
./pythonmod/doc/examples/example0-1.py-
./pythonmod/doc/examples/example0-1.py-def deinit(id):
./pythonmod/doc/examples/example0-1.py:   log_info("pythonmod: deinit called, module id is %d" % id)
--
./pythonmod/ubmodule-msg.py-
./pythonmod/ubmodule-msg.py-def deinit(id):
./pythonmod/ubmodule-msg.py:    log_info("pythonmod: deinit called, module id is %d" % id)
--
./pythonmod/ubmodule-tst.py-
./pythonmod/ubmodule-tst.py-def deinit(id):
./pythonmod/ubmodule-tst.py:    log_info("pythonmod: deinit called, module id is %d" % id)

So, you can see, this log message is an recommended case. What happens in real:

image

Seems, logging system is uninitialized at this point. And this is not checked! Indeed, it's the bug.

socketpair avatar Feb 28 '23 13:02 socketpair