Closed mirukana closed 6 years ago
Hi @ccc032, thanks for reporting this. I believe this happens because of the dependency cursor being used where on line 37, it outputs escape sequences. One way of fixing this would be to remove dependency and move the code to this library and allow streams to be passed. Another way would be to send a PR and wait for the project owner to accept and publish the changes on pip. I would love to keep this code in a separate repository of it's own as it could benefit others in their projects.
Updating things here, I've created an issue for this https://github.com/GijsTimmers/cursor/issues/2
@ccc032 This should be fixed now. Could you please try HEAD and check whether you are still facing this issue or not? I'll make a release for this soon.
@ManrajGrover Everything works fine now, thanks.
Description
When using a spinner with
stream=sys.stderr
, the escape sequences to hide/show the terminal's cursor will still be outputed to stdout. They are visible if stdout is redirected to a file and opened in a text editor/cat -v
, or directly piped tocat -v
. This messes with the program's normal output in any case.System settings
pip freeze
output:Steps to recreate
Run this script, piping its output to
cat -v
(e.g.python3 script | cat -v
):People to notify
@ManrajGrover