tartley / colorama

Simple cross-platform colored terminal text in Python
BSD 3-Clause "New" or "Revised" License
3.51k stars 249 forks source link

sys.stderr trunc traceback, colorama problem #367

Open zN3utr4l opened 1 year ago

zN3utr4l commented 1 year ago

I submitted an issue in this repository that use colorama as dependency: 'https://github.com/Delgan/loguru', this is the link of the issue https://github.com/Delgan/loguru/issues/754#issue-1468262003, i can confirm @Delgan is right (https://github.com/Delgan/loguru/issues/754#issuecomment-1331166181), with the latest version 0.4.6 the message in console is trunced, while with 0.4.5 version all works great

njsmith commented 1 year ago

I don't really understand what you're doing or what the problem is, but if your output is being truncated, maybe you need to flush the output stream? Or run with python -u.

On Tue, Nov 29, 2022, 23:44 zN3utr4l @.***> wrote:

I submitted an issue in this repository that use colorama as dependency: ' https://github.com/Delgan/loguru', this is the link of the issue Delgan/loguru#754 (comment) https://github.com/Delgan/loguru/issues/754#issue-1468262003, i can confirm @Delgan https://github.com/Delgan is right (Delgan/loguru#754 (comment) https://github.com/Delgan/loguru/issues/754#issuecomment-1331166181), with the latest version 0.4.6 the message in console is trunced, while with 0.4.5 version all works great

— Reply to this email directly, view it on GitHub https://github.com/tartley/colorama/issues/367, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEU42CSN5S64WYN57AZ7G3WK4AVTANCNFSM6AAAAAASPKGXYU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

zN3utr4l commented 1 year ago

this is the func, if i put self._stream.flush() at the beginnig all works, thanks

def write(self, message):
        self._stream.write(message)
        if self._flushable:
            self._stream.flush()
zN3utr4l commented 1 year ago

This only happens on Windows

@Delgan think this, https://github.com/Delgan/loguru/issues/754#issuecomment-1333455920
Could the problem be related to the new function just_fix_windows_console() ?