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
I have viewed tqdm.write as a tqdm replacement for print that doesn't break progress bar flow, and print can handle printing non-string types. As hinted, the docs aren't extensive, and suggest that the behaviour should imitate print.
My immediate suggestion it wrap whatever argument is fed to tqdm.write in a str(), since tqdm.write(str(non_string_object)) works fine. Alternatively, one could try the decode in the error message, and if that fails use the string representation instead. I'm not familiar with how python 2.6+ would handle this, however, and I'd gladly take other suggestions.
The text was updated successfully, but these errors were encountered:
read the known issues
environment, where applicable:
I think the following behaviour can at least be solved by improving the
tqdm.write
docs:When
tqdm.write
gets non-unicode input (I've tested with writing a list as well, same error), it throws the following error:I have viewed
tqdm.write
as a tqdm replacement for print that doesn't break progress bar flow, and print can handle printing non-string types. As hinted, the docs aren't extensive, and suggest that the behaviour should imitateprint
.My immediate suggestion it wrap whatever argument is fed to
tqdm.write
in astr()
, sincetqdm.write(str(non_string_object))
works fine. Alternatively, one couldtry
thedecode
in the error message, and if that fails use the string representation instead. I'm not familiar with how python 2.6+ would handle this, however, and I'd gladly take other suggestions.The text was updated successfully, but these errors were encountered: