Skip to content
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

tqdm fail on system with comma decimal seperator, on one of examples #1621

Open
5 of 6 tasks
Tokariew opened this issue Oct 7, 2024 · 1 comment
Open
5 of 6 tasks
Assignees
Labels
question/docs ‽ Documentation clarification candidate

Comments

@Tokariew
Copy link

Tokariew commented Oct 7, 2024

  • I have marked all applicable categories:
    • exception-raising bug
    • visual output bug
  • I have visited the source website, and in particular
    read the known issues
  • I have searched through the issue tracker for duplicates
  • I have mentioned version numbers, operating system and
    environment, where applicable:
    import tqdm, sys
    print(tqdm.__version__, sys.version, sys.platform)
4.66.5 3.12.6 (main, Sep  9 2024, 00:00:00) [GCC 14.2.1 20240801 (Red Hat 14.2.1-1)] linux
➜ LC_NUMERIC=pl_PL.UTF-8 seq 3 .1 5 | tqdm --total 5 --update-to
  0%|                                                                                                                                                                    | 0/5 [00:00<?, ?it/s]
3,0
Traceback (most recent call last):
  File "/usr/bin/tqdm", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.12/site-packages/tqdm/cli.py", line 308, in main
    callback(i)
  File "/usr/lib/python3.12/site-packages/tqdm/cli.py", line 305, in callback
    t.update(numeric(i.decode()) - t.n)
             ~~~~~~~~~~~~~~~~~~~~^~~~~
TypeError: unsupported operand type(s) for -: 'tuple' and 'int'

tokariew in ~/NFS/Media/podcast4  v3.12.6
✗  tqdm --version
4.66.5
@casperdcl
Copy link
Member

Rather than some hack (SO#7106417), maybe just use tr , .?

LC_NUMERIC=pl_PL.UTF-8 seq 3 .1 5 | tr , . | tqdm --total 5 --update-to

@casperdcl casperdcl added this to Casper Oct 7, 2024
@casperdcl casperdcl moved this to In Progress in Casper Oct 7, 2024
@casperdcl casperdcl added the question/docs ‽ Documentation clarification candidate label Oct 7, 2024
@casperdcl casperdcl self-assigned this Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question/docs ‽ Documentation clarification candidate
Projects
Status: In Progress
Development

No branches or pull requests

2 participants