tqdm / tqdm

:zap: A Fast, Extensible Progress Bar for Python and CLI

Home Page:https://tqdm.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AttributeError: 'tqdm' object has no attribute 'last_print_t' on Python 3.12

mweinelt opened this issue · comments

  • 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)

Environment

x86_64-linux
Python 3.12.1
pytest 7.4.3
pytest-asyncio 0.23.2
pluggy 1.3.0
tqdm 4.66.1

Description

I'm aware Python 3.12 is not supported according to the trove classifiers, but I hope it will be soon. We're seeing the following exception many times during testing on Python 3.12.1, the tests run fine on 3.11.7.

Exception ignored in: <function tqdm.__del__ at 0x7ffff64a2c00>
Traceback (most recent call last):
  File "/build/tqdm-4.66.1/tqdm/std.py", line 1149, in __del__
    self.close()
  File "/build/tqdm-4.66.1/tqdm/std.py", line 1278, in close
    if self.last_print_t < self.start_t + self.delay:
       ^^^^^^^^^^^^^^^^^
AttributeError: 'tqdm' object has no attribute 'last_print_t'