Skip to content

Can't import pyplot in matplotlib 2.0 rc2 #7715

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
Phlya opened this issue Dec 31, 2016 · 27 comments
Closed

Can't import pyplot in matplotlib 2.0 rc2 #7715

Phlya opened this issue Dec 31, 2016 · 27 comments
Milestone

Comments

@Phlya
Copy link
Contributor

Phlya commented Dec 31, 2016

I have just upgraded to 2.0 rc2 on Ubuntu 14.04 using sudo pip install https://github.com/matplotlib/matplotlib/archive/v2.0.0rc2.zip (from 1.5.3, which I got using pip from pypi). After the upgrade I can import matplotlib, but not pyplot:

ilya@ilya-GE40-2OL:~$ python
Python 2.7.12 (default, Nov 19 2016, 06:48:10) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib.pyplot as plt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 29, in <module>
    import matplotlib.colorbar
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/colorbar.py", line 36, in <module>
    import matplotlib.contour as contour
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/contour.py", line 22, in <module>
    import matplotlib.font_manager as font_manager
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/font_manager.py", line 1439, in <module>
    _rebuild()
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/font_manager.py", line 1418, in _rebuild
    fontManager = FontManager()
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/font_manager.py", line 1053, in __init__
    self.ttffiles = findSystemFonts(paths) + findSystemFonts()
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/font_manager.py", line 336, in findSystemFonts
    for f in get_fontconfig_fonts(fontext):
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/font_manager.py", line 303, in get_fontconfig_fonts
    return [fname for fname in _call_fc_list()
  File "/usr/local/lib/python2.7/dist-packages/functools32/functools32.py", line 400, in wrapper
    result = user_function(*args, **kwds)
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/font_manager.py", line 284, in _call_fc_list
    out = subprocess.check_output(['fc-list', '--format=%{file}'])
  File "/usr/local/lib/python2.7/dist-packages/subprocess32.py", line 629, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/subprocess32.py", line 825, in __init__
    restore_signals, start_new_session)
  File "/usr/local/lib/python2.7/dist-packages/subprocess32.py", line 1387, in _execute_child
    for exe in executable_list)
  File "/usr/local/lib/python2.7/dist-packages/subprocess32.py", line 1386, in <genexpr>
    executable_list = tuple(fs_encode(exe)
  File "/usr/local/lib/python2.7/dist-packages/subprocess32.py", line 1385, in <genexpr>
    for dir in path_list)
  File "/usr/lib/python2.7/posixpath.py", line 73, in join
    path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 11: ordinal not in range(128)
>>> import matplotlib
>>> matplotlib.__version__
'2.0.0rc2'

Please let me know if you need any more details.

@tacaswell
Copy link
Member

How exactly did you install 2.0.0rc2? pip install --pre matplotlib should have pulled the pre-release from pypi, see http://matplotlib.org/style_changes.html

What is the output of fc-list --format=%{file} at the command line? It looks like this is dying on a non-ascii font file name someplace on your system.

Can you try with python3?

@tacaswell tacaswell added this to the 2.0 (style change major release) milestone Dec 31, 2016
@Phlya
Copy link
Contributor Author

Phlya commented Dec 31, 2016

I provided the exact command I used in the beginning. Using the command you wrote didn't update my existing installation (maybe I should have added --upgrade there too?).

I can't try with python3 right away, can report later.

There are non-ascii file names in the system, but previous versions worked fine.
This is the output (huge!):

/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf
/usr/share/fonts/type1/gsfonts/a010033l.pfb
/usr/share/fonts/opentype/noto/NotoSansCJK-Thin.ttc
/usr/share/fonts/type1/gsfonts/p052024l.pfb
/usr/share/fonts/truetype/padauk/Padauk-bold.ttf
/usr/share/fonts/truetype/gentium-basic/GenBasR.ttf
/usr/share/fonts/truetype/dejavu/DejaVuSans-ExtraLight.ttf
/usr/share/fonts/truetype/kacst/mry_KacstQurn.ttf
/usr/share/fonts/truetype/lato/Lato-Thin.ttf
/usr/share/fonts/truetype/lato/Lato-SemiboldItalic.ttf
/usr/share/fonts/truetype/tlwg/TlwgMono-Oblique.ttf
/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc
/usr/share/fonts/type1/gsfonts/p052004l.pfb
/usr/share/fonts/truetype/tlwg/TlwgTypewriter-BoldOblique.ttf
/usr/share/fonts/truetype/tlwg/Umpush-BoldOblique.ttf
/usr/share/fonts/truetype/uralic/schoui__.ttf
/usr/share/fonts/truetype/freefont/FreeMono.ttf
/usr/share/fonts/truetype/tlwg/Umpush-LightOblique.ttf
/usr/share/fonts/opentype/stix/STIXVariants-Regular.otf
/usr/share/fonts/truetype/nanum/NanumGothicBold.ttf
/usr/share/fonts/Verdanaz.TTF
/usr/share/fonts/opentype/stix/STIXSizeFourSym-Regular.otf
/usr/share/fonts/opentype/noto/NotoSansCJK-Medium.ttc
/usr/share/fonts/truetype/kacst/KacstTitleL.ttf
/usr/share/fonts/type1/gsfonts/n021023l.pfb
/usr/share/fonts/opentype/noto/NotoSansCJK-Thin.ttc
/usr/share/fonts/truetype/freefont/FreeSerif.ttf
/usr/share/fonts/opentype/stix-word/STIXMath-Regular.otf
/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc
/usr/share/fonts/truetype/tlwg/Norasi-BoldItalic.ttf
/usr/share/fonts/truetype/dejavu/DejaVuSansCondensed-BoldOblique.ttf
/usr/share/fonts/truetype/gentium-basic/GenBasI.ttf
/usr/share/fonts/AndaleMo.TTF
/usr/share/fonts/truetype/tlwg/Loma-Bold.ttf
/usr/share/fonts/truetype/liberation/LiberationSansNarrow-Regular.ttf
/usr/share/fonts/truetype/liberation/LiberationSansNarrow-Bold.ttf
/usr/share/fonts/truetype/gentium-basic/GenBasBI.ttf
/usr/share/fonts/Georgiaz.TTF
/usr/share/fonts/truetype/kacst/KacstBook.ttf
/usr/share/fonts/type1/gsfonts/b018032l.pfb
/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
/usr/share/fonts/truetype/tlwg/Norasi-BoldOblique.ttf
/usr/share/fonts/truetype/dejavu/DejaVuSerif-Italic.ttf
/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc
/usr/share/fonts/opentype/stix-word/STIX-BoldItalic.otf
/usr/share/fonts/truetype/tlwg/Sawasdee-BoldOblique.ttf
/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-C.ttf
/usr/share/fonts/truetype/uralic/romaub__.ttf
/usr/share/fonts/truetype/freefont/FreeSerifBoldItalic.ttf
/usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf
/usr/share/fonts/truetype/kacst/KacstOffice.ttf
/usr/share/fonts/truetype/gentium-basic/GenBasB.ttf
/usr/share/fonts/truetype/tlwg/Umpush.ttf
/usr/share/fonts/trebucbi.ttf
/usr/share/fonts/opentype/stix/STIXGeneral-Bold.otf
/usr/share/fonts/truetype/freefont/FreeSansOblique.ttf
/usr/share/fonts/truetype/tlwg/Sawasdee-Oblique.ttf
/usr/share/fonts/truetype/tlwg/Umpush-Bold.ttf
/usr/share/fonts/truetype/tlwg/TlwgTypo-Bold.ttf
/usr/share/fonts/truetype/fonts-japanese-gothic.ttf
/usr/share/fonts/Timesbi.TTF
/usr/share/fonts/truetype/freefont/FreeSansBoldOblique.ttf
/usr/share/fonts/Verdana.TTF
/usr/share/fonts/truetype/tlwg/Waree-BoldOblique.ttf
/usr/share/fonts/truetype/kacst-one/KacstOne.ttf
/usr/share/fonts/opentype/noto/NotoSansCJK-Black.ttc
/usr/share/fonts/truetype/gentium/Gentium-I.ttf
/usr/share/fonts/truetype/lato/Lato-Italic.ttf
/usr/share/fonts/truetype/uralic/sanscu__.ttf
/usr/share/fonts/truetype/droid/DroidSansJapanese.ttf
/usr/share/fonts/type1/gsfonts/p052003l.pfb
/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc
/usr/share/fonts/truetype/lato/Lato-Black.ttf
/usr/share/fonts/truetype/tlwg/TlwgTypo-BoldOblique.ttf
/usr/share/fonts/truetype/tlwg/Laksaman.ttf
/usr/share/fonts/opentype/stix/STIXSizeThreeSym-Regular.otf
/usr/share/fonts/truetype/dejavu/DejaVuSansCondensed.ttf
/usr/share/fonts/truetype/kacst/KacstArt.ttf
/usr/share/fonts/truetype/liberation/LiberationMono-Regular.ttf
/usr/share/fonts/truetype/kacst/KacstPen.ttf
/usr/share/fonts/truetype/uralic/bookub__.ttf
/usr/share/fonts/truetype/dejavu/DejaVuSerif-BoldItalic.ttf
/usr/share/fonts/truetype/liberation/LiberationSerif-Regular.ttf
/usr/share/fonts/truetype/liberation/LiberationMono-Bold.ttf
/usr/share/fonts/AriBlk.TTF
/usr/share/fonts/truetype/ttf-khmeros-core/KhmerOSsys.ttf
/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-BI.ttf
/usr/share/fonts/truetype/droid/DroidSansHebrew-Regular.ttf
/usr/share/fonts/type1/gsfonts/n019023l.pfb
/usr/share/fonts/truetype/kacst/KacstQurn.ttf
/usr/share/fonts/opentype/stix/STIXIntegralsSm-Regular.otf
/usr/share/fonts/type1/gsfonts/p052023l.pfb
/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-MI.ttf
/usr/share/fonts/type1/gsfonts/z003034l.pfb
/usr/share/fonts/type1/gsfonts/a010013l.pfb
/usr/share/fonts/type1/gsfonts/a010015l.pfb
/usr/share/fonts/truetype/ubuntu-font-family/UbuntuMono-R.ttf
/usr/share/fonts/Impact.TTF
/usr/share/fonts/X11/Type1/c0611bt_.pfb
/usr/share/fonts/truetype/tlwg/Kinnari-BoldOblique.ttf
/usr/share/fonts/opentype/stix/STIXSizeOneSym-Bold.otf
/usr/share/fonts/Timesi.TTF
/usr/share/fonts/truetype/tlwg/TlwgMono.ttf
/usr/share/fonts/truetype/ubuntu-font-family/UbuntuMono-BI.ttf
/usr/share/fonts/truetype/nanum/NanumMyeongjo.ttf
/usr/share/fonts/Webdings.TTF
/usr/share/fonts/truetype/padauk/Padauk-book.ttf
/usr/share/fonts/truetype/kacst/KacstDecorative.ttf
/usr/share/fonts/X11/Type1/c0419bt_.pfb
/usr/share/fonts/truetype/tlwg/Loma.ttf
/usr/share/fonts/truetype/tlwg/Garuda-Oblique.ttf
/usr/share/fonts/truetype/freefont/FreeSerifBold.ttf
/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
/usr/share/fonts/truetype/uralic/pallui__.ttf
/usr/share/fonts/truetype/gentium/Gentium-R.ttf
/usr/share/fonts/truetype/uralic/sansu___.ttf
/usr/share/fonts/opentype/noto/NotoSansCJK-DemiLight.ttc
/usr/share/fonts/opentype/stix/STIXSizeFiveSym-Regular.otf
/usr/share/fonts/type1/gsfonts/c059013l.pfb
/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-LI.ttf
/usr/share/fonts/truetype/tlwg/TlwgTypewriter-Oblique.ttf
/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf
/usr/share/fonts/opentype/noto/NotoSansCJK-DemiLight.ttc
/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-L.ttf
/usr/share/fonts/truetype/freefont/FreeMonoBoldOblique.ttf
/usr/share/fonts/truetype/droid/DroidSansGeorgian.ttf
/usr/share/fonts/truetype/dejavu/DejaVuSansCondensed-Oblique.ttf
/usr/share/fonts/type1/gsfonts/b018035l.pfb
/usr/share/fonts/truetype/liberation/LiberationSans-Italic.ttf
/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-R.ttf
/usr/share/fonts/truetype/tlwg/Norasi-Bold.ttf
/usr/share/fonts/opentype/stix/STIXIntegralsUpSm-Regular.otf
/usr/share/fonts/truetype/tlwg/Laksaman-Bold.ttf
/usr/share/fonts/truetype/uralic/sansui__.ttf
/usr/share/fonts/trebuc.ttf
/usr/share/fonts/type1/gsfonts/n021024l.pfb
/usr/share/fonts/truetype/uralic/gothu___.ttf
/usr/share/fonts/truetype/lato/Lato-BlackItalic.ttf
/usr/share/fonts/opentype/noto/NotoSansCJK-Light.ttc
/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc
/usr/share/fonts/type1/gsfonts/n019004l.pfb
/usr/share/fonts/type1/gsfonts/n019024l.pfb
/usr/share/fonts/truetype/liberation/LiberationSerif-BoldItalic.ttf
/usr/share/fonts/truetype/lato/Lato-LightItalic.ttf
/usr/share/fonts/truetype/dejavu/DejaVuSansCondensed-Bold.ttf
/usr/share/fonts/truetype/uralic/chanui__.ttf
/usr/share/fonts/truetype/dejavu/DejaVuSansMono-BoldOblique.ttf
/usr/share/fonts/truetype/takao-gothic/TakaoPGothic.ttf
/usr/share/fonts/truetype/tlwg/Waree.ttf
/usr/share/fonts/truetype/liberation/LiberationSans-BoldItalic.ttf
/usr/share/fonts/truetype/dejavu/DejaVuSans-BoldOblique.ttf
/usr/share/fonts/opentype/stix/STIXGeneral-BoldItalic.otf
/usr/share/fonts/truetype/tlwg/TlwgTypist-Bold.ttf
/usr/share/fonts/truetype/tlwg/Norasi.ttf
/usr/share/fonts/opentype/stix/STIXNonUnicode-BoldItalic.otf
/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
/usr/share/fonts/truetype/tlwg/Kinnari-BoldItalic.ttf
/usr/share/fonts/Trebucbd.ttf
/usr/share/fonts/opentype/noto/NotoSansCJK-Medium.ttc
/usr/share/fonts/type1/gsfonts/n021004l.pfb
/usr/share/fonts/truetype/ttf-khmeros-core/KhmerOS.ttf
/usr/share/fonts/truetype/liberation/LiberationSansNarrow-BoldItalic.ttf
/usr/share/fonts/truetype/tlwg/Sawasdee.ttf
/usr/share/fonts/truetype/tlwg/Purisa-Oblique.ttf
/usr/share/fonts/truetype/liberation/LiberationMono-Italic.ttf
/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf
/usr/share/fonts/opentype/stix/STIXIntegralsUpD-Regular.otf
/usr/share/fonts/truetype/freefont/FreeSerifItalic.ttf
/usr/share/fonts/truetype/droid/DroidNaskh-Bold.ttf
/usr/share/fonts/truetype/droid/DroidSansThai.ttf
/usr/share/fonts/truetype/tlwg/Loma-BoldOblique.ttf
/usr/share/fonts/truetype/droid/DroidSansMono.ttf
/usr/share/fonts/truetype/tlwg/TlwgTypist.ttf
/usr/share/fonts/truetype/lato/Lato-Semibold.ttf
/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
/usr/share/fonts/truetype/tibetan-machine/TibetanMachineUni.ttf
/usr/share/fonts/truetype/openoffice/opens___.ttf
/usr/share/fonts/truetype/uralic/romaui__.ttf
/usr/share/fonts/Tahomabd.TTF
/usr/share/fonts/truetype/liberation/LiberationSerif-Italic.ttf
/usr/share/fonts/opentype/stix/STIXSizeTwoSym-Bold.otf
/usr/share/fonts/truetype/tlwg/Sawasdee-Bold.ttf
/usr/share/fonts/truetype/tlwg/Umpush-Light.ttf
/usr/share/fonts/truetype/tlwg/Waree-Oblique.ttf
/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Oblique.ttf
/usr/share/fonts/truetype/lato/Lato-Hairline.ttf
/usr/share/fonts/truetype/tlwg/Waree-Bold.ttf
/usr/share/fonts/opentype/stix/STIXVariants-Bold.otf
/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-M.ttf
/usr/share/fonts/type1/gsfonts/c059033l.pfb
/usr/share/fonts/truetype/padauk/Padauk-bookbold.ttf
/usr/share/fonts/opentype/noto/NotoSansCJK-Light.ttc
/usr/share/fonts/opentype/stix/STIXSizeFourSym-Bold.otf
/usr/share/fonts/truetype/tlwg/TlwgMono-Bold.ttf
/usr/share/fonts/truetype/droid/DroidNaskh-Regular.ttf
/usr/share/fonts/truetype/lato/Lato-BoldItalic.ttf
/usr/share/fonts/truetype/ubuntu-font-family/UbuntuMono-B.ttf
/usr/share/fonts/truetype/nanum/NanumMyeongjoBold.ttf
/usr/share/fonts/X11/Type1/c0632bt_.pfb
/usr/share/fonts/truetype/droid/DroidSerif-BoldItalic.ttf
/usr/share/fonts/opentype/stix/STIXNonUnicode-Italic.otf
/usr/share/fonts/type1/gsfonts/s050000l.pfb
/usr/share/fonts/truetype/dejavu/DejaVuSerifCondensed-Italic.ttf
/usr/share/fonts/truetype/tlwg/Loma-Oblique.ttf
/usr/share/fonts/truetype/gentium-basic/GenBkBasR.ttf
/usr/share/fonts/truetype/lato/Lato-Heavy.ttf
/usr/share/fonts/truetype/lato/Lato-HairlineItalic.ttf
/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc
/usr/share/fonts/truetype/dejavu/DejaVuSans-Oblique.ttf
/usr/share/fonts/truetype/droid/DroidSansHebrew-Bold.ttf
/usr/share/fonts/truetype/kacst/KacstDigital.ttf
/usr/share/fonts/truetype/kacst/KacstTitle.ttf
/usr/share/fonts/truetype/liberation/LiberationSansNarrow-Italic.ttf
/usr/share/fonts/truetype/uralic/monou___.ttf
/usr/share/fonts/Comicbd.TTF
/usr/share/fonts/truetype/tlwg/Garuda-Bold.ttf
/usr/share/fonts/truetype/tlwg/Garuda-BoldOblique.ttf
/usr/share/fonts/opentype/noto/NotoSansCJK-Black.ttc
/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf
/usr/share/fonts/truetype/nanum/NanumBarunGothic.ttf
/usr/share/fonts/truetype/lato/Lato-MediumItalic.ttf
/usr/share/fonts/truetype/gentium/GentiumAlt-R.ttf
/usr/share/fonts/truetype/tlwg/Purisa.ttf
/usr/share/fonts/truetype/gentium-basic/GenBkBasBI.ttf
/usr/share/fonts/truetype/lato/Lato-Bold.ttf
/usr/share/fonts/truetype/dejavu/DejaVuSerifCondensed-BoldItalic.ttf
/usr/share/fonts/truetype/droid/DroidSans-Bold.ttf
/usr/share/fonts/type1/gsfonts/n022003l.pfb
/usr/share/fonts/Arialbi.TTF
/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf
/usr/share/fonts/truetype/uralic/schoub__.ttf
/usr/share/fonts/truetype/sinhala/lklug.ttf
/usr/share/fonts/truetype/tlwg/TlwgTypo-Oblique.ttf
/usr/share/fonts/truetype/lato/Lato-Medium.ttf
/usr/share/fonts/truetype/kacst/KacstNaskh.ttf
/usr/share/fonts/truetype/droid/DroidSansArmenian.ttf
/usr/share/fonts/opentype/stix/STIXSizeThreeSym-Bold.otf
/usr/share/fonts/truetype/kacst/KacstLetter.ttf
/usr/share/fonts/truetype/tlwg/TlwgTypist-BoldOblique.ttf
/usr/share/fonts/truetype/tlwg/TlwgTypewriter.ttf
/usr/share/fonts/truetype/ubuntu-font-family/UbuntuMono-RI.ttf
/usr/share/fonts/truetype/gentium-basic/GenBkBasB.ttf
/usr/share/fonts/truetype/tlwg/Kinnari.ttf
/usr/share/fonts/truetype/tlwg/Norasi-Italic.ttf
/usr/share/fonts/truetype/lato/Lato-ThinItalic.ttf
/usr/share/fonts/opentype/stix/STIXIntegralsUp-Bold.otf
/usr/share/fonts/truetype/padauk/Padauk.ttf
/usr/share/fonts/truetype/uralic/bookui__.ttf
/usr/share/fonts/type1/gsfonts/n022024l.pfb
/usr/share/fonts/truetype/kacst-one/KacstOne-Bold.ttf
/usr/share/fonts/truetype/dejavu/DejaVuSerifCondensed-Bold.ttf
/usr/share/fonts/truetype/tlwg/TlwgTypewriter-Bold.ttf
/usr/share/fonts/opentype/noto/NotoSansCJK-Medium.ttc
/usr/share/fonts/type1/gsfonts/n019003l.pfb
/usr/share/fonts/opentype/stix/STIXIntegralsD-Bold.otf
/usr/share/fonts/type1/gsfonts/n022023l.pfb
/usr/share/fonts/truetype/tlwg/Kinnari-Bold.ttf
/usr/share/fonts/type1/gsfonts/c059016l.pfb
/usr/share/fonts/truetype/tlwg/Purisa-Bold.ttf
/usr/share/fonts/truetype/uralic/pallu___.ttf
/usr/share/fonts/truetype/tlwg/Norasi-Oblique.ttf
/usr/share/fonts/X11/Type1/c0633bt_.pfb
/usr/share/fonts/truetype/kacst/KacstFarsi.ttf
/usr/share/fonts/truetype/tlwg/Laksaman-Italic.ttf
/usr/share/fonts/opentype/noto/NotoSansCJK-Black.ttc
/usr/share/fonts/truetype/uralic/romau___.ttf
/usr/share/fonts/opentype/noto/NotoSansCJK-Thin.ttc
/usr/share/fonts/opentype/stix/STIXIntegralsSm-Bold.otf
/usr/share/fonts/opentype/stix-word/STIX-Bold.otf
/usr/share/fonts/truetype/uralic/sansubi_.ttf
/usr/share/fonts/truetype/dejavu/DejaVuSerifCondensed.ttf
/usr/share/fonts/opentype/stix/STIXGeneral-Italic.otf
/usr/share/fonts/Times.TTF
/usr/share/fonts/courbi.ttf
/usr/share/fonts/truetype/nanum/NanumBarunGothicBold.ttf
/usr/share/fonts/truetype/abyssinica/AbyssinicaSIL-R.ttf
/usr/share/fonts/truetype/droid/DroidSansEthiopic-Bold.ttf
/usr/share/fonts/truetype/gentium/GentiumAlt-I.ttf
/usr/share/fonts/truetype/lohit-punjabi/Lohit-Punjabi.ttf
/usr/share/fonts/opentype/noto/NotoSansCJK-Medium.ttc
/usr/share/fonts/type1/gsfonts/b018015l.pfb
/usr/share/fonts/Georgiai.TTF
/usr/share/fonts/X11/Type1/c0583bt_.pfb
/usr/share/fonts/type1/gsfonts/n019044l.pfb
/usr/share/fonts/X11/Type1/c0582bt_.pfb
/usr/share/fonts/opentype/noto/NotoSansCJK-DemiLight.ttc
/usr/share/fonts/Ariali.TTF
/usr/share/fonts/Georgiab.TTF
/usr/share/fonts/opentype/stix-word/STIX-Italic.otf
/usr/share/fonts/truetype/lato/Lato-HeavyItalic.ttf
/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
/usr/share/fonts/truetype/tlwg/Kinnari-Oblique.ttf
/usr/share/fonts/truetype/liberation/LiberationSerif-Bold.ttf
/usr/share/fonts/cour.ttf
/usr/share/fonts/trebucit.ttf
/usr/share/fonts/truetype/tlwg/Umpush-Oblique.ttf
/usr/share/fonts/type1/gsfonts/n019064l.pfb
/usr/share/fonts/truetype/droid/DroidSansEthiopic-Regular.ttf
/usr/share/fonts/Arialbd.TTF
/usr/share/fonts/truetype/droid/DroidSansFallbackFull.ttf
/usr/share/fonts/type1/gsfonts/n021003l.pfb
/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf
/usr/share/fonts/truetype/freefont/FreeMonoOblique.ttf
/usr/share/fonts/truetype/lao/Phetsarath_OT.ttf
/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
/usr/share/fonts/opentype/stix/STIXNonUnicode-Regular.otf
/usr/share/fonts/truetype/liberation/LiberationMono-BoldItalic.ttf
/usr/share/fonts/Verdanai.TTF
/usr/share/fonts/truetype/tlwg/TlwgMono-BoldOblique.ttf
/usr/share/fonts/type1/gsfonts/n019063l.pfb
/usr/share/fonts/Tahoma.TTF
/usr/share/fonts/opentype/stix/STIXIntegralsD-Regular.otf
/usr/share/fonts/opentype/noto/NotoSansCJK-DemiLight.ttc
/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
/usr/share/fonts/type1/gsfonts/d050000l.pfb
/usr/share/fonts/truetype/fonts-guru-extra/Saab.ttf
/usr/share/fonts/truetype/uralic/sansub__.ttf
/usr/share/fonts/type1/gsfonts/c059036l.pfb
/usr/share/fonts/truetype/tlwg/TlwgTypo.ttf
/usr/share/fonts/truetype/uralic/schou___.ttf
/usr/share/fonts/truetype/freefont/FreeSans.ttf
/usr/share/fonts/truetype/freefont/FreeMonoBold.ttf
/usr/share/fonts/Georgia.TTF
/usr/share/fonts/truetype/nanum/NanumGothic.ttf
/usr/share/fonts/truetype/tlwg/TlwgTypist-Oblique.ttf
/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
/usr/share/fonts/type1/gsfonts/b018012l.pfb
/usr/share/fonts/opentype/noto/NotoSansCJK-Light.ttc
/usr/share/fonts/truetype/droid/DroidSerif-Italic.ttf
/usr/share/fonts/X11/Type1/c0648bt_.pfb
/usr/share/fonts/type1/gsfonts/n022004l.pfb
/usr/share/fonts/Comic.TTF
/usr/share/fonts/Verdanab.TTF
/usr/share/fonts/opentype/noto/NotoSansCJK-Black.ttc
/usr/share/fonts/opentype/noto/NotoSansCJK-Light.ttc
/usr/share/fonts/truetype/lato/Lato-Regular.ttf
/usr/share/fonts/truetype/uralic/pallub__.ttf
/usr/share/fonts/truetype/tlwg/Laksaman-BoldItalic.ttf
/usr/share/fonts/opentype/stix/STIXIntegralsUp-Regular.otf
/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc
/usr/share/fonts/opentype/stix/STIXSizeTwoSym-Regular.otf
/usr/share/fonts/truetype/uralic/sanscub_.ttf
/usr/share/fonts/truetype/gentium-basic/GenBkBasI.ttf
/usr/share/fonts/courbd.ttf
/usr/share/fonts/truetype/freefont/FreeSansBold.ttf
/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-B.ttf
/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc
/usr/share/fonts/Timesbd.TTF
/usr/share/fonts/opentype/stix/STIXGeneral-Regular.otf
/usr/share/fonts/opentype/noto/NotoSansCJK-Thin.ttc
/usr/share/fonts/truetype/kacst/KacstScreen.ttf
/usr/share/fonts/opentype/stix/STIXIntegralsUpD-Bold.otf
/usr/share/fonts/type1/gsfonts/n019043l.pfb
/usr/share/fonts/truetype/droid/DroidSerif-Regular.ttf
/usr/share/fonts/truetype/tlwg/Kinnari-Italic.ttf
/usr/share/fonts/opentype/stix/STIXSizeOneSym-Regular.otf
/usr/share/fonts/opentype/stix/STIXNonUnicode-Bold.otf
/usr/share/fonts/X11/Type1/c0649bt_.pfb
/usr/share/fonts/truetype/droid/DroidSans.ttf
/usr/share/fonts/truetype/kacst/KacstPoster.ttf
/usr/share/fonts/opentype/stix-word/STIX-Regular.otf
/usr/share/fonts/truetype/droid/DroidSerif-Bold.ttf
/usr/share/fonts/type1/gsfonts/a010035l.pfb
/usr/share/fonts/truetype/uralic/gothub__.ttf
/usr/share/fonts/truetype/tlwg/Garuda.ttf
/usr/share/fonts/truetype/tlwg/Purisa-BoldOblique.ttf
/usr/share/fonts/Arial.TTF
/usr/share/fonts/truetype/uralic/booku___.ttf
/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-RI.ttf
/usr/share/fonts/truetype/ancient-scripts/Symbola_hint.ttf
/usr/share/fonts/truetype/lato/Lato-Light.ttf
/usr/share/fonts/couri.ttf
/usr/share/fonts/opentype/stix/STIXIntegralsUpSm-Bold.otf

@Phlya
Copy link
Contributor Author

Phlya commented Dec 31, 2016

And I am having problems getting mpl to work on my python3 installation, not sure I am very keen on figuring it out today.

@tacaswell
Copy link
Member

Ah, I was confused by a linebreak 🐑 .

What is your default system encoding?

In [20]: b'\xd0'.decode('latin-1')
Out[20]: 
'Ð'

Digging in a bit more, this is not issues with things blowing up when the list comes back, but something is subprocess32 choking when searching for the binary.

Do you have a 'Ð' in your path someplace?


Exceprting from subprocess32

def _get_exec_path(env=None):
    """Returns the sequence of directories that will be searched for the
    named executable (similar to a shell) when launching a process.

    *env* must be an environment variable dict or None.  If *env* is None,
    os.environ will be used.
    """
    if env is None:
        env = os.environ
    return env.get('PATH', os.defpath).split(os.pathsep)

and

                            # This matches the behavior of os._execvpe().
                            path_list = _get_exec_path(env)
                            executable_list = (os.path.join(dir, executable)
                                               for dir in path_list)
   

@Phlya
Copy link
Contributor Author

Phlya commented Jan 1, 2017

locate *Ð* could only find this in some completely unrelated file names...

Default encoding is UTF8, standard Ubuntu. Or are you asking something else?

@tacaswell
Copy link
Member

I got that glyph by guessing encoding as that byte is not valid utf-8 but latin-1 worked.

Can you try:

import subprocess32 as subprocess
subprocess.check_output(['ls'])

and

out = subprocess.check_output(['fc-list', '--format=%{file}'])

@Phlya
Copy link
Contributor Author

Phlya commented Jan 1, 2017

In [3]: import subprocess32 as subprocess
   ...: subprocess.check_output(['ls'])
   ...: 
Out[3]: '1.txt.gz\n2015.10.04.11.47.40.HiCImage.png\n2rfo.pdb\n2.txt.gz\n2zw3.pdb\n3bg1.pdb\n3bgi.pdb\n3iko.pdb\n3jrp.pdb\n3.txt.gz\n4OO8.pdb\n4oo8.pdb1\n9]=9\nairvpn\nall\nall.gz\nanaconda2\nArrow (S04) LostFilm\nastroid\nBEDTools.tar.gz\nBegegnungen\nbins\nbumblebee-ui\nCHANGELOG.txt\nchr11 mouse HiCImage.pdf\nCLC_Data\nCloudMailRu\ncolormap\ncompile\nconfigs\nconfig.xml\nCopy\nCOPYING.txt\ncores\ncryo-C \xd0\xbf\xd0\xb5\xd1\x80\xd0\xb5\xd0\xbf\xd0\xb8\xd1\x81\xd0\xba\xd0\xb0.pdf\ncx26_davids_star.png\nDocuments\nDropbox\ndwhelper\nExtra\nfigure_1-1.png\nfigure_1.png\nG124.gif\ngit\ngm 2016.02.18.13.42.37.HiCImage.png\ngpe17.bak\ngreendale\ngreendale_repo\nhiclib\nhicplotlib testing.ipynb\nHiC_results\nhostapd_1.0-3ubuntu1_amd64.deb\nhostapd_1.0-3ubuntu1_i386.deb\nhs_err_pid10146.log\nhs_err_pid11492.log\nhs_err_pid11508.log\nhs_err_pid14292.log\nhs_err_pid14681.log\nhs_err_pid14996.log\nhs_err_pid15703.log\nhs_err_pid23667.log\nhs_err_pid25843.log\nhs_err_pid2657.log\nhs_err_pid27557.log\nhs_err_pid29812.log\nhs_err_pid31702.log\nhs_err_pid3540.log\nhs_err_pid3613.log\nhs_err_pid3804.log\nhs_err_pid4845.log\nhs_err_pid6047.log\nhs_err_pid6198.log\nhs_err_pid6252.log\nhs_err_pid6879.log\nhs_err_pid7652.log\nhs_err_pid7849.log\nhs_err_pid9168.log\nicy.app\nicy.exe\nicy.jar\nicy.sh\nigv\nij\nimr90 2016.02.18.13.45.34.HiCImage.png\nindex00\nindex01\nindex02\nindex03\nindex04\nindex05\nindex06\nindex.html\nindex.html.1\ninstall.sh\njuicebox\nkdenlive\nkworker.bk\nlib\nlibcheese7_3.10.2-0ubuntu2_amd64.deb\nlibcheese-gtk23_3.10.2-0ubuntu2_amd64.deb\nlogilab\nlogs\nlog.txt\nMarvels.Agents.of.S.H.I.E.L.D.S03E05.INTERNAL.HDTV.x264-KILLERS[ettv]\nmaster.zip\nmy bank pass.txt.gpg\nMyDocument_1.gb\nMyDocument_2.gb\nMyDocument.gb\nMy Games\nnohup.out\nodt\nofficial transcript 2014 edited.pdf\nOld Firefox Data\noutput\nout.tmp\nPackage.list\nperl5\nPictures - GT-I9500\nplugins\nProjects\npylint\npython scripts\nR\nREADME.txt\nreads.chr2R.4660000.4700000.bed\nreads.txt\nred-petri-dish.svg\nred-petri-dish.svg.1\nred-petri-dish.svg.2\nRepo.keys\nresources.jar\nrtl8188ce-linux-driver\nrtl_92ce_92se_92de_8723ae_88ee_linux_mac80211_0012.0207.2013\nrtlwifi_new-master\nrun.info\nSe7en ( 1995 )\nseaborn-data\nsequencing_server\nsetting.xml\nShaun.the.Sheep.The.Movie.2015.1080p.WEB-DL.DD5.1.H264-RARBG\nsources.list\nsources.list.d\nsources.list.save\nspyder_crash.log\nSSD\nSteam\nStructural bioinformatics\nSupernatural (S11) BaibaKo\nSupernatural.S11E04.HDTV.x264-LOL[ettv]\nSupernatural.S11E06.HDTV.x264-LOL[ettv]\ntadbit-master\ntadbit.zip\ntestdisk.log\ntest pipe.py\ntext4849.png\nThe Big Bang Theory S07E10 HDTV x264-LOL[ettv]\nThe.Big.Bang.Theory.S09E10.HDTV.x264-LOL[rarbg]\nThe.Strain.S02E13.HDTV.x264-KILLERS[ettv]\nthis\ntmp\nubuntu-14.04.2-desktop-amd64.iso\nUbuntu One\nuntitled\nUntitled.ipynb\nupdate\nupdater.jar\nVirtualbox\nvlsub-master\nvpnbook-euro1-tcp443.ovpn\nwg mouse HiCImage.pdf\nwork\nworkflow_output\nworkspace\nx00\nx01\nx02\nx03\nx04\nx05\nx06\nxaa\nxab\nxac\nxad\nxae\nxaf\nxag\nYandex.Disk\nyandex_emergency_passes.pdf\nzotero\nZotero-LibreOffice-Plugin-3.5.9.xpi\n\xd0\x92\xd0\xb8\xd0\xb4\xd0\xb5\xd0\xbe\n\xd0\x92\xd0\xb8\xd0\xb4\xd0\xb5\xd0\xbe \xd0\xa1\xd0\xb5\xd1\x80\xd0\xb8\xd0\xb0\xd0\xbb\xd1\x8b Babylon 5\n\xd0\x94\xd0\xbe\xd0\xba\xd1\x83\xd0\xbc\xd0\xb5\xd0\xbd\xd1\x82\xd1\x8b\n\xd0\x97\xd0\xb0\xd0\xb3\xd1\x80\xd1\x83\xd0\xb7\xd0\xba\xd0\xb8\n\xd0\x98\xd0\xb7\xd0\xbe\xd0\xb1\xd1\x80\xd0\xb0\xd0\xb6\xd0\xb5\xd0\xbd\xd0\xb8\xd1\x8f\n\xd0\x9c\xd1\x83\xd0\xb7\xd1\x8b\xd0\xba\xd0\xb0\n\xd0\x9d\xd0\xbe\xd0\xb2\xd1\x8b\xd0\xb9 \xd0\xb4\xd0\xbe\xd0\xba\xd1\x83\xd0\xbc\xd0\xb5\xd0\xbd\xd1\x82 1.2014_03_16_01_15_58.0.svg\n\xd0\x9d\xd0\xbe\xd0\xb2\xd1\x8b\xd0\xb9 \xd0\xb4\xd0\xbe\xd0\xba\xd1\x83\xd0\xbc\xd0\xb5\xd0\xbd\xd1\x82 1.2014_03_16_12_54_22.0.svg\n\xd0\x9d\xd0\xbe\xd0\xb2\xd1\x8b\xd0\xb9 \xd0\xb4\xd0\xbe\xd0\xba\xd1\x83\xd0\xbc\xd0\xb5\xd0\xbd\xd1\x82 1.2015_03_16_10_25_59.0.svg\n\xd0\x9e\xd0\xb1\xd1\x89\xd0\xb5\xd0\xb4\xd0\xbe\xd1\x81\xd1\x82\xd1\x83\xd0\xbf\xd0\xbd\xd1\x8b\xd0\xb5\n\xd0\xa0\xd0\xb0\xd0\xb1\xd0\xbe\xd1\x87\xd0\xb8\xd0\xb9 \xd1\x81\xd1\x82\xd0\xbe\xd0\xbb\n\xd0\xa0\xd0\xb0\xd0\xb7\xd0\xb8\xd0\xbd.zip\n\xd0\xa1\xd0\xb5\xd1\x80\xd0\xb8\xd0\xb0\xd0\xbb\xd1\x8b\n\xd0\xa8\xd0\xb0\xd0\xb1\xd0\xbb\xd0\xbe\xd0\xbd\xd1\x8b\n'
In [4]: subprocess.check_output(['fc-list', '--format=%{file}'])
Out[4]: '/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf/usr/share/fonts/type1/gsfonts/a010033l.pfb/usr/share/fonts/opentype/noto/NotoSansCJK-Thin.ttc/usr/share/fonts/type1/gsfonts/p052024l.pfb/usr/share/fonts/truetype/padauk/Padauk-bold.ttf/usr/share/fonts/truetype/gentium-basic/GenBasR.ttf/usr/share/fonts/truetype/dejavu/DejaVuSans-ExtraLight.ttf/usr/share/fonts/truetype/kacst/mry_KacstQurn.ttf/usr/share/fonts/truetype/lato/Lato-Thin.ttf/usr/share/fonts/truetype/lato/Lato-SemiboldItalic.ttf/usr/share/fonts/truetype/tlwg/TlwgMono-Oblique.ttf/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc/usr/share/fonts/type1/gsfonts/p052004l.pfb/usr/share/fonts/truetype/tlwg/TlwgTypewriter-BoldOblique.ttf/usr/share/fonts/truetype/tlwg/Umpush-BoldOblique.ttf/usr/share/fonts/truetype/ttf-bitstream-vera/VeraMoBd.ttf/usr/share/fonts/truetype/uralic/schoui__.ttf/usr/share/fonts/truetype/freefont/FreeMono.ttf/usr/share/fonts/truetype/tlwg/Umpush-LightOblique.ttf/usr/share/fonts/opentype/stix/STIXVariants-Regular.otf/usr/share/fonts/truetype/lyx/rsfs10.ttf/usr/share/fonts/truetype/nanum/NanumGothicBold.ttf/usr/share/fonts/Verdanaz.TTF/usr/share/fonts/opentype/stix/STIXSizeFourSym-Regular.otf/usr/share/fonts/opentype/noto/NotoSansCJK-Medium.ttc/usr/share/fonts/truetype/kacst/KacstTitleL.ttf/usr/share/fonts/type1/gsfonts/n021023l.pfb/usr/share/fonts/opentype/noto/NotoSansCJK-Thin.ttc/usr/share/fonts/truetype/freefont/FreeSerif.ttf/usr/share/fonts/opentype/stix-word/STIXMath-Regular.otf/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc/usr/share/fonts/truetype/tlwg/Norasi-BoldItalic.ttf/usr/share/fonts/truetype/dejavu/DejaVuSansCondensed-BoldOblique.ttf/usr/share/fonts/truetype/gentium-basic/GenBasI.ttf/usr/share/fonts/AndaleMo.TTF/usr/share/fonts/truetype/tlwg/Loma-Bold.ttf/usr/share/fonts/truetype/lyx/stmary10.ttf/usr/share/fonts/truetype/liberation/LiberationSansNarrow-Regular.ttf/usr/share/fonts/truetype/liberation/LiberationSansNarrow-Bold.ttf/usr/share/fonts/truetype/lyx/wasy10.ttf/usr/share/fonts/truetype/gentium-basic/GenBasBI.ttf/usr/share/fonts/Georgiaz.TTF/usr/share/fonts/truetype/kacst/KacstBook.ttf/usr/share/fonts/type1/gsfonts/b018032l.pfb/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf/usr/share/fonts/truetype/tlwg/Norasi-BoldOblique.ttf/usr/share/fonts/truetype/dejavu/DejaVuSerif-Italic.ttf/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc/usr/share/fonts/opentype/stix-word/STIX-BoldItalic.otf/usr/share/fonts/truetype/tlwg/Sawasdee-BoldOblique.ttf/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-C.ttf/usr/share/fonts/truetype/uralic/romaub__.ttf/usr/share/fonts/truetype/freefont/FreeSerifBoldItalic.ttf/usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf/usr/share/fonts/truetype/kacst/KacstOffice.ttf/usr/share/fonts/truetype/gentium-basic/GenBasB.ttf/usr/share/fonts/truetype/tlwg/Umpush.ttf/usr/share/fonts/trebucbi.ttf/usr/share/fonts/opentype/stix/STIXGeneral-Bold.otf/usr/share/fonts/truetype/freefont/FreeSansOblique.ttf/usr/share/fonts/truetype/tlwg/Sawasdee-Oblique.ttf/usr/share/fonts/truetype/tlwg/Umpush-Bold.ttf/usr/share/fonts/truetype/tlwg/TlwgTypo-Bold.ttf/usr/share/fonts/truetype/fonts-japanese-gothic.ttf/usr/share/fonts/Timesbi.TTF/usr/share/fonts/truetype/freefont/FreeSansBoldOblique.ttf/usr/share/fonts/truetype/lyx/cmsy10.ttf/usr/share/fonts/Verdana.TTF/usr/share/fonts/truetype/lyx/msam10.ttf/usr/share/fonts/truetype/tlwg/Waree-BoldOblique.ttf/usr/share/fonts/truetype/kacst-one/KacstOne.ttf/usr/share/fonts/truetype/lyx/esint10.ttf/usr/share/fonts/opentype/noto/NotoSansCJK-Black.ttc/usr/share/fonts/truetype/gentium/Gentium-I.ttf/usr/share/fonts/truetype/lato/Lato-Italic.ttf/usr/share/fonts/truetype/uralic/sanscu__.ttf/usr/share/fonts/truetype/droid/DroidSansJapanese.ttf/usr/share/fonts/type1/gsfonts/p052003l.pfb/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc/usr/share/fonts/truetype/lato/Lato-Black.ttf/usr/share/fonts/truetype/tlwg/TlwgTypo-BoldOblique.ttf/usr/share/fonts/truetype/tlwg/Laksaman.ttf/usr/share/fonts/opentype/stix/STIXSizeThreeSym-Regular.otf/usr/share/fonts/truetype/dejavu/DejaVuSansCondensed.ttf/usr/share/fonts/truetype/kacst/KacstArt.ttf/usr/share/fonts/truetype/liberation/LiberationMono-Regular.ttf/usr/share/fonts/truetype/kacst/KacstPen.ttf/usr/share/fonts/truetype/lyx/cmmi10.ttf/usr/share/fonts/truetype/uralic/bookub__.ttf/usr/share/fonts/truetype/dejavu/DejaVuSerif-BoldItalic.ttf/usr/share/fonts/truetype/liberation/LiberationSerif-Regular.ttf/usr/share/fonts/truetype/lyx/cmr10.ttf/usr/share/fonts/truetype/liberation/LiberationMono-Bold.ttf/usr/share/fonts/AriBlk.TTF/usr/share/fonts/truetype/ttf-khmeros-core/KhmerOSsys.ttf/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-BI.ttf/usr/share/fonts/truetype/droid/DroidSansHebrew-Regular.ttf/usr/share/fonts/type1/gsfonts/n019023l.pfb/usr/share/fonts/truetype/kacst/KacstQurn.ttf/usr/share/fonts/opentype/stix/STIXIntegralsSm-Regular.otf/usr/share/fonts/type1/gsfonts/p052023l.pfb/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-MI.ttf/usr/share/fonts/type1/gsfonts/z003034l.pfb/usr/share/fonts/type1/gsfonts/a010013l.pfb/usr/share/fonts/type1/gsfonts/a010015l.pfb/usr/share/fonts/truetype/ubuntu-font-family/UbuntuMono-R.ttf/usr/share/fonts/Impact.TTF/usr/share/fonts/X11/Type1/c0611bt_.pfb/usr/share/fonts/truetype/tlwg/Kinnari-BoldOblique.ttf/usr/share/fonts/opentype/stix/STIXSizeOneSym-Bold.otf/usr/share/fonts/Timesi.TTF/usr/share/fonts/truetype/tlwg/TlwgMono.ttf/usr/share/fonts/truetype/ubuntu-font-family/UbuntuMono-BI.ttf/usr/share/fonts/truetype/nanum/NanumMyeongjo.ttf/usr/share/fonts/Webdings.TTF/usr/share/fonts/truetype/padauk/Padauk-book.ttf/usr/share/fonts/truetype/kacst/KacstDecorative.ttf/usr/share/fonts/X11/Type1/c0419bt_.pfb/usr/share/fonts/truetype/tlwg/Loma.ttf/usr/share/fonts/truetype/tlwg/Garuda-Oblique.ttf/usr/share/fonts/truetype/freefont/FreeSerifBold.ttf/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc/usr/share/fonts/truetype/uralic/pallui__.ttf/usr/share/fonts/truetype/gentium/Gentium-R.ttf/usr/share/fonts/truetype/uralic/sansu___.ttf/usr/share/fonts/opentype/noto/NotoSansCJK-DemiLight.ttc/usr/share/fonts/opentype/stix/STIXSizeFiveSym-Regular.otf/usr/share/fonts/type1/gsfonts/c059013l.pfb/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-LI.ttf/usr/share/fonts/truetype/tlwg/TlwgTypewriter-Oblique.ttf/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf/usr/share/fonts/opentype/noto/NotoSansCJK-DemiLight.ttc/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-L.ttf/usr/share/fonts/truetype/freefont/FreeMonoBoldOblique.ttf/usr/share/fonts/truetype/droid/DroidSansGeorgian.ttf/usr/share/fonts/truetype/dejavu/DejaVuSansCondensed-Oblique.ttf/usr/share/fonts/type1/gsfonts/b018035l.pfb/usr/share/fonts/truetype/liberation/LiberationSans-Italic.ttf/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-R.ttf/usr/share/fonts/truetype/tlwg/Norasi-Bold.ttf/usr/share/fonts/opentype/stix/STIXIntegralsUpSm-Regular.otf/usr/share/fonts/truetype/tlwg/Laksaman-Bold.ttf/usr/share/fonts/truetype/uralic/sansui__.ttf/usr/share/fonts/trebuc.ttf/usr/share/fonts/type1/gsfonts/n021024l.pfb/usr/share/fonts/truetype/uralic/gothu___.ttf/usr/share/fonts/truetype/lato/Lato-BlackItalic.ttf/usr/share/fonts/opentype/noto/NotoSansCJK-Light.ttc/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc/usr/share/fonts/type1/gsfonts/n019004l.pfb/usr/share/fonts/type1/gsfonts/n019024l.pfb/usr/share/fonts/truetype/liberation/LiberationSerif-BoldItalic.ttf/usr/share/fonts/truetype/lato/Lato-LightItalic.ttf/usr/share/fonts/truetype/dejavu/DejaVuSansCondensed-Bold.ttf/usr/share/fonts/truetype/uralic/chanui__.ttf/usr/share/fonts/truetype/dejavu/DejaVuSansMono-BoldOblique.ttf/usr/share/fonts/truetype/takao-gothic/TakaoPGothic.ttf/usr/share/fonts/truetype/tlwg/Waree.ttf/usr/share/fonts/truetype/liberation/LiberationSans-BoldItalic.ttf/usr/share/fonts/truetype/dejavu/DejaVuSans-BoldOblique.ttf/usr/share/fonts/opentype/stix/STIXGeneral-BoldItalic.otf/usr/share/fonts/truetype/tlwg/TlwgTypist-Bold.ttf/usr/share/fonts/truetype/tlwg/Norasi.ttf/usr/share/fonts/opentype/stix/STIXNonUnicode-BoldItalic.otf/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc/usr/share/fonts/truetype/tlwg/Kinnari-BoldItalic.ttf/usr/share/fonts/Trebucbd.ttf/usr/share/fonts/opentype/noto/NotoSansCJK-Medium.ttc/usr/share/fonts/type1/gsfonts/n021004l.pfb/usr/share/fonts/truetype/ttf-khmeros-core/KhmerOS.ttf/usr/share/fonts/truetype/liberation/LiberationSansNarrow-BoldItalic.ttf/usr/share/fonts/truetype/tlwg/Sawasdee.ttf/usr/share/fonts/truetype/tlwg/Purisa-Oblique.ttf/usr/share/fonts/truetype/liberation/LiberationMono-Italic.ttf/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf/usr/share/fonts/opentype/stix/STIXIntegralsUpD-Regular.otf/usr/share/fonts/truetype/freefont/FreeSerifItalic.ttf/usr/share/fonts/truetype/droid/DroidNaskh-Bold.ttf/usr/share/fonts/truetype/droid/DroidSansThai.ttf/usr/share/fonts/truetype/tlwg/Loma-BoldOblique.ttf/usr/share/fonts/truetype/droid/DroidSansMono.ttf/usr/share/fonts/truetype/tlwg/TlwgTypist.ttf/usr/share/fonts/truetype/ttf-bitstream-vera/VeraBI.ttf/usr/share/fonts/truetype/lato/Lato-Semibold.ttf/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc/usr/share/fonts/truetype/tibetan-machine/TibetanMachineUni.ttf/usr/share/fonts/truetype/openoffice/opens___.ttf/usr/share/fonts/truetype/uralic/romaui__.ttf/usr/share/fonts/Tahomabd.TTF/usr/share/fonts/truetype/liberation/LiberationSerif-Italic.ttf/usr/share/fonts/opentype/stix/STIXSizeTwoSym-Bold.otf/usr/share/fonts/truetype/tlwg/Sawasdee-Bold.ttf/usr/share/fonts/truetype/tlwg/Umpush-Light.ttf/usr/share/fonts/truetype/tlwg/Waree-Oblique.ttf/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Oblique.ttf/usr/share/fonts/truetype/lato/Lato-Hairline.ttf/usr/share/fonts/truetype/tlwg/Waree-Bold.ttf/usr/share/fonts/opentype/stix/STIXVariants-Bold.otf/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-M.ttf/usr/share/fonts/type1/gsfonts/c059033l.pfb/usr/share/fonts/truetype/padauk/Padauk-bookbold.ttf/usr/share/fonts/opentype/noto/NotoSansCJK-Light.ttc/usr/share/fonts/opentype/stix/STIXSizeFourSym-Bold.otf/usr/share/fonts/truetype/tlwg/TlwgMono-Bold.ttf/usr/share/fonts/truetype/droid/DroidNaskh-Regular.ttf/usr/share/fonts/truetype/lato/Lato-BoldItalic.ttf/usr/share/fonts/truetype/ubuntu-font-family/UbuntuMono-B.ttf/usr/share/fonts/truetype/nanum/NanumMyeongjoBold.ttf/usr/share/fonts/X11/Type1/c0632bt_.pfb/usr/share/fonts/truetype/droid/DroidSerif-BoldItalic.ttf/usr/share/fonts/truetype/ttf-bitstream-vera/VeraMoBI.ttf/usr/share/fonts/opentype/stix/STIXNonUnicode-Italic.otf/usr/share/fonts/type1/gsfonts/s050000l.pfb/usr/share/fonts/truetype/dejavu/DejaVuSerifCondensed-Italic.ttf/usr/share/fonts/truetype/tlwg/Loma-Oblique.ttf/usr/share/fonts/truetype/ttf-bitstream-vera/VeraSe.ttf/usr/share/fonts/truetype/gentium-basic/GenBkBasR.ttf/usr/share/fonts/truetype/lato/Lato-Heavy.ttf/usr/share/fonts/truetype/lato/Lato-HairlineItalic.ttf/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc/usr/share/fonts/truetype/dejavu/DejaVuSans-Oblique.ttf/usr/share/fonts/truetype/droid/DroidSansHebrew-Bold.ttf/usr/share/fonts/truetype/kacst/KacstDigital.ttf/usr/share/fonts/truetype/kacst/KacstTitle.ttf/usr/share/fonts/truetype/liberation/LiberationSansNarrow-Italic.ttf/usr/share/fonts/truetype/uralic/monou___.ttf/usr/share/fonts/Comicbd.TTF/usr/share/fonts/truetype/tlwg/Garuda-Bold.ttf/usr/share/fonts/truetype/ttf-bitstream-vera/VeraMoIt.ttf/usr/share/fonts/truetype/tlwg/Garuda-BoldOblique.ttf/usr/share/fonts/opentype/noto/NotoSansCJK-Black.ttc/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf/usr/share/fonts/truetype/nanum/NanumBarunGothic.ttf/usr/share/fonts/truetype/lato/Lato-MediumItalic.ttf/usr/share/fonts/truetype/gentium/GentiumAlt-R.ttf/usr/share/fonts/truetype/tlwg/Purisa.ttf/usr/share/fonts/truetype/gentium-basic/GenBkBasBI.ttf/usr/share/fonts/truetype/lato/Lato-Bold.ttf/usr/share/fonts/truetype/dejavu/DejaVuSerifCondensed-BoldItalic.ttf/usr/share/fonts/truetype/droid/DroidSans-Bold.ttf/usr/share/fonts/type1/gsfonts/n022003l.pfb/usr/share/fonts/Arialbi.TTF/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf/usr/share/fonts/truetype/uralic/schoub__.ttf/usr/share/fonts/truetype/sinhala/lklug.ttf/usr/share/fonts/truetype/tlwg/TlwgTypo-Oblique.ttf/usr/share/fonts/truetype/lato/Lato-Medium.ttf/usr/share/fonts/truetype/kacst/KacstNaskh.ttf/usr/share/fonts/truetype/droid/DroidSansArmenian.ttf/usr/share/fonts/opentype/stix/STIXSizeThreeSym-Bold.otf/usr/share/fonts/truetype/kacst/KacstLetter.ttf/usr/share/fonts/truetype/tlwg/TlwgTypist-BoldOblique.ttf/usr/share/fonts/truetype/tlwg/TlwgTypewriter.ttf/usr/share/fonts/truetype/ubuntu-font-family/UbuntuMono-RI.ttf/usr/share/fonts/truetype/gentium-basic/GenBkBasB.ttf/usr/share/fonts/truetype/tlwg/Kinnari.ttf/usr/share/fonts/truetype/tlwg/Norasi-Italic.ttf/usr/share/fonts/truetype/lato/Lato-ThinItalic.ttf/usr/share/fonts/opentype/stix/STIXIntegralsUp-Bold.otf/usr/share/fonts/truetype/padauk/Padauk.ttf/usr/share/fonts/truetype/uralic/bookui__.ttf/usr/share/fonts/truetype/lyx/eufm10.ttf/usr/share/fonts/type1/gsfonts/n022024l.pfb/usr/share/fonts/truetype/kacst-one/KacstOne-Bold.ttf/usr/share/fonts/truetype/dejavu/DejaVuSerifCondensed-Bold.ttf/usr/share/fonts/truetype/tlwg/TlwgTypewriter-Bold.ttf/usr/share/fonts/opentype/noto/NotoSansCJK-Medium.ttc/usr/share/fonts/type1/gsfonts/n019003l.pfb/usr/share/fonts/opentype/stix/STIXIntegralsD-Bold.otf/usr/share/fonts/type1/gsfonts/n022023l.pfb/usr/share/fonts/truetype/tlwg/Kinnari-Bold.ttf/usr/share/fonts/type1/gsfonts/c059016l.pfb/usr/share/fonts/truetype/tlwg/Purisa-Bold.ttf/usr/share/fonts/truetype/uralic/pallu___.ttf/usr/share/fonts/truetype/tlwg/Norasi-Oblique.ttf/usr/share/fonts/X11/Type1/c0633bt_.pfb/usr/share/fonts/truetype/kacst/KacstFarsi.ttf/usr/share/fonts/truetype/tlwg/Laksaman-Italic.ttf/usr/share/fonts/opentype/noto/NotoSansCJK-Black.ttc/usr/share/fonts/truetype/uralic/romau___.ttf/usr/share/fonts/opentype/noto/NotoSansCJK-Thin.ttc/usr/share/fonts/opentype/stix/STIXIntegralsSm-Bold.otf/usr/share/fonts/opentype/stix-word/STIX-Bold.otf/usr/share/fonts/truetype/ttf-bitstream-vera/VeraIt.ttf/usr/share/fonts/truetype/ttf-bitstream-vera/VeraSeBd.ttf/usr/share/fonts/truetype/uralic/sansubi_.ttf/usr/share/fonts/truetype/dejavu/DejaVuSerifCondensed.ttf/usr/share/fonts/truetype/ttf-bitstream-vera/VeraBd.ttf/usr/share/fonts/opentype/stix/STIXGeneral-Italic.otf/usr/share/fonts/Times.TTF/usr/share/fonts/courbi.ttf/usr/share/fonts/truetype/nanum/NanumBarunGothicBold.ttf/usr/share/fonts/truetype/abyssinica/AbyssinicaSIL-R.ttf/usr/share/fonts/truetype/ttf-bitstream-vera/VeraMono.ttf/usr/share/fonts/truetype/droid/DroidSansEthiopic-Bold.ttf/usr/share/fonts/truetype/gentium/GentiumAlt-I.ttf/usr/share/fonts/truetype/lohit-punjabi/Lohit-Punjabi.ttf/usr/share/fonts/opentype/noto/NotoSansCJK-Medium.ttc/usr/share/fonts/truetype/lyx/cmex10.ttf/usr/share/fonts/type1/gsfonts/b018015l.pfb/usr/share/fonts/Georgiai.TTF/usr/share/fonts/X11/Type1/c0583bt_.pfb/usr/share/fonts/type1/gsfonts/n019044l.pfb/usr/share/fonts/X11/Type1/c0582bt_.pfb/usr/share/fonts/opentype/noto/NotoSansCJK-DemiLight.ttc/usr/share/fonts/Ariali.TTF/usr/share/fonts/Georgiab.TTF/usr/share/fonts/opentype/stix-word/STIX-Italic.otf/usr/share/fonts/truetype/lato/Lato-HeavyItalic.ttf/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc/usr/share/fonts/truetype/tlwg/Kinnari-Oblique.ttf/usr/share/fonts/truetype/liberation/LiberationSerif-Bold.ttf/usr/share/fonts/cour.ttf/usr/share/fonts/trebucit.ttf/usr/share/fonts/truetype/tlwg/Umpush-Oblique.ttf/usr/share/fonts/type1/gsfonts/n019064l.pfb/usr/share/fonts/truetype/droid/DroidSansEthiopic-Regular.ttf/usr/share/fonts/Arialbd.TTF/usr/share/fonts/truetype/droid/DroidSansFallbackFull.ttf/usr/share/fonts/type1/gsfonts/n021003l.pfb/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf/usr/share/fonts/truetype/freefont/FreeMonoOblique.ttf/usr/share/fonts/truetype/lao/Phetsarath_OT.ttf/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc/usr/share/fonts/opentype/stix/STIXNonUnicode-Regular.otf/usr/share/fonts/truetype/liberation/LiberationMono-BoldItalic.ttf/usr/share/fonts/Verdanai.TTF/usr/share/fonts/truetype/tlwg/TlwgMono-BoldOblique.ttf/usr/share/fonts/type1/gsfonts/n019063l.pfb/usr/share/fonts/Tahoma.TTF/usr/share/fonts/opentype/stix/STIXIntegralsD-Regular.otf/usr/share/fonts/opentype/noto/NotoSansCJK-DemiLight.ttc/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc/usr/share/fonts/type1/gsfonts/d050000l.pfb/usr/share/fonts/truetype/fonts-guru-extra/Saab.ttf/usr/share/fonts/truetype/uralic/sansub__.ttf/usr/share/fonts/type1/gsfonts/c059036l.pfb/usr/share/fonts/truetype/tlwg/TlwgTypo.ttf/usr/share/fonts/truetype/uralic/schou___.ttf/usr/share/fonts/truetype/freefont/FreeSans.ttf/usr/share/fonts/truetype/freefont/FreeMonoBold.ttf/usr/share/fonts/Georgia.TTF/usr/share/fonts/truetype/nanum/NanumGothic.ttf/usr/share/fonts/truetype/tlwg/TlwgTypist-Oblique.ttf/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc/usr/share/fonts/type1/gsfonts/b018012l.pfb/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf/usr/share/fonts/opentype/noto/NotoSansCJK-Light.ttc/usr/share/fonts/truetype/droid/DroidSerif-Italic.ttf/usr/share/fonts/X11/Type1/c0648bt_.pfb/usr/share/fonts/type1/gsfonts/n022004l.pfb/usr/share/fonts/Comic.TTF/usr/share/fonts/Verdanab.TTF/usr/share/fonts/opentype/noto/NotoSansCJK-Black.ttc/usr/share/fonts/opentype/noto/NotoSansCJK-Light.ttc/usr/share/fonts/truetype/lato/Lato-Regular.ttf/usr/share/fonts/truetype/lyx/msbm10.ttf/usr/share/fonts/truetype/uralic/pallub__.ttf/usr/share/fonts/truetype/tlwg/Laksaman-BoldItalic.ttf/usr/share/fonts/opentype/stix/STIXIntegralsUp-Regular.otf/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc/usr/share/fonts/opentype/stix/STIXSizeTwoSym-Regular.otf/usr/share/fonts/truetype/uralic/sanscub_.ttf/usr/share/fonts/truetype/gentium-basic/GenBkBasI.ttf/usr/share/fonts/courbd.ttf/usr/share/fonts/truetype/freefont/FreeSansBold.ttf/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-B.ttf/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc/usr/share/fonts/Timesbd.TTF/usr/share/fonts/opentype/stix/STIXGeneral-Regular.otf/usr/share/fonts/opentype/noto/NotoSansCJK-Thin.ttc/usr/share/fonts/truetype/kacst/KacstScreen.ttf/usr/share/fonts/opentype/stix/STIXIntegralsUpD-Bold.otf/usr/share/fonts/type1/gsfonts/n019043l.pfb/usr/share/fonts/truetype/droid/DroidSerif-Regular.ttf/usr/share/fonts/truetype/tlwg/Kinnari-Italic.ttf/usr/share/fonts/opentype/stix/STIXSizeOneSym-Regular.otf/usr/share/fonts/opentype/stix/STIXNonUnicode-Bold.otf/usr/share/fonts/X11/Type1/c0649bt_.pfb/usr/share/fonts/truetype/droid/DroidSans.ttf/usr/share/fonts/truetype/kacst/KacstPoster.ttf/usr/share/fonts/opentype/stix-word/STIX-Regular.otf/usr/share/fonts/truetype/droid/DroidSerif-Bold.ttf/usr/share/fonts/type1/gsfonts/a010035l.pfb/usr/share/fonts/truetype/uralic/gothub__.ttf/usr/share/fonts/truetype/tlwg/Garuda.ttf/usr/share/fonts/truetype/tlwg/Purisa-BoldOblique.ttf/usr/share/fonts/Arial.TTF/usr/share/fonts/truetype/uralic/booku___.ttf/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-RI.ttf/usr/share/fonts/truetype/ancient-scripts/Symbola_hint.ttf/usr/share/fonts/truetype/lato/Lato-Light.ttf/usr/share/fonts/couri.ttf/usr/share/fonts/opentype/stix/STIXIntegralsUpSm-Bold.otf'

@tacaswell
Copy link
Member

I am truely stumped, that is the line that is raising in the OP?

Can you try walking back via %debug of the original traceback.

@Phlya
Copy link
Contributor Author

Phlya commented Jan 2, 2017

I have never used %debug, so let me know if I should do something else with it.
It shows that the path was something completely unrelated to matplotlib or any fonts. I didn't really need it, so deleted the whole folder with it, but nothing changed, it still "sees" it and breaks.


> /usr/lib/python2.7/posixpath.py(73)join()
     71             path +=  b
     72         else:
---> 73             path += '/' + b
     74     return path
     75 

ipdb> path
'/home/ilya/\xd0\x94\xd0\xbe\xd0\xba\xd1\x83\xd0\xbc\xd0\xb5\xd0\xbd\xd1\x82\xd1\x8b/biology/Programmes/biopieces/bp_bin'
ipdb> b
u'fc-list'

@tacaswell
Copy link
Member

That directory is likely still in your $PATH env so it is still trying to look there.

I still don't understand why you get this failure when importing matplotlib and not when just running the subproccess.check_output from the cli.

@Phlya
Copy link
Contributor Author

Phlya commented Jan 2, 2017

OK, whatever the reason for that was, I removed all non-ascii paths from the $PATH and now it works... But I also don't understand why 1.5.3 worked and 2.0 doesn't.

@tacaswell
Copy link
Member

It is because we modernized how we did this external process call to use subprocess (which was added in 3.2) and apparently the backport (subprocess32) can not handle non-ascii paths.

I am failing to quickly find any bug-reports upstream about this.

@tacaswell
Copy link
Member

I explicitly added /tmp/λ to my path and can not reproduce this

17:25 $ ipython
Python 2.7.12 |Continuum Analytics, Inc.| (default, Jul  2 2016, 17:42:40) 
Type "copyright", "credits" or "license" for more information.

IPython 5.1.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import subprocess32 as sp

In [2]: sp.check_output(['ls'])
Out[2]: 'bar.pdf\nbin\nbwi_blosc.h5\nbwi_bzip2.h5\nbwi.h5\nbwi_lzo.h5\ndata_cache\ndata_dump\ndemo_cache\nDesktop\ndk_tmp\nDownloads\nemacs-git-25.1.50.r125836-1-x86_64.pkg.tar.xz\nenvironment.yml\nexamples.sqlite3\nfix_srx.py\nflyscan_debug.log\nfoo.png\nfourFn.py\nfourFn.py~\nlocal_install\nmc3\nmpl_examples.sqlite3\nmpl_test\nRepos\nso2.png\nso.png\nsource\nsrc\nteaching\ntest-mic.wav\ntmp_notes\ntutorial\nUntitled1.ipynb\nUntitled2.ipynb\nUntitled.ipynb\nworkspace\n'

In [3]: sp.check_output(['target_test'])
---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-3-afb1d9d7f3d5> in <module>()
----> 1 sp.check_output(['target_test'])

/tmp/lpy/lib/python2.7/site-packages/subprocess32.pyc in check_output(*popenargs, **kwargs)
    627     if 'stdout' in kwargs:
    628         raise ValueError('stdout argument not allowed, it will be overridden.')
--> 629     process = Popen(stdout=PIPE, *popenargs, **kwargs)
    630     try:
    631         output, unused_err = process.communicate(timeout=timeout)

/tmp/lpy/lib/python2.7/site-packages/subprocess32.pyc in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds)                                                                                                                                                                                                                                                             
    823                                     c2pread, c2pwrite,
    824                                     errread, errwrite,
--> 825                                     restore_signals, start_new_session)
    826             except:
    827                 # The cleanup is performed within the finally block rather

/tmp/lpy/lib/python2.7/site-packages/subprocess32.pyc in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, start_new_session)                                                                                                                                                                                                                              
   1572                             else:
   1573                                 err_msg += ': ' + repr(orig_executable)
-> 1574                     raise child_exception_type(errno_num, err_msg)
   1575                 try:
   1576                     exception = child_exception_type(err_msg)

OSError: [Errno 2] No such file or directory: 'target_test'

In [4]: import sys

In [5]: sys.path
Out[5]: 
['',
 '/tmp/lpy/bin',
 '/tmp/lpy/lib/python27.zip',
 '/tmp/lpy/lib/python2.7',
 '/tmp/lpy/lib/python2.7/plat-linux2',
 '/tmp/lpy/lib/python2.7/lib-tk',
 '/tmp/lpy/lib/python2.7/lib-old',
 '/tmp/lpy/lib/python2.7/lib-dynload',
 '/tmp/lpy/lib/python2.7/site-packages',
 '/tmp/lpy/lib/python2.7/site-packages/setuptools-27.2.0-py2.7.egg',
 '/tmp/lpy/lib/python2.7/site-packages/IPython/extensions',
 '/home/tcaswell/.ipython']

In [6]:                                                                                                                                                                                                                                                       
Do you really want to exit ([y]/n)? 
(lpy) ✔ ~ 
17:27 $ echo $PATH
/tmp/lpy/bin:/home/tcaswell/mc3/bin:/lib/ccache/bin:/lib/ccache/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/tcaswell/bin:/home/tcaswell/local_installs/bin/:/home/tcaswell/bin:/home/tcaswell/local_installs/bin/
(lpy) ✔ ~ 
17:27 $ export PATH=/tmp/λ:$PATH                  
(lpy) ✔ ~ 
17:27 $ target_test                       
yo
(lpy) ✔ ~ 
17:27 $ ipython                 
Python 2.7.12 |Continuum Analytics, Inc.| (default, Jul  2 2016, 17:42:40) 
Type "copyright", "credits" or "license" for more information.

IPython 5.1.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import subprocess32 as sp

In [2]: sp.check_output(['target_test'])
Out[2]: 'yo\n'

In [3]: sys.path
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-3-946d4a74fc97> in <module>()
----> 1 sys.path

NameError: name 'sys' is not defined

In [4]: import sys

In [5]: sys.path
Out[5]: 
['',
 '/tmp/lpy/bin',
 '/tmp/lpy/lib/python27.zip',
 '/tmp/lpy/lib/python2.7',
 '/tmp/lpy/lib/python2.7/plat-linux2',
 '/tmp/lpy/lib/python2.7/lib-tk',
 '/tmp/lpy/lib/python2.7/lib-old',
 '/tmp/lpy/lib/python2.7/lib-dynload',
 '/tmp/lpy/lib/python2.7/site-packages',
 '/tmp/lpy/lib/python2.7/site-packages/setuptools-27.2.0-py2.7.egg',
 '/tmp/lpy/lib/python2.7/site-packages/IPython/extensions',
 '/home/tcaswell/.ipython']

In [6]: import os

In [7]: os.environ['PATH']
Out[7]: '/tmp/\xce\xbb:/tmp/lpy/bin:/home/tcaswell/mc3/bin:/lib/ccache/bin:/lib/ccache/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/tcaswell/bin:/home/tcaswell/local_installs/bin/:/home/tcaswell/bin:/home/tcaswell/local_installs/bin/'

In [8]: print(os.environ['PATH'])
/tmp/λ:/tmp/lpy/bin:/home/tcaswell/mc3/bin:/lib/ccache/bin:/lib/ccache/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/tcaswell/bin:/home/tcaswell/local_installs/bin/:/home/tcaswell/bin:/home/tcaswell/local_installs/bin/

In [9]: type(os.environ['PATH'])
Out[9]: str

In [10]: !cat /tmp/λ/target_test
#! /bin/bash

echo yo

In [11]: print(os.environ['PATH'].split(':'))
['/tmp/\xce\xbb', '/tmp/lpy/bin', '/home/tcaswell/mc3/bin', '/lib/ccache/bin', '/lib/ccache/bin', '/usr/local/sbin', '/usr/local/bin', '/usr/bin', '/usr/bin/site_perl', '/usr/bin/vendor_perl', '/usr/bin/core_perl', '/home/tcaswell/bin', '/home/tcaswell/local_installs/bin/', '/home/tcaswell/bin', '/home/tcaswell/local_installs/bin/']

In [12]: pprint(os.environ['PATH'].split(':'))
Pretty printing has been turned OFF

In [13]: pprint(os.environ['PATH'].split(':'))
Pretty printing has been turned ON

In [14]: os.environ['PATH'].split(':')
Out[14]: 
['/tmp/\xce\xbb',
 '/tmp/lpy/bin',
 '/home/tcaswell/mc3/bin',
 '/lib/ccache/bin',
 '/lib/ccache/bin',
 '/usr/local/sbin',
 '/usr/local/bin',
 '/usr/bin',
 '/usr/bin/site_perl',
 '/usr/bin/vendor_perl',
 '/usr/bin/core_perl',
 '/home/tcaswell/bin',
 '/home/tcaswell/local_installs/bin/',
 '/home/tcaswell/bin',
 '/home/tcaswell/local_installs/bin/']

In [15]: os.environ['PATH'].split(':')[0]
Out[15]: '/tmp/\xce\xbb'

In [16]: print(os.environ['PATH'].split(':')[0])
/tmp/λ

In [17]: 

@Phlya
Copy link
Contributor Author

Phlya commented Jan 5, 2017

Could it have something to do with the language of the system? Mine is set to Russian.

@QuLogic
Copy link
Member

QuLogic commented Jan 5, 2017

What is the output of echo $LANG; env | grep LC_?

@Phlya
Copy link
Contributor Author

Phlya commented Jan 5, 2017

ilya@ilya-GE40-2OL:~$ echo $LANG
ru_RU.UTF-8
ilya@ilya-GE40-2OL:~$ env | grep LC_
LC_PAPER=ru_RU.UTF-8
LC_ADDRESS=ru_RU.UTF-8
LC_MONETARY=ru_RU.UTF-8
LC_NUMERIC=ru_RU.UTF-8
LC_TELEPHONE=ru_RU.UTF-8
LC_IDENTIFICATION=ru_RU.UTF-8
LC_MEASUREMENT=ru_RU.UTF-8
LC_TIME=ru_RU.UTF-8
LC_NAME=ru_RU.UTF-8

@anntzer
Copy link
Contributor

anntzer commented Jan 10, 2017

I can reproduce this.

$ PATH=/tmp/λ:$PATH python2 -c 'from subprocess32 import *; print(check_output([u"fc-list", "--format=%{file}"]))'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/antony/.local/lib/python2.7/site-packages/subprocess32.py", line 629, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "/home/antony/.local/lib/python2.7/site-packages/subprocess32.py", line 825, in __init__
    restore_signals, start_new_session)
  File "/home/antony/.local/lib/python2.7/site-packages/subprocess32.py", line 1387, in _execute_child
    for exe in executable_list)
  File "/home/antony/.local/lib/python2.7/site-packages/subprocess32.py", line 1386, in <genexpr>
    executable_list = tuple(fs_encode(exe)
  File "/home/antony/.local/lib/python2.7/site-packages/subprocess32.py", line 1385, in <genexpr>
    for dir in path_list)
  File "/usr/lib/python2.7/posixpath.py", line 73, in join
    path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xce in position 5: ordinal not in range(128)

Note that this is because "fc-list" is a unicode literal (due to the future import). Looks like a bug in subprocess32.

@anntzer
Copy link
Contributor

anntzer commented Jan 10, 2017

Actually the stdlib subprocess also errors similarly (although at a slightly different point).

And note that in theory this probably could affect any use of subprocess in matplotlib.

@tacaswell
Copy link
Member

🤦‍♂️ That makes perfect sense in retrospect. The simplest solution is to just wrap str('fc-list') to turn it back into bytes on python2?

@anntzer
Copy link
Contributor

anntzer commented Jan 10, 2017

I guess b"fc-list" (and similarly at every other point of use of subprocess...) is probably enough. We may not even have to touch the other arguments.

@tacaswell
Copy link
Member

but in python3 doesn't it need to be a unicode object (as it will be added to unicode literals later)?

@anntzer
Copy link
Contributor

anntzer commented Jan 10, 2017

IIRC py3 handles bytes just fine because the code path is different.

@tacaswell
Copy link
Member

Other than the Powell metric of code quality [1], is there any reason to prefer str() or b'' to fix this?

[1] "Good code is code I wrote, bad code is code you wrote." James Powell around minute 20

@anntzer
Copy link
Contributor

anntzer commented Jan 12, 2017

I think str is slightly better, as 1) it looks less abuse of Py3 semantics (that bytes are also allowed) and 2) it could be picked up at some later point more easily for refactoring.

tacaswell added a commit to tacaswell/matplotlib that referenced this issue Jan 12, 2017
Closes matplotlib#7715

This ensures that on python2 the values passed into `check_output` are
bytes.  If they are passed in as unicode (due to unicode_literals at
the top of most of our files) they will cause an exception when there
is a path in PATH that has non-ascii values.  The reason is that when
locating possible executable our input (as unicode) is concatenated
with the non-ascii path (as bytes) which then fails to encode as ascii
and raises.

The other two places we currently use `check_output` (setupext.py and
tools/github_stats.py) we do not need this handling as we do not
import unicode_iterals in those files.
@tacaswell
Copy link
Member

@Phlya Thanks for bearing with us while getting this sorted out!

tacaswell added a commit to tacaswell/matplotlib that referenced this issue Jan 12, 2017
Closes matplotlib#7715

This ensures that on python2 the values passed into `check_output` or
`Popen` are bytes.  If they are passed in as unicode (due to
unicode_literals at the top of most of our files) they will cause an
exception when there is a path in PATH that has non-ascii values.  The
reason is that when locating possible executable our input (as
unicode) is concatenated with the non-ascii path (as bytes) which then
fails to encode as ascii and raises.

The other two places we currently use `check_output` (setupext.py and
tools/github_stats.py) we do not need this handling as we do not
import unicode_iterals in those files.
@tacaswell
Copy link
Member

closed by #7804

@Phlya
Copy link
Contributor Author

Phlya commented Jan 13, 2017

Great, thank you! Glad I could help.

tomspur added a commit to tomspur/matplotlib that referenced this issue Feb 5, 2017
tomspur added a commit to tomspur/matplotlib that referenced this issue Feb 5, 2017
tomspur added a commit to tomspur/matplotlib that referenced this issue Mar 28, 2017
tomspur added a commit to tomspur/matplotlib that referenced this issue Mar 28, 2017
tomspur added a commit to tomspur/matplotlib that referenced this issue Apr 3, 2017
tomspur added a commit to tomspur/matplotlib that referenced this issue Apr 3, 2017
tomspur added a commit to tomspur/matplotlib that referenced this issue Apr 9, 2017
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

No branches or pull requests

4 participants