Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot debug script that uses colorama #1070

Closed
willyd opened this issue Jan 28, 2016 · 1 comment
Closed

Cannot debug script that uses colorama #1070

willyd opened this issue Jan 28, 2016 · 1 comment
Labels

Comments

@willyd
Copy link

willyd commented Jan 28, 2016

When I try to debug this simple script:

import colorama
colorama.init()
I get the following error:
Traceback (most recent call last):
  File "C:\Work\src\test.py", line 2, in
<module>
    colorama.init()
  File "C:\Anaconda\lib\site-packages\colorama\initialise.py", line 31, in init
    wrap_stream(orig_stdout, convert, strip, autoreset, wrap)
  File "C:\Anaconda\lib\site-packages\colorama\initialise.py", line 61, in wrap_
stream
    convert=convert, strip=strip, autoreset=autoreset)
  File "C:\Anaconda\lib\site-packages\colorama\ansitowin32.py", line 68, in __in
it__
    convert = on_windows and not wrapped.closed and not on_emulated_windows and
is_a_tty(wrapped)
AttributeError: '_ReplOutput' object has no attribute 'closed'
Press any key to continue . . .

Adding

self.closed = False

to class _ReplOutput fixes the problem. I am not sure what is the proper way of fixing this. With some hints I could send a PR.

Thanks

@zooba
Copy link
Member

zooba commented Jan 28, 2016

The easiest fix is to add closed = False underneath the errors = None line in _ReplOutput. A pull request would be great! It'll make it into our 2.2.3 release (coming in the next few months).

zooba added a commit to zooba/PTVS that referenced this issue Aug 23, 2016
Adds closed attribute to repl output.
zooba added a commit that referenced this issue Aug 23, 2016
Fixes #1070 Cannot debug script that uses colorama
@zooba zooba closed this as completed Aug 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants