-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
BUG: UnicodeEncodeError in test_to_latex_filename (pandas.tests.test_format.TestDataFrameFormatting) #12337
Comments
hmm I can repro this, but only on mac (usin 3.5 and latest numpy but I don't think numpy matters) cc @nbonnotte |
@dhomeier if you want to experiment on this one. not really sure what the issue is. |
Seems to me this:
I believe this is not correct; the default encoding is whatever is specified by the
|
Uh, I did write that part, but what I meant was "the default for pandas in a python3 environment is utf8", not "the default in python3 is utf8". This was to be consistant with
It would be interesting to compare |
Uh, I can't repro this, even though I'm on Mac OS X 10.10, python 3.5.1, numpy 1.10.4, and my |
So is the default supposed to be initialised somewhere in the
|
This gets the pandas encoding.
I think this is correct in this case, rather its the comparison that's the issue. you need to do like its above
|
Hum, I think I did overlook the default behaviour in Python 3 as pointed out by @dhomeier See this line: the parameter A simple solution could be to replace |
AFAICS
It's still throwing the error in
so maybe the |
@nbonnotte, you could perhaps explicitly call |
@dhomeier Of course we want non-ascii characters in LaTeX, they're handled by the inputenc package (or directly by XeLaTeX). Explicitly calling |
Yes, I may have misread the |
ideally you could do something to make this fail on Travis (as it is currently). I suspect in one of the alternate encoding builds (where we ovrride the LOCALE), may need to set some other variable to get this to fail. That way you can test wether a fix works. It may be that we need to set an alternate py3 build to use LOCALE (e.g. you can do this with the 3.4 slow build) |
Not sure I understand what you intend - add tests (for |
FWIW -- running into the same issue while building the package for 0.18.0-114-g6c692ae on debian sid. Will skip this test for now |
I see this too when running the tests on NetBSD with the default LC_ALL=C (which is ASCII) and python-3.5.2. |
xref #12337 Author: Nicolas Bonnotte <nicolas.bonnotte@gmail.com> Closes #14114 from nbonnotte/unicode-to_latex-12337 and squashes the following commits: dadf73c [Nicolas Bonnotte] New tentative with C locale b876296 [Nicolas Bonnotte] Base matrix configuration c825f86 [Nicolas Bonnotte] New files requirements-3.5_ASCII.* 3b4c6a5 [Nicolas Bonnotte] Travis conf: new test with python 3.5 and LC_ALL=C 3b859ce [Nicolas Bonnotte] Test for Python 3.4 with C locale
Since we don't support Python versions less than 3.6.1 and the CI hasn't had issues with this test, I imagine this is no longer an issue. Happy to reopen if anyone else experiences issues. |
Getting this error if (and I think only if)
LANG
is not defined or not set to anyutf8
-conforming value on 0.18.0rc1 (Mac OS X 10.10, python 3.4.4, numpy 0.11.0b3):Don't know about the inner workings of this test; if there are any open files involved, this might be relevant: scipy/scipy#5694
The text was updated successfully, but these errors were encountered: