Title: Attribute error when testing on system without ghostscript · Issue #3259 · matplotlib/matplotlib · GitHub
Open Graph Title: Attribute error when testing on system without ghostscript · Issue #3259 · matplotlib/matplotlib
X Title: Attribute error when testing on system without ghostscript · Issue #3259 · matplotlib/matplotlib
Description: This was the meat of issue #3152, but there were other failures attached to that ticket, so it got confusing. Reopening with the main issue here: I'm getting a confusing test error when testing on OSX where ghostscript is not installed. ...
Open Graph Description: This was the meat of issue #3152, but there were other failures attached to that ticket, so it got confusing. Reopening with the main issue here: I'm getting a confusing test error when testing on ...
X Description: This was the meat of issue #3152, but there were other failures attached to that ticket, so it got confusing. Reopening with the main issue here: I'm getting a confusing test error when testing...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/3259
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Attribute error when testing on system without ghostscript","articleBody":"This was the meat of issue #3152, but there were other failures attached to that ticket, so it got confusing. Reopening with the main issue here:\n\nI'm getting a confusing test error when testing on OSX where ghostscript is not installed.\n\nI am not sure what the right approach is, to avoiding this test when there is no 'gs' binary or equivalent - any advice from the experts?\n\nhttps://api.travis-ci.org/jobs/28506496/log.txt?deansi=true\n\n```\n======================================================================\nERROR: matplotlib.tests.test_backend_ps.test_savefig_to_stringio_with_distiller\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/nose-1.3.3-py3.3.egg/nose/case.py\", line 198, in runTest\n self.test(*self.arg)\n File \"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-macosx-10.6-intel.egg/matplotlib/testing/decorators.py\", line 110, in wrapped_function\n func(*args, **kwargs)\n File \"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-macosx-10.6-intel.egg/matplotlib/tests/test_backend_ps.py\", line 53, in test_savefig_to_stringio_with_distiller\n _test_savefig_to_stringio()\n File \"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-macosx-10.6-intel.egg/matplotlib/tests/test_backend_ps.py\", line 27, in _test_savefig_to_stringio\n plt.savefig(buffer, format=format)\n File \"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-macosx-10.6-intel.egg/matplotlib/pyplot.py\", line 571, in savefig\n res = fig.savefig(*args, **kwargs)\n File \"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-macosx-10.6-intel.egg/matplotlib/figure.py\", line 1470, in savefig\n self.canvas.print_figure(*args, **kwargs)\n File \"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-macosx-10.6-intel.egg/matplotlib/backend_bases.py\", line 2192, in print_figure\n **kwargs)\n File \"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-macosx-10.6-intel.egg/matplotlib/backends/backend_ps.py\", line 985, in print_ps\n return self._print_ps(outfile, 'ps', *args, **kwargs)\n File \"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-macosx-10.6-intel.egg/matplotlib/backends/backend_ps.py\", line 1016, in _print_ps\n **kwargs)\n File \"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-macosx-10.6-intel.egg/matplotlib/backends/backend_ps.py\", line 1218, in _print_figure\n gs_distill(tmpfile, isEPSF, ptype=papertype, bbox=bbox)\n File \"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-macosx-10.6-intel.egg/matplotlib/backends/backend_ps.py\", line 1520, in gs_distill\n if ps_backend_helper.supports_ps2write: # gs version >= 9\n File \"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-macosx-10.6-intel.egg/matplotlib/backends/backend_ps.py\", line 109, in supports_ps2write\n return self.gs_version[0] >= 9\n File \"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib-1.4.x-py3.3-macosx-10.6-intel.egg/matplotlib/backends/backend_ps.py\", line 99, in gs_version\n gs_version = tuple(map(int, ver.strip().split(\".\")))\nValueError: invalid literal for int() with base 10: ''\n```\n\nThe error arises because `ver` in the code above is the empty string, and this is so because Popen execute of `gs --version` returns the empty string when there there is no `gs` binary (around line 93 of `lib/matplotlib/backends/backend_ps.py`). I guess this Popen call should raise an error (check of returncode), but I guess we also need to make sure this version check doesn't get called when `gs` is not present, and I'm not sure of the cleanest way to achieve that.\n","author":{"url":"https://github.com/matthew-brett","@type":"Person","name":"matthew-brett"},"datePublished":"2014-07-14T20:55:03Z","url":"https://github.com/matplotlib/matplotlib/issues/3259"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:4acdd1cc-6369-07d0-7dbb-f39baad3fb95 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9D98:DAF5F:1AEE05F:236B629:6B067C77 |
| html-safe-nonce | 021fddaae4a62a7b7d0edd7a3d81756de658ac3d6ed19559821a5614cade3ed3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RDk4OkRBRjVGOjFBRUUwNUY6MjM2QjYyOTo2QjA2N0M3NyIsInZpc2l0b3JfaWQiOiI1Mjg3MjYxMzcyMDM4OTM3NzIwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 5cb33433dbe85a44f5a2091725f6f3c47c07ee51c48008f6986d53098460571a |
| hovercard-subject-tag | issue:37827193 |
| 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/3259/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9fb05b3954e101e57325e415b0f956c2354df4ddcd7534a7518750e80adf4ee5/matplotlib/matplotlib/issues/3259 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9fb05b3954e101e57325e415b0f956c2354df4ddcd7534a7518750e80adf4ee5/matplotlib/matplotlib/issues/3259 |
| og:image:alt | This was the meat of issue #3152, but there were other failures attached to that ticket, so it got confusing. Reopening with the main issue here: I'm getting a confusing test error when testing on ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | matthew-brett |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4462ff7ebfd3d551f202659f2423dae617b6849d23b1df6465dc504ef497d14a |
| 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 | 6d3909414814ff86ce7da4c51a0f4918a13fb41b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width