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
Matplotlib on Python 2 bugs out when there are non-ASCII characters in user's home directory #24379
Comments
comment:1
It looks like it is still present in the latest release (2.1.0), for which I have been working on an upgrade at #23696.
|
This comment has been minimized.
This comment has been minimized.
Changed upstream from Not yet reported upstream; Will do shortly. to Reported upstream. No feedback yet. |
Changed upstream from Reported upstream. No feedback yet. to Fixed upstream, in a later stable release. |
comment:4
This should be solved by upgrading to matplotlib 2.2.2 which has the upstream fix. |
Changed keywords from none to matplotlib, days94 |
Dependencies: #25702 |
Author: François Bissey |
comment:7
This is arguably fixed by #25702 (upgrade to MPL 2.2.2 with the fix). |
comment:8
Yep; IIRC this was fixed, thanks for the triaging. |
Changed author from François Bissey to none |
Reviewer: Erik Bray |
The
matplotlib/__init__.py
module containsfrom
futureimport unicode_literals
which is often inadvisable, as it can run afoul of some of Python's own unicode bugs.In particular at one point it calls
os.path.expanduser('~')
, where because ofunicode_literals
this becomesos.path.expanduser(u'~')
. This does not take care to decode the results ofos.environ['HOME']
(assuming it is ASCII), and ends up concatenating a unicode string with a non-unicode string, which means trying to first decoded the non-unicode string with the default (ASCII) encoding.This is a bug in matplotlib but it affects Sage users, particularly on Windows where non-ASCII usernames are more common (may also affect OSX users): https://ask.sagemath.org/question/40131/sagemath-80-using-windows-installer
Upstream report: matplotlib/matplotlib#10017
Depends on #25702
Upstream: Fixed upstream, in a later stable release.
CC: @slel @sagetrac-epalezzato
Component: packages: standard
Keywords: matplotlib, days94
Reviewer: Erik Bray
Issue created by migration from https://trac.sagemath.org/ticket/24379
The text was updated successfully, but these errors were encountered: