Skip to content

Conversation

@kroenlein
Copy link
Collaborator

importlib has deprecated several methods in favor of methods that are not available in Python 3.8. This PR imports their third-party re-implementations to maintain 3.8 support while resolving the warnings for 3.12 in this and downstream libraries.

resource = read_binary("gemd.demo", "toothpick.jpg")

return BytesIO(resource)
return files("gemd.demo").joinpath("toothpick.jpg").open("rb")

Choose a reason for hiding this comment

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

Should we rewrite this to files("gemd.demo").joinpath("toothpick.jpg").read_bytes() to be consistent with strehlow_and_cook.py and test_parser.py?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It'd be nice, but that would break downstream consumers that expect a byte stream instead of bytes.

Copy link

@mVenetos97 mVenetos97 left a comment

Choose a reason for hiding this comment

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

Looks good to me

@kroenlein kroenlein merged commit f84671e into main Apr 3, 2024
@kroenlein kroenlein deleted the maintain/resolve-import-warnings branch April 3, 2024 20:16
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.

3 participants