spyder-ide / spyder

Official repository for Spyder - The Scientific Python Development Environment
https://www.spyder-ide.org
MIT License
8.33k stars 1.61k forks source link

Spyder IPython console issue with tqdm progress bars when leave=False #16211

Open ma-sadeghi opened 3 years ago

ma-sadeghi commented 3 years ago

Here's the snippet that reproduces the bug:

from tqdm import tqdm
from time import sleep

for i in tqdm(range(5), leave=False):
    sleep(0.1)

print("Hello world!")

When using leave=False (which instructs the progress bar to disappear when finished), Spyder IPython console seems to not quite work as expected. Below is what I got from Spyder overlaid (top right) with what I got from a standalone IPython console from the terminal:

image

Note: the screenshot from standalone IPython console is the expected output.


# Mandatory:
atomicwrites >=1.2.0          :  1.4.0 (OK)
chardet >=2.0.0               :  4.0.0 (OK)
cloudpickle >=0.5.0           :  1.6.0 (OK)
cookiecutter >=1.6.0          :  1.7.0 (OK)
diff_match_patch >=20181111   :  20200713 (OK)
intervaltree >=3.0.2          :  3.0.2 (OK)
IPython >=7.6.0               :  7.25.0 (OK)
jedi >=0.17.2;<0.19.0         :  0.18.0 (OK)
jsonschema >=3.2.0            :  3.2.0 (OK)
keyring >=17.0.0              :  23.0.1 (OK)
nbconvert >=4.0               :  6.1.0 (OK)
numpydoc >=0.6.0              :  1.1.0 (OK)
parso >=0.7.0;<0.9.0          :  0.8.2 (OK)
pexpect >=4.4.0               :  4.8.0 (OK)
pickleshare >=0.4             :  0.7.5 (OK)
psutil >=5.3                  :  5.8.0 (OK)
pygments >=2.0                :  2.9.0 (OK)
pylint >=2.5.0                :  2.9.6 (OK)
pyls_spyder >=0.4.0           :  0.4.0 (OK)
pylsp >=1.2.1;<1.3.0          :  1.2.1 (OK)
pylsp_black >=1.0.0           :  None (OK)
qdarkstyle =3.0.2             :  3.0.2 (OK)
qstylizer >=0.1.10            :  0.2.1 (OK)
qtawesome >=1.0.2             :  1.0.3 (OK)
qtconsole >=5.1.0             :  5.1.1 (OK)
qtpy >=1.5.0                  :  1.9.0 (OK)
rtree >=0.9.7                 :  0.9.7 (OK)
setuptools >=49.6.0           :  49.6.0.post20210108 (OK)
sphinx >=0.6.6                :  4.1.2 (OK)
spyder_kernels >=2.1.0;<2.2.0 :  2.1.0 (OK)
textdistance >=4.2.0          :  4.2.1 (OK)
three_merge >=0.1.1           :  0.1.1 (OK)
watchdog >=0.10.3             :  2.1.3 (OK)
xdg >=0.26                    :  0.27 (OK)
zmq >=17                      :  22.1.0 (OK)

# Optional:
cython >=0.21                 :  0.29.24 (OK)
matplotlib >=2.0.0            :  3.4.2 (OK)
numpy >=1.7                   :  1.21.0 (OK)
pandas >=1.1.1                :  1.3.0 (OK)
scipy >=0.17.0                :  1.7.0 (OK)
sympy >=0.7.3                 :  1.8 (OK)
steff456 commented 3 years ago

Hi @ma-sadeghi,

Thanks for opening this issue, I can reproduce it on my end. We will see what we can do to fix this issue for one of our next releases.