You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that in python 3.13 (in linux), messages that were previously logged nicely to the console are now behaving as if the lines end like a windows line feed character without carriage return -- the cursor moves down a row, but not back to the beginning of the line. The example I chose below looks tame, but it makes most real logging output very difficult to read.
This only seems to happen for lines printed from background threads:
importthreading, timedefmsg():
print('this is line 1')
print('this is line 2')
time.sleep(0.1) # first few lines work as expected, but after a brief time, the problem beginsprint('this is line 3')
print('this is line 4')
thread=threading.Thread(target=msg)
thread.start()
Running this code in python 3.13.1, interactive mode looks like:
$ python -i print_test.py
this is line 1
this is line 2
>>> this is line 3
this is line 4
>>>
Non-interactive looks fine:
$ python print_test.py
this is line 1
this is line 2
this is line 3
this is line 4
And interactive in 3.12.8 looks fine:
$ python -i print_test.py
this is line 1
this is line 2
>>> this is line 3
this is line 4
CPython versions tested on:
3.13
Operating systems tested on:
Linux
The text was updated successfully, but these errors were encountered:
This is most likely because the new REPL modifies the terminal settings, assuming it's the only thing printing there.
As a workaround you can run PYTHON_BASIC_REPL=1 python to use the old REPL.
Bug report
Bug description:
I noticed that in python 3.13 (in linux), messages that were previously logged nicely to the console are now behaving as if the lines end like a windows line feed character without carriage return -- the cursor moves down a row, but not back to the beginning of the line. The example I chose below looks tame, but it makes most real logging output very difficult to read.
This only seems to happen for lines printed from background threads:
Running this code in python 3.13.1, interactive mode looks like:
Non-interactive looks fine:
And interactive in 3.12.8 looks fine:
CPython versions tested on:
3.13
Operating systems tested on:
Linux
The text was updated successfully, but these errors were encountered: