alive-progress: Crash when reusing logging Handlers with unhashable type: 'types.SimpleNamespace'
Hello, First of all thank you for all the effort you’ve put in to this project so far.
I am running into an issue I can’t seem to resolve and would love it if you could give your opinion.
I am trying to use both alive-progress and sshtunnel together. All I’ve done is create the sshtunnel definition before the alive example code as below, and I am getting the error from the headline :\
from alive_progress import alive_bar
import time
from sshtunnel import SSHTunnelForwarder
ssh_tun = SSHTunnelForwarder(
"0.0.0.0",
ssh_username="mooo",
remote_bind_address=('127.0.0.1', 8080)
)
for x in 1000, 1500, 700, 0:
with alive_bar(x) as bar:
for i in range(1000):
time.sleep(.005)
bar()
Thoughts? Thank you in advance for any reply.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 15 (9 by maintainers)
Commits related to this issue
- support for reusing logging handlers fix #155, fix #104 — committed to rsalmei/alive-progress by rsalmei 2 years ago
Hey, this is fixed!! Should be available in the next release! 👍
Hi folks!
I’d just like to let you know I’m committing it at this exact moment! Should be released soon!! 👍
Thanks, @Crinibus, you have a great week!! 👋
Thanks for the example @emanuelen5, I’ll use it to fix this!
Same with me. Conflict with
loggingwhen I set individual loggers.unhashable type: 'types.SimpleNamespaceHello @aviadfiant, thank you, man!
Well, it does seem similar to that one @TheTechRobo has reminded us of, but it is different. This SSHTunnelForwarder uses
logginginternally, but in a kinda unusual way: it reuses handlers…Note the highlighted ids, they are the addresses of some object, all pointing to the same Handler
107c648c8. So, whenalive-progressprocesses them, it tries to instrument again an already ready handler, and thus it breaks like in a nested use case…I’ll support this case in a new version 👍