Skip to content

Tqdm's write() not working in multi-threaded process  #936

@melvin9595

Description

@melvin9595

Hello,

This is an issue related to the new release of Tqdm version 4.45.0. I overwrote loggers print function to use tqdm's write method() using the code below for a multithreaded process im working on and while it works on version 4.41.0 just fine, it seems to not be working anymore on 4.45.0 as the prints are being outputted next to the bars instead above them, anyone experiencing similar issues?


class TqdmLoggingHandler(logging.Handler):
    def __init__(self, level=logging.NOTSET):
        super().__init__(level)
    def emit(self, record):
        try:
            msg = self.format(record)
            tqdm.tqdm.write(msg)
            self.flush()
        except (KeyboardInterrupt, SystemExit):
            raise
        except:
            self.handleError(record)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions