You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pip's current implementation of progress bar hides the cursor when it is progressing. There are two ways the cursor is toggled back:
At the end of the download
On interruption
Other exception, e.g. network timeout (which can be simulated by turning off the system's network in the middle of the download) would leave the terminal without a cursor. I'm not sure if this happens on all terminal emulator but it's the case for at least urxvt.
Posible fix
Making the progress bar a context manager which calls its .finish in __exit__ is likely to solve the issue.
How to Reproduce
Download something that is large enough for one to have the time to act, e.g. pip install tensorflow
Turn off the system's network
???
Profit
Alternatively one could apply the following patch to current master:
diff --git a/src/pip/_internal/network/download.py b/src/pip/_internal/network/download.py
index 56feaabac..8a16360c3 100644
--- a/src/pip/_internal/network/download.py+++ b/src/pip/_internal/network/download.py@@ -206,5 +206,6 @@ class BatchDownloader(object):
with open(filepath, 'wb') as content_file:
for chunk in chunks:
content_file.write(chunk)
+ raise RuntimeError
content_type = resp.headers.get('Content-Type', '')
yield link.url, (filepath, content_type)
I am quite familiar with this part of the codebase so I'll submit a patch soon.
The text was updated successfully, but these errors were encountered:
Environment
Description
pip's current implementation of progress bar hides the cursor when it is progressing. There are two ways the cursor is toggled back:
Other exception, e.g. network timeout (which can be simulated by turning off the system's network in the middle of the download) would leave the terminal without a cursor. I'm not sure if this happens on all terminal emulator but it's the case for at least urxvt.
Posible fix
Making the progress bar a context manager which calls its
.finish
in__exit__
is likely to solve the issue.How to Reproduce
pip install tensorflow
Alternatively one could apply the following patch to current master:
I am quite familiar with this part of the codebase so I'll submit a patch soon.
The text was updated successfully, but these errors were encountered: