Skip to content

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

Merged
davidism merged 1 commit into
pallets:masterfrom
masamitsu-murase:improvement_for_zip_support
Nov 22, 2018
Merged

Improve DebuggedApplication.get_resource so that it can return resource in zipped library.#1401
davidism merged 1 commit into
pallets:masterfrom
masamitsu-murase:improvement_for_zip_support

Conversation

@masamitsu-murase
Copy link
Copy Markdown
Contributor

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
Copy Markdown
Member

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
Copy Markdown
Contributor Author

Thank you for the reply.
Let me fix it.

@davidism
Copy link
Copy Markdown
Member

@masamitsu-murase
Copy link
Copy Markdown
Contributor Author

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 Compare November 22, 2018 15:15
@davidism davidism merged commit 774a3c3 into pallets:master Nov 22, 2018
@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

Development

Successfully merging this pull request may close these issues.

2 participants