Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Allow savefig to save SVGs on FIPS enabled systems #18192#18193

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jkseppan merged 2 commits intomatplotlib:masterfromdaytonb:fips-compatible
Aug 7, 2020

Conversation

daytonb
Copy link
Contributor

@daytonbdaytonb commentedAug 6, 2020
edited
Loading

PR Summary

This pull requestresolves#18192.

If you use a FIPS (Federal Information Processing Standards) enabled system, then you cannot useplt.savefig to save an image in SVG format. This is because theRenderSVG._make_id method takes the first 10 characters of ahashlib.md5 digest of entries in the SVG as the ID for entries in the SVG file.

The Python docs forhashlib includes the following note:

Constructors for hash algorithms that are always present in this module are sha1(), sha224(), sha256(), sha384(), sha512(), blake2b(), and blake2s(). md5() is normally available as well, though it may be missing if you are using a rare “FIPS compliant” build of Python.

PR Checklist

  • [na ] Has Pytest style unit tests
    - Not sure if this is applicable to my change
  • Code isFlake 8 compliant
  • [na] New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • [na] Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
    - Not a major feature
  • Documented in doc/api/next_api_changes/* if API changed in a backward-incompatible way

Copy link
Member

@dstansbydstansby left a comment

Choose a reason for hiding this comment

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

Seems like a reasonable approach. Is this injected into the .svg files? If so it would be good to add a quick note todoc/api/next_api_changes/behavior to say that the contents will be slightly different, just in case there is anybody comparing the hashes of matplotlib generated .svg files.

@daytonb
Copy link
ContributorAuthor

daytonb commentedAug 6, 2020 via email

Ok. I can update that and add it to the pull request.
On Thu, Aug 6, 2020 at 5:20 PM David Stansby ***@***.***> wrote: ***@***.**** commented on this pull request. Seems like a reasonable approach. Is this injected into the .svg files? If so it would be good to add a quick note to doc/api/next_api_changes/behavior to say that the contents will be slightly different, just in case there is anybody comparing the hashes of matplotlib generated .svg files. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#18193 (review)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABJTWIZER3MDYG477B3Y6KDR7MNCRANCNFSM4PWSKEPA> .

@dopplershiftdopplershift added this to thev3.4.0 milestoneAug 7, 2020
@daytonb
Copy link
ContributorAuthor

Alright I've added a file to thedoc/api/next_api_changes/behavior. Let me know if the description seems unclear and needs tweaking.

@daytonb
Copy link
ContributorAuthor

I re-wrote the behavior change note to no longer reference the private method. I was also previously getting an error from the circleci doc tests that I think was from the warnings Sphinx gave about my references tohashlib.md5 andRenderSVG._make_id. The warnings said that Sphinx couldn't find thesepyobjs to link to them. Obviously I removed the reference toRenderSVG._make_id so that won't be a problem any more, but I also reworded my note abouthashlib.md5 to avoid having to do a intersphinx reference.

Copy link
Member

@jklymakjklymak left a comment

Choose a reason for hiding this comment

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

This seems fine to me. I don't know that it really needs an API change note - the origin of the hash is just an implementation detail of the unique ID, and its not like the user needs to know that. But, I guess it doesn't hurt.

@jkseppanjkseppan merged commit9b7f94f intomatplotlib:masterAug 7, 2020
@jkseppan
Copy link
Member

Thanks@daytonb!

@daytonb
Copy link
ContributorAuthor

It's been a pleasure!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@QuLogicQuLogicQuLogic left review comments

@dstansbydstansbydstansby left review comments

@jkseppanjkseppanjkseppan approved these changes

@jklymakjklymakjklymak approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v3.4.0
Development

Successfully merging this pull request may close these issues.

Cannot save SVG file with FIPS compliant Python
6 participants
@daytonb@jkseppan@QuLogic@jklymak@dstansby@dopplershift

[8]ページ先頭

©2009-2025 Movatter.jp