-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong output in Windows console #454
Comments
which version of |
tqdm==4.18.0 Edit: I use a high dpi display with 150% scaling, if that matters. Edit 2: when I set the font size to 14, it works correctly. But I need to set the font size to 16 (because of the high dpi), and with this font, the effect is as I shown above. |
interesting. so windows is incorrectly reporting the terminal width when you mess with fonts and scaling. you could always use |
yes looks like it. I just tried win10 + py27, and couldn't get unicode working at all. it could be that windows thinks the unicode characters are "widechars" |
Unicode support for Windows console was added in python 3.6. So it should work for me. Maybe the number of characters going backwards when updating the bar is calculated incorrectly? It's strange that the result depends on the font size. BTW, I believe that Unicode characters are widechars. |
well, the true widths of many unicode chars are not wide, which some environments don't seem to understand |
I cant confirm the experience above inside the windows comand line. But i have this problems when i use the PyCharm console. With mutlithreading support, like i already mentioned in #329. I get this output with unicode:
and this with
|
Hey guys, thanks for your answers. |
That's partial unicode support. You can probably fix it with |
@IceflowRE your PyCharm issue is mentioned in https://github.com/tqdm/tqdm#faq-and-known-issues |
Might add to the FAQs that environments which lie about unicode support will also have problems without |
ta, yup, tried ascii=True after following an earlier comment thread and it did the trick. |
- closes #454 - TODO: might want to autodetect semi-unicode support and fallback to ascii?
I added Environment:Using git-bash on Windows 10 to connect to an Ubuntu server. Code is run on the Ubuntu server, and the output is viewed from the git-bash console on Windows 10. |
I can confirm this issue occurs on a Raspberry Pi when using the defaults. Usually the bar flows as normal, but occasionally on both Windows (terminal emulator for zsh/ubuntu image) and Raspbian Buster it will show a standard replacement character (�) and skip a line. The character may show up in a random location along the progress bar, not at the end. ascii=True resolves the issue, but I kind of dig the smooth bar when it works. Oddly it works most of the time, it's only once in a while that it happens. Particularly for tracking the download of a larger file. Terminal font shows as Monospace Regular according to LXTerminal in Raspbian Buster, and DejaVu Sans Mono for Powerline in mintty 3.0.0 running terminal emulation for WSL on Win10. |
Still persists on Windows 10 terminal for me, also with ascii=True. Python 3.8.0, tqdm version 4.39.0. |
'ascii=True' still not work for me. But though the code below, the symptoms can be relieved a little. import time
from tqdm import tqdm
with tqdm(total=3, desc='level_1', position=0, leave=False) as pbar:
for i in tqdm(range(3)):
for j in tqdm(range(5), desc='level_2', position=0, leave=True):
time.sleep(0.1)
pbar.update() |
@MacwinWin sounds like you're missing |
@casperdcl Thanks a lot. |
# this is my tqdm function
for row in tqdm(file, total=file_line_count(file_path)): There is still a small question mark/empty rectangle symbol appearing for me in the Windows Command Prompt and Windows Powershell. This is running on Windows Server 2022 Datacenter 21H2 using Python 3.10.2 and tqdm-4.62.3. |
Standard Windows 10 console (cmd.exe). Python 3.6.2. Test code:
Output:
Is this expected? I'm sure it worked correctly in some older version.
The text was updated successfully, but these errors were encountered: