Skip to content

Issue #8650 fixed #9602

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

Closed
wants to merge 2 commits into from
Closed

Issue #8650 fixed #9602

wants to merge 2 commits into from

Conversation

malgamves
Copy link

@malgamves malgamves commented Oct 28, 2017

Fixed the system error mentioned in issue #8650

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

Fixed the system error mentioned in issue #8650
self._renderer.draw_path(gc, path, transform, rgbFace)
if rgbFace is not None:
rgbFace = tuple(rgbFace)
self._renderer.draw_path(gc, path, transform, rgbFace)
Copy link
Member

Choose a reason for hiding this comment

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

You accidentally removed try

Copy link
Author

Choose a reason for hiding this comment

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

Let me fix that, thanks!

Added the 'try:' i accidentally removed and fixed issue #8650
@tacaswell
Copy link
Member

The circle CI failures are because the commit this is based on is older than the fix for that ( #9325 ), those can be disregarded here (or @malgamves can you rebase on to current master?)

The failure on travis is due to some trailing whitespace. The automated style checkers are a bit annoying, but the do help keep the code-base consistent, which is important for big projects with lots of contributors.

It would be better if we had a test to exercise the original issue (to make sure this really fixes it!) but this code path is covered in the tests so I am 👍 to this going in with out an extra test.

Thanks for your work on this @malgamves !

@tacaswell tacaswell added this to the v2.2 milestone Oct 28, 2017
@Kojoley
Copy link
Member

Kojoley commented Oct 28, 2017

I do not think the fix is doing a right thing. In many places you can find rgbFace = mcolors.to_rgba(...) or accessing the parts of rgbFace like that

if rgbFace[3] == 0:

@malgamves
Copy link
Author

Yes, I can rebase on the current master. Lets see if that works.

@anntzer
Copy link
Contributor

anntzer commented Oct 29, 2017

I agree with @Kojoley that we should first figure out how a non-tuple made it to that point to start with (for example, it is relevant for mplcairo to know whether we can expect colorspecs to be normalized (hopefully yes) or not), and thus request a MWE from the OP of #8650.

@tacaswell
Copy link
Member

This is the last step before we drop down to the c++ layer, I suspect that not-tuple may be the correct type for the python side and tuple is the correct type for this call.

@anntzer
Copy link
Contributor

anntzer commented Oct 29, 2017

The culprit is

int convert_rgba(PyObject *rgbaobj, void *rgbap)

which uses PyArg_ParseTuple (which expects exactly a tuple).

Note that this is also used by draw_markers (https://github.com/matplotlib/matplotlib/blob/master/src/_backend_agg_wrapper.cpp#L254) so again we should either make sure to normalize the input early, or fix convert_rgba to accept any sequence.

(I tried to fix it quickly at the C-level but things are slightly messy because (of course...) 0-dim numpy arrays return true to PySequence_Check but trigger an error on PySequence_Size, bleh :/)

@jklymak
Copy link
Member

jklymak commented Sep 12, 2020

I'm going to close this - it fixes a poorly documented error, and no one else has complained. There also seems to be some petered-out concern w/ how this was implemented. Thanks @malgamves and sorry this didn't come to fruition.

@jklymak jklymak closed this Sep 12, 2020
@story645 story645 removed this from the future releases milestone Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy