Title: import error when non-ascii characters are present in cwd or user name (windows) · Issue #3516 · matplotlib/matplotlib · GitHub
Open Graph Title: import error when non-ascii characters are present in cwd or user name (windows) · Issue #3516 · matplotlib/matplotlib
X Title: import error when non-ascii characters are present in cwd or user name (windows) · Issue #3516 · matplotlib/matplotlib
Description: Ahoy! I have recently updated matplotlib through conda to version 14.0 (np19py27_0). I am using windows 8, python 2.7.7 (Anaconda distribution 2.0.2 32-bit) Unfortunatelly my windows user name contains non-ascii caracter (ś) and importin...
Open Graph Description: Ahoy! I have recently updated matplotlib through conda to version 14.0 (np19py27_0). I am using windows 8, python 2.7.7 (Anaconda distribution 2.0.2 32-bit) Unfortunatelly my windows user name cont...
X Description: Ahoy! I have recently updated matplotlib through conda to version 14.0 (np19py27_0). I am using windows 8, python 2.7.7 (Anaconda distribution 2.0.2 32-bit) Unfortunatelly my windows user name cont...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/3516
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"import error when non-ascii characters are present in cwd or user name (windows)","articleBody":"Ahoy!\nI have recently updated matplotlib through conda to version `14.0` (`np19py27_0`).\nI am using windows 8, python 2.7.7 (Anaconda distribution 2.0.2 32-bit)\nUnfortunatelly my windows user name contains non-ascii caracter (`ś`) and importing matplotlib gives errors. :cry: (previous matplotlib versions I used did not have any problem with this)\n\nThe error comes in two flavors:\n:black_circle: If my current working directory contains non-ascii character then:\n\n``` python\n---------------------------------------------------------------------------\nUnicodeDecodeError Traceback (most recent call last)\n\u003cipython-input-1-82be63b7783c\u003e in \u003cmodule\u003e()\n----\u003e 1 import matplotlib\n\nD:\\Python\\Anaconda\\lib\\site-packages\\matplotlib\\__init__.py in \u003cmodule\u003e()\n 1046 \n 1047 # this is the instance used by the matplotlib classes\n-\u003e 1048 rcParams = rc_params()\n 1049 \n 1050 if rcParams['examples.directory']:\n\nD:\\Python\\Anaconda\\lib\\site-packages\\matplotlib\\__init__.py in rc_params(fail_on_error)\n 895 default matplotlib rc file.\n 896 \"\"\"\n--\u003e 897 fname = matplotlib_fname()\n 898 if not os.path.exists(fname):\n 899 # this should never happen, default in mpl-data should always be found\n\nD:\\Python\\Anaconda\\lib\\site-packages\\matplotlib\\__init__.py in matplotlib_fname()\n 746 system-defined copy.\n 747 \"\"\"\n--\u003e 748 fname = os.path.join(os.getcwd(), 'matplotlibrc')\n 749 if os.path.exists(fname):\n 750 return fname\n\nD:\\Python\\Anaconda\\lib\\ntpath.pyc in join(path, *paths)\n 82 if result_path and result_path[-1] not in '\\\\/':\n 83 result_path = result_path + '\\\\'\n---\u003e 84 result_path = result_path + p_path\n 85 return result_drive + result_path\n 86 \n\nUnicodeDecodeError: 'ascii' codec can't decode byte 0x9c in position 11: ordinal not in range(128)\n```\n\n:black_circle: If I change my current directory so that it does not contain any ascii characters the error transforms itself a little:\n\n``` python\n---------------------------------------------------------------------------\nUnicodeDecodeError Traceback (most recent call last)\n\u003cipython-input-6-1d1446f6fa64\u003e in \u003cmodule\u003e()\n----\u003e 1 from matplotlib import pyplot as plt\n\nD:\\Python\\Anaconda\\lib\\site-packages\\matplotlib\\__init__.py in \u003cmodule\u003e()\n 1046 \n 1047 # this is the instance used by the matplotlib classes\n-\u003e 1048 rcParams = rc_params()\n 1049 \n 1050 if rcParams['examples.directory']:\n\nD:\\Python\\Anaconda\\lib\\site-packages\\matplotlib\\__init__.py in rc_params(fail_on_error)\n 895 default matplotlib rc file.\n 896 \"\"\"\n--\u003e 897 fname = matplotlib_fname()\n 898 if not os.path.exists(fname):\n 899 # this should never happen, default in mpl-data should always be found\n\nD:\\Python\\Anaconda\\lib\\site-packages\\matplotlib\\__init__.py in matplotlib_fname()\n 757 return fname\n 758 \n--\u003e 759 configdir = _get_configdir()\n 760 if configdir is not None:\n 761 fname = os.path.join(configdir, 'matplotlibrc')\n\nD:\\Python\\Anaconda\\lib\\site-packages\\matplotlib\\__init__.py in _get_configdir()\n 628 5. A writable directory could not be found or created; return None.\n 629 \"\"\"\n--\u003e 630 return _get_config_or_cache_dir(_get_xdg_config_dir())\n 631 \n 632 get_configdir = verbose.wrap('CONFIGDIR=%s', _get_configdir, always=False)\n\nD:\\Python\\Anaconda\\lib\\site-packages\\matplotlib\\__init__.py in _get_xdg_config_dir()\n 553 path = os.environ.get('XDG_CONFIG_HOME')\n 554 if path is None:\n--\u003e 555 path = get_home()\n 556 if path is not None:\n 557 path = os.path.join(path, '.config')\n\nD:\\Python\\Anaconda\\lib\\site-packages\\matplotlib\\__init__.py in wrapper(*args, **kwargs)\n 321 assert six.callable(func)\n 322 def wrapper(*args, **kwargs):\n--\u003e 323 ret = func(*args, **kwargs)\n 324 \n 325 if (always or not wrapper._spoke):\n\nD:\\Python\\Anaconda\\lib\\site-packages\\matplotlib\\__init__.py in _get_home()\n 507 \"\"\"\n 508 try:\n--\u003e 509 path = os.path.expanduser(\"~\")\n 510 except ImportError:\n 511 # This happens on Google App Engine (pwd module is not present).\n\nD:\\Python\\Anaconda\\lib\\ntpath.pyc in expanduser(path)\n 271 userhome = join(dirname(userhome), path[1:i])\n 272 \n--\u003e 273 return userhome + path[i:]\n 274 \n 275 \n\nUnicodeDecodeError: 'ascii' codec can't decode byte 0x9c in position 13: ordinal not in range(128)\n```\n","author":{"url":"https://github.com/mmagnuski","@type":"Person","name":"mmagnuski"},"datePublished":"2014-09-14T19:02:26.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":17},"url":"https://github.com/3516/matplotlib/issues/3516"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9c77d500-89ed-62a3-122e-5088b87c32cd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8F40:355EFE:5A5472:7A9D25:6A527DE2 |
| html-safe-nonce | 6ab643935f7985eb1a05aced5d32308e0912a221d4d3bbfec66f18658cd56c30 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RjQwOjM1NUVGRTo1QTU0NzI6N0E5RDI1OjZBNTI3REUyIiwidmlzaXRvcl9pZCI6IjEzNzIyNzIzNDA5NjUxNjI0NjYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 2184301c19b8c9f93b984ba6cbc5a277f6ba4eaac8198a367992131e900f9b43 |
| hovercard-subject-tag | issue:42727593 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/3516/issue_layout |
| twitter:image | https://opengraph.githubassets.com/549ac89d8311197700e4dd42e0f8a5790717fa31b7e0b89ef9cb615392789799/matplotlib/matplotlib/issues/3516 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/549ac89d8311197700e4dd42e0f8a5790717fa31b7e0b89ef9cb615392789799/matplotlib/matplotlib/issues/3516 |
| og:image:alt | Ahoy! I have recently updated matplotlib through conda to version 14.0 (np19py27_0). I am using windows 8, python 2.7.7 (Anaconda distribution 2.0.2 32-bit) Unfortunatelly my windows user name cont... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mmagnuski |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width