-
Notifications
You must be signed in to change notification settings - Fork 207
Presence of umlauts causes problems when parsing searchindex.js #53
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
Comments
I can't get enough information from your issue report. And how you get to The case for searchindex.js is when resolving the links for the modules of |
This problem is originated by me. I'm running sphinx with Python 3.4.1 I have an authors name with the umlaut ü in a readme.rst (utf-8 encoded). I don't knwo why .. but sphinxgallery/docs_resolv.py:48 with open(url, 'r') as fid: opens the file searchindex.js as: With this encoding the ü umlaut raise the mentioned UnicodeDecodeError. If I force sphinxgallery/docs_resolv.py:48 to open it with UTF-8 encoding with open(url, 'r', encoding='utf-8') as fid: fid is <_io.TextIOWrapper name='searchindex.js' mode='r' encoding='utf-8'> and the error disapears. I cannot estimate if this utf8 default encoding leads to further problems or not. But if its safe, it would be nice you can add this setting. Cheers |
Could it not be a problem with your locale? What's the output of |
Locale: LANG=C Hmm .. interesting point. Thank you. |
@carsten-forty2 did you manage to fix your problem eventually ? |
@lesteve no .. I had not yet the time to dig in why my sys.stdout.encoding is no UTF8 I live with a local patched version of sphinxgallery/docs_resolv.py |
my LC_CTYPE was set to 'C' .. that causes python to take these ANSI encoding. If I set my LC_CTYPE to 'de_DE.UTF-8' .. everything runs fine without the mentioned patch. The issue can be closed for me. |
OK can you just paste your patch in case this is useful for later or for someone else? |
sphinxgallery/docs_resolv.py:48
-with open(url, 'r') as fid:
+with open(url, 'r', encoding='utf-8') as fid: |
We have a few umlauts in our project (i.e. in two of the authors lastnames).
make html-noplot
works fine, but sphinxgallery runs into problems:They appear cause problems when searchindex.js is parsed. Can this be improved?
The text was updated successfully, but these errors were encountered: