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
Reported by [email protected], Feb 10 (5 days ago)
Somewhat related to Issue 41, but if you have replaced sys.stdout with something else (like StringIO in order to capture output for unit testing purposes), then the wrapping that colorama does exposes an interface that differs from that of the object you set sys.stdout to. Namely in the case of StringIO, it has a getvalue() method to get what was written to it.
After calling colorama.init, the object set to sys.stdout no longer has this method.
What steps will reproduce the problem?
set sys.stdio=StringIO
call colorama.init(strip=True,convert=False)
try to call sys.stdio.getvalue()
What is the expected output?
An empty string on the console.
What do you see instead?
An error message about sys.stdio not having a 'getvalue' method.
What version of the product are you using? On what operating system?
'0.2.5'
Feb 10 (5 days ago) #1[email protected]
slight correction to code:
Reported by [email protected], Feb 10 (5 days ago)
Somewhat related to Issue 41, but if you have replaced sys.stdout with something else (like StringIO in order to capture output for unit testing purposes), then the wrapping that colorama does exposes an interface that differs from that of the object you set sys.stdout to. Namely in the case of StringIO, it has a getvalue() method to get what was written to it.
After calling colorama.init, the object set to sys.stdout no longer has this method.
What steps will reproduce the problem?
What is the expected output?
An empty string on the console.
What do you see instead?
An error message about sys.stdio not having a 'getvalue' method.
What version of the product are you using? On what operating system?
'0.2.5'
Feb 10 (5 days ago) #1 [email protected]
slight correction to code:
import StringIO
import sys
import colorama
sys.stdout = StringIO.StringIO()
colorama.init(strip=True, convert=False)
sys.stdout.getvalue()
(Issue migrated from https://code.google.com/p/colorama/issues/detail?id=64)
The text was updated successfully, but these errors were encountered: