Skip to content

System Error in backend_agg. (with a fix!) #8650

Closed

Description

@Erotemic

I found an error when trying to add a stroke patheffect to a FancyArrow collection. Unfortunately I don't have a MWE, but I do have a simple fix.

The error I got was:
SystemError: new style getargs format but argument is not a tuple?

The offending line was line 166 of matplotlib/backends/backend_agg.py, which was calling the draw_path method of a matplotlib.backends._backend_agg.RendererAgg.

        else:
            self._renderer.draw_path(gc, path, transform, rgbFace)

This line calls into a compiled library, so I can't say much about what's going on further down the stack.

However, I did some print debugging. I found that this line was called just fine before I added my patheffects changes. Then I turned my new code on and did the same thing. The main difference was that rgbFace was always a tuple when the code worked and it was an np.ndarray when it crashed.

I made a simple fix that changes the code to:

        else:
            if rgbFace is not None:
                rgbFace = tuple(rgbFace)
            self._renderer.draw_path(gc, path, transform, rgbFace)

and now everything works. I don't have time to make a PR right now, but if someone else wants to this is an easy fix.


Versions:

Ubuntu Linux 16.04
matplotlib (2.0.2) from pip
Python 3.5.2

The library that had the crash in it:
_backend_agg.cpython-35m-x86_64-linux-gnu.so

Activity

  1. added this to the milestone on May 22, 2017
  2. tacaswell commented on May 22, 2017

    @tacaswell
    Member

    Exact work:

    • apply the patch in a PR
    • find a MWE and add a test
  3. modified the milestones: , on Aug 14, 2017
  4. modified the milestones: , on Oct 9, 2017
  5. added
    🌱 Good first issueOpen a pull request against these issues if there are no active ones!
    on Oct 16, 2017
  6. malgamves commented on Oct 28, 2017

    @malgamves

    cannot find the directory with the issue

  7. modified the milestones: needs sorting, v3.6.0 on Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🌱 Good first issueOpen a pull request against these issues if there are no active ones!

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions