Skip to content

tqdm.reset() crashes when disable=True #1125

@michael-koeller

Description

@michael-koeller
  • I have marked all applicable categories:
    • exception-raising bug
    • visual output bug
    • documentation request (i.e. "X is missing from the documentation." If instead I want to ask "how to use X?" I understand StackOverflow#tqdm is more appropriate)
    • new feature request
  • 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:
haendel:~/projects/telekom/trunk/sandbox/tqdm> python3
Python 3.9.1 (default, Jan  8 2021, 17:17:43) 
[Clang 12.0.0 (clang-1200.0.32.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tqdm, sys
>>> print(tqdm.__version__, sys.version, sys.platform)
4.56.0 3.9.1 (default, Jan  8 2021, 17:17:43) 
[Clang 12.0.0 (clang-1200.0.32.28)] darwin
>>> t = tqdm.tqdm(total=10, disable=True)
>>> t.reset()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Volumes/projects/telekom/trunk/sandbox/tqdm/tqdm/std.py", line 1348, in reset
    self.last_print_t = self.start_t = self._time()
AttributeError: 'tqdm' object has no attribute '_time'

This issue is similar/related to Issue 624.
My test above actually uses current master source:

Branch: master
Commit: 94842e1
Date: 2021-02-09

~/projects/sandbox/tqdm> pip3 list
Package        Version
-------------- -------
libxml2-python 2.9.10
pip            21.0.1
~/projects/sandbox/tqdm> pip3 install -e git://github.com/tqdm/tqdm.git@master#egg=tqdm
Obtaining tqdm from git+git://github.com/tqdm/tqdm.git@master#egg=tqdm
  Updating ./src/tqdm clone (to revision master)
  Running command git fetch -q --tags
  Running command git reset --hard -q 94842e1027570867885788dc9d7fe038484f085b
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Installing collected packages: tqdm
  Running setup.py develop for tqdm
Successfully installed tqdm
haendel:~/projects/telekom/trunk/sandbox/tqdm>pip3 list
Package        Version Location
-------------- ------- -----------------------------------------------------
libxml2-python 2.9.10
pip            21.0.1
tqdm           4.56.1  /Volumes/projects/telekom/trunk/sandbox/tqdm/src/tqdm
~/projects/sandbox/tqdm> python3 -c "import tqdm; print(tqdm.__version__)"
4.56.0

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions