Skip to content

Saving .png figure failing on OSX backend #9156

Closed
@dstansby

Description

@dstansby

Bug report

Saving .png files is currently failing on the osx backend. I'm guessing this is due to #6603 (see the error message below)

Code for reproduction

import matplotlib
matplotlib.use('MacOSX')
import matplotlib.pyplot as plt

fig, ax = plt.subplots()
fig.savefig('test.png')

Actual outcome

  File "test.py", line 6, in <module>
    fig.savefig('test.png')
  File "/Users/dstansby/github/matplotlib/lib/matplotlib/figure.py", line 1813, in savefig
    self.canvas.print_figure(fname, **kwargs)
  File "/Users/dstansby/github/matplotlib/lib/matplotlib/backend_bases.py", line 2258, in print_figure
    **kwargs)
  File "/Users/dstansby/github/matplotlib/lib/matplotlib/backends/backend_agg.py", line 507, in print_png
    FigureCanvasAgg.draw(self)
  File "/Users/dstansby/github/matplotlib/lib/matplotlib/backends/backend_agg.py", line 429, in draw
    toolbar.set_cursor(cursors.WAIT)
  File "/Users/dstansby/github/matplotlib/lib/matplotlib/backends/backend_macosx.py", line 188, in set_cursor
    _macosx.set_cursor(cursor)
SystemError: <built-in function set_cursor> returned NULL without setting an error

Expected outcome

Matplotlib version

  • Operating System: OSX
  • Matplotlib Version: Current master branch installed using pip
  • Python Version: 3.6.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    GUI: MacOSXRelease criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions