René's URL Explorer Experiment


Title: Bug in postscript backend in Python 3 by mdboom · Pull Request #1779 · matplotlib/matplotlib · GitHub

Open Graph Title: Bug in postscript backend in Python 3 by mdboom · Pull Request #1779 · matplotlib/matplotlib

X Title: Bug in postscript backend in Python 3 by mdboom · Pull Request #1779 · matplotlib/matplotlib

Description: The following examples demonstrates the issue: In [1]: import matplotlib In [2]: matplotlib.__version__ Out[2]: '1.2.0' In [3]: from matplotlib import pyplot as plt In [4]: fig = plt.figure() In [5]: ax = fig.add_subplot(1,1,1) In [6]: import numpy as np In [7]: ax.imshow(np.zeros((128, 128))) Out[7]: In [8]: fig.savefig('test.ps') --------------------------------------------------------------------------- TypeError Traceback (most recent call last) in () ----> 1 fig.savefig('test.ps') /opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/matplotlib/figure.py in savefig(self, *args, **kwargs) 1362 kwargs.setdefault('edgecolor', rcParams['savefig.edgecolor']) 1363 -> 1364 self.canvas.print_figure(*args, **kwargs) 1365 1366 if transparent: /opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/matplotlib/backend_bases.py in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, **kwargs) 2091 orientation=orientation, 2092 bbox_inches_restore=_bbox_inches_restore, -> 2093 **kwargs) 2094 finally: 2095 if bbox_inches and restore_bbox: /opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/matplotlib/backend_bases.py in print_ps(self, *args, **kwargs) 1858 from .backends.backend_ps import FigureCanvasPS # lazy import 1859 ps = self.switch_backends(FigureCanvasPS) -> 1860 return ps.print_ps(*args, **kwargs) 1861 1862 def print_raw(self, *args, **kwargs): /opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/matplotlib/backends/backend_ps.py in print_ps(self, outfile, *args, **kwargs) 969 970 def print_ps(self, outfile, *args, **kwargs): --> 971 return self._print_ps(outfile, 'ps', *args, **kwargs) 972 973 def print_eps(self, outfile, *args, **kwargs): /opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/matplotlib/backends/backend_ps.py in _print_ps(self, outfile, format, *args, **kwargs) 1005 self._print_figure(outfile, format, imagedpi, facecolor, edgecolor, 1006 orientation, isLandscape, papertype, -> 1007 **kwargs) 1008 1009 def _print_figure(self, outfile, format, dpi=72, facecolor='w', edgecolor='w', /opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/matplotlib/backends/backend_ps.py in _print_figure(self, outfile, format, dpi, facecolor, edgecolor, orientation, isLandscape, papertype, **kwargs) 1098 bbox_inches_restore=_bbox_inches_restore) 1099 -> 1100 self.figure.draw(renderer) 1101 1102 if dryrun: # return immediately if dryrun (tightbbox=True) /opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, *args, **kwargs) 53 def draw_wrapper(artist, renderer, *args, **kwargs): 54 before(artist, renderer) ---> 55 draw(artist, renderer, *args, **kwargs) 56 after(artist, renderer) 57 /opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/matplotlib/figure.py in draw(self, renderer) 998 dsu.sort(key=itemgetter(0)) 999 for zorder, a, func, args in dsu: -> 1000 func(*args) 1001 1002 renderer.close_group('figure') /opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, *args, **kwargs) 53 def draw_wrapper(artist, renderer, *args, **kwargs): 54 before(artist, renderer) ---> 55 draw(artist, renderer, *args, **kwargs) 56 after(artist, renderer) 57 /opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/matplotlib/axes.py in draw(self, renderer, inframe) 2086 2087 for zorder, a in dsu: -> 2088 a.draw(renderer) 2089 2090 renderer.close_group('axes') /opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, *args, **kwargs) 53 def draw_wrapper(artist, renderer, *args, **kwargs): 54 before(artist, renderer) ---> 55 draw(artist, renderer, *args, **kwargs) 56 after(artist, renderer) 57 /opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/matplotlib/image.py in draw(self, renderer, *args, **kwargs) 364 im._url = self.get_url() 365 im._gid = self.get_gid() --> 366 renderer.draw_image(gc, l, b, im) 367 gc.restore() 368 /opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/matplotlib/backends/backend_ps.py in draw_image(self, gc, x, y, im, dx, dy, transform) 470 471 h, w, bits, imagecmd = self._get_image_h_w_bits_command(im) --> 472 hexlines = '\n'.join(self._hex_lines(bits)) 473 474 if dx is None: TypeError: sequence item 0: expected str instance, bytes found In the mean time, is there a workaround?

Open Graph Description: The following examples demonstrates the issue: In [1]: import matplotlib In [2]: matplotlib.__version__ Out[2]: '1.2.0' In [3]: from matplotlib import pyplot as plt In [4]: fig = plt.fig...

X Description: The following examples demonstrates the issue: In [1]: import matplotlib In [2]: matplotlib.__version__ Out[2]: '1.2.0' In [3]: from matplotlib import pyplot as plt In [4]: fig =...

Opengraph URL: https://github.com/matplotlib/matplotlib/pull/1779

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:746e72ac-d493-2a8d-1183-a9ea73a2f02e
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idDA26:3BEBFA:A90768:E594C9:6A542A28
html-safe-nonce1f1731e3c6c52370df2a6d3854e9b20006615ff599dcb7d5918bffbbfb066171
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQTI2OjNCRUJGQTpBOTA3Njg6RTU5NEM5OjZBNTQyQTI4IiwidmlzaXRvcl9pZCI6IjU0NzUzODYwMTE5NDg0Mjc4MTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacd6da21552b95956e88a55c92c5a078814d1818fa487d9c77351397a6ba998294
hovercard-subject-tagpull_request:4305096
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/matplotlib/matplotlib/pull/1779/files
twitter:imagehttps://avatars.githubusercontent.com/u/38294?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/38294?s=400&v=4
og:image:altThe following examples demonstrates the issue: In [1]: import matplotlib In [2]: matplotlib.__version__ Out[2]: '1.2.0' In [3]: from matplotlib import pyplot as plt In [4]: fig = plt.fig...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneb9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git
octolytics-dimension-user_id215947
octolytics-dimension-user_loginmatplotlib
octolytics-dimension-repository_id1385122
octolytics-dimension-repository_nwomatplotlib/matplotlib
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1385122
octolytics-dimension-repository_network_root_nwomatplotlib/matplotlib
turbo-body-classeslogged-out env-production page-responsive
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release07a982c1d40157c619b364352b704c3ce66bb332
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/matplotlib/matplotlib/pull/1779/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fpull%2F1779%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fpull%2F1779%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=matplotlib%2Fmatplotlib
Reloadhttps://github.com/matplotlib/matplotlib/pull/1779/files
Reloadhttps://github.com/matplotlib/matplotlib/pull/1779/files
Reloadhttps://github.com/matplotlib/matplotlib/pull/1779/files
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/1779/files
matplotlib https://github.com/matplotlib
matplotlibhttps://github.com/matplotlib/matplotlib
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/1779/files
Notifications https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Fork 8.4k https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Star 23k https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Code https://github.com/matplotlib/matplotlib
Issues 1.1k https://github.com/matplotlib/matplotlib/issues
Pull requests 408 https://github.com/matplotlib/matplotlib/pulls
Actions https://github.com/matplotlib/matplotlib/actions
Projects https://github.com/matplotlib/matplotlib/projects
Wiki https://github.com/matplotlib/matplotlib/wiki
Security and quality 0 https://github.com/matplotlib/matplotlib/security
Insights https://github.com/matplotlib/matplotlib/pulse
Code https://github.com/matplotlib/matplotlib
Issues https://github.com/matplotlib/matplotlib/issues
Pull requests https://github.com/matplotlib/matplotlib/pulls
Actions https://github.com/matplotlib/matplotlib/actions
Projects https://github.com/matplotlib/matplotlib/projects
Wiki https://github.com/matplotlib/matplotlib/wiki
Security and quality https://github.com/matplotlib/matplotlib/security
Insights https://github.com/matplotlib/matplotlib/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fmatplotlib%2Fmatplotlib%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib%2Fissues%2Fnew%2Fchoose
mdboomhttps://github.com/mdboom
matplotlib:v1.2.xhttps://github.com/matplotlib/matplotlib/tree/v1.2.x
mdboom:ps/python3https://github.com/mdboom/matplotlib/tree/ps/python3
Conversation 8 https://github.com/matplotlib/matplotlib/pull/1779
Commits 3 https://github.com/matplotlib/matplotlib/pull/1779/commits
Checks 0 https://github.com/matplotlib/matplotlib/pull/1779/checks
Files changed https://github.com/matplotlib/matplotlib/pull/1779/files
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/1779/files
Bug in postscript backend in Python 3 https://github.com/matplotlib/matplotlib/pull/1779/files#top
Show all changes 3 commits https://github.com/matplotlib/matplotlib/pull/1779/files
1c17bb4 Fix Python 3 bug in PS backend. mdboom Feb 25, 2013 https://github.com/matplotlib/matplotlib/pull/1779/commits/1c17bb4b34afc2f5b63bd6e728b1881c59f34a2f
87cf619 Another Python3 bytes/unicode fix mdboom Feb 28, 2013 https://github.com/matplotlib/matplotlib/pull/1779/commits/87cf619440b8a4d37c7e50058e6a6969a0e35427
df8c010 Flush file handles at the end, since Python 3 won't do it for us. mdboom Feb 28, 2013 https://github.com/matplotlib/matplotlib/pull/1779/commits/df8c010dd8c4739edcb993083bdd758e09c7fd29
Clear filters https://github.com/matplotlib/matplotlib/pull/1779/files
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/1779/files
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/1779/files
lib/matplotlib/backends/backend_ps.pyhttps://github.com/matplotlib/matplotlib/pull/1779/files#diff-af28be596077d9f4ceda7df2faa04acb7a8e26e40f8f12adc0f04dede0493659
View file https://github.com/mdboom/matplotlib/blob/df8c010dd8c4739edcb993083bdd758e09c7fd29/lib/matplotlib/backends/backend_ps.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/matplotlib/matplotlib/pull/1779/{{ revealButtonHref }}
https://github.com/matplotlib/matplotlib/pull/1779/files#diff-af28be596077d9f4ceda7df2faa04acb7a8e26e40f8f12adc0f04dede0493659
https://github.com/matplotlib/matplotlib/pull/1779/files#diff-af28be596077d9f4ceda7df2faa04acb7a8e26e40f8f12adc0f04dede0493659
https://github.com/matplotlib/matplotlib/pull/1779/files#diff-af28be596077d9f4ceda7df2faa04acb7a8e26e40f8f12adc0f04dede0493659
https://github.com/matplotlib/matplotlib/pull/1779/files#diff-af28be596077d9f4ceda7df2faa04acb7a8e26e40f8f12adc0f04dede0493659
https://github.com/matplotlib/matplotlib/pull/1779/files#diff-af28be596077d9f4ceda7df2faa04acb7a8e26e40f8f12adc0f04dede0493659
https://github.com/matplotlib/matplotlib/pull/1779/files#diff-af28be596077d9f4ceda7df2faa04acb7a8e26e40f8f12adc0f04dede0493659
https://github.com/matplotlib/matplotlib/pull/1779/files#diff-af28be596077d9f4ceda7df2faa04acb7a8e26e40f8f12adc0f04dede0493659
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.