Skip to content

console_encode() fails on unicode when using ipython-notebook #1782

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

Closed
wants to merge 2 commits into from
Closed

console_encode() fails on unicode when using ipython-notebook #1782

wants to merge 2 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Aug 18, 2012

When running in ipnb (linux) I get:

pandas.common.console_encode(u"\u05d0")
'?'

I traced this back to sys.stdin.encoding being set to None rather then 'utf-8' like in the shell.

Attached is a fix for your consideration. the test is just a stub since mocking is required
to reproduce the bug when testing in the shell instead of inside ipnb.

@wesm
Copy link
Member

wesm commented Sep 8, 2012

Thanks for looking into this. I'll take the first commit but won't take the latter without a unit test

@wesm
Copy link
Member

wesm commented Sep 8, 2012

72d014a breaks python 2. Will have to look into it another time

@ghost
Copy link
Author

ghost commented Sep 8, 2012

how do I reproduce the problem on python 2?
i'll see if I can come up with something cleaner.

@wesm
Copy link
Member

wesm commented Sep 8, 2012

The unit test suite fails on python2

@ghost
Copy link
Author

ghost commented Sep 9, 2012

Added a unit test and a guard so that things behave properly when series.name is
actually a tuple (didn't know that was an option).

test_series and test_format pass over here.

@wesm
Copy link
Member

wesm commented Sep 9, 2012

Thanks. cherry-picked these

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant