Skip to content
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

Improve DebuggedApplication.get_resource so that it can return resource in zipped library. #1401

Merged

Conversation

@masamitsu-murase
Copy link
Contributor

@masamitsu-murase masamitsu-murase commented Nov 21, 2018

The current implementation is not zip-safe because DebuggedApplication.get_resource cannot return binary data in shared directory.
This changeset improves DebuggedApplication.get_resource so that it can return binary data in shared directory even if werkzeug is included in pythonXX.zip.

I know that setup.py sets zip_safe to false, but I believe that this changeset improves this library.
If you don't like this patch, please ignore it.

Regards,
Murase

@davidism
Copy link
Member

@davidism davidism commented Nov 21, 2018

Thanks! I think this could be simplified by using pkgutil.get_data(__package__, resource) in all cases, rather than doing something different for filesystem vs zip installs.

@davidism davidism added this to the 0.15 milestone Nov 22, 2018
@masamitsu-murase
Copy link
Contributor Author

@masamitsu-murase masamitsu-murase commented Nov 22, 2018

Thank you for the reply.
Let me fix it.

@davidism
Copy link
Member

@davidism davidism commented Nov 22, 2018

@masamitsu-murase
Copy link
Contributor Author

@masamitsu-murase masamitsu-murase commented Nov 22, 2018

I'm so sorry for the inconvenience...

DebuggedApplication.get_resource uses pkgutil.get_data

Use pkgutil to simplify get_resource.
@davidism davidism force-pushed the improvement_for_zip_support branch from 7fbe5bb to 34ed01b Nov 22, 2018
@davidism davidism merged commit 774a3c3 into pallets:master Nov 22, 2018
1 check passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants