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

Use of "colorclass" breaks IPython on Windows #1

Closed
smiley opened this issue Dec 2, 2014 · 1 comment
Closed

Use of "colorclass" breaks IPython on Windows #1

smiley opened this issue Dec 2, 2014 · 1 comment
Assignees
Labels

Comments

@smiley
Copy link

smiley commented Dec 2, 2014

When I import Tortilla on Windows, my console breaks:
Imgur

Any pyreadline-assisted features, like tab-completion and history browsing (which uses the up & down keys), don't work at this point. This also happens with colorama and appears to have something to do with IPython going crazy when it loses control of stdout.

When I remove this part in wrappers.py:

if os.name == 'nt':
    colorclass.Windows.enable()  # <--

It works again, but debug trace colouring is (understandably) broken:

In [7]: api = tortilla.wrap("http://api.steampowered.com", debug=True)

In [8]: api.ISteamUser.ResolveVanityURL.v1.get("?vanityurl=smileybarry")
←[34mExecuting GET request:←[39m
←[90m    URL:   http://api.steampowered.com/ISteamUser/ResolveVanityURL/v1/?vanityurl=smileybarry
    headers: {}
    query: None
    data:  None
←[39m
←[31mGot 400 Bad Request (NOT JSON):←[39m
←[90m    <html><head><title>Bad Request</title></head><body><h1>Bad Request</h1>Please verify that all requir...
←[39m

Can you disable colouring & use of colorclass on Windows, at least for the time being?

redodo pushed a commit that referenced this issue Dec 3, 2014
@redodo
Copy link
Member

redodo commented Dec 3, 2014

Thanks for reporting this issue.

I've fixed this by checking if the script is run from IPython on Windows. In that case all colors are stripped from the debug messages. I've tested this on Windows 10 with Python 3.4.

@redodo redodo added the bug label Dec 3, 2014
@redodo redodo self-assigned this Dec 3, 2014
@redodo redodo closed this as completed Dec 3, 2014
redodo pushed a commit that referenced this issue May 18, 2016
Simplify py2 and py3 compatibility code
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