-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
c1-quick 🕐Complexity lowComplexity lowp0-bug-critical ☢Exception rasingException rasingto-merge ↰ImminentImminent
Milestone
Description
When there is a tqdm std bar in existance and Python shuts down, it is possible to hit the following:
In it's __del__
method and in the call to format_dict
, you hit this line
Lines 275 to 280 in c1ec3b1
try: | |
from array import array | |
from fcntl import ioctl | |
from termios import TIOCGWINSZ | |
except ImportError: | |
return None |
because the shutdown causes the import to fail at some point and apparently del is later than that point.
But this returns only None, when it should return two elements, leading to an unable to unpack none exception.
I would suggest to return None, None
like in the error case a few lines down.
Lines 286 to 289 in c1ec3b1
try: | |
return [int(os.environ[i]) - 1 for i in ("COLUMNS", "LINES")] | |
except (KeyError, ValueError): | |
return None, None |
Of course, my favourite fix would be to not import stuff within a function, but hey, what do I know.
casperdcl
Metadata
Metadata
Assignees
Labels
c1-quick 🕐Complexity lowComplexity lowp0-bug-critical ☢Exception rasingException rasingto-merge ↰ImminentImminent