Skip to content

Overhaul external process calls #7572

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

Merged
merged 16 commits into from
Apr 14, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
backend_ps: Try to fix UnicodeError
The full traceback leads to here:
lib/matplotlib/backends/backend_ps.py:1537: in gs_distill
    if ps_backend_helper.supports_ps2write: # gs version >= 9
lib/matplotlib/backends/backend_ps.py:106: in supports_ps2write
    return self.gs_version[0] >= 9
lib/matplotlib/backends/backend_ps.py:87: in gs_version
    s = Popen([self.gs_exe, "--version"], stdout=PIPE)
venv/lib/python2.7/site-packages/subprocess32.py:825: in __init__
    restore_signals, start_new_session)
venv/lib/python2.7/site-packages/subprocess32.py:1387: in _execute_child
    for exe in executable_list)
venv/lib/python2.7/site-packages/subprocess32.py:1386: in <genexpr>
    executable_list = tuple(fs_encode(exe)
venv/lib/python2.7/site-packages/subprocess32.py:1385: in <genexpr>
    for dir in path_list)
  • Loading branch information
tomspur committed Apr 9, 2017
commit 8844fd4807a08d8034b94dcc7897035cc1f456ec
2 changes: 1 addition & 1 deletion lib/matplotlib/backends/backend_ps.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def gs_version(self):
pass

from matplotlib.compat.subprocess import Popen, PIPE
s = Popen([self.gs_exe, "--version"], stdout=PIPE)
s = Popen([str(self.gs_exe), "--version"], stdout=PIPE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the str already done in the property?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One missed change?

pipe, stderr = s.communicate()
if six.PY3:
ver = pipe.decode('ascii')
Expand Down