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

Projects
None yet
2 participants
@masamitsu-murase
Copy link
Contributor

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Contributor Author

commented Nov 22, 2018

Thank you for the reply.
Let me fix it.

@davidism

This comment has been minimized.

Copy link
Member

commented Nov 22, 2018

@masamitsu-murase

This comment has been minimized.

Copy link
Contributor Author

commented Nov 22, 2018

I'm so sorry for the inconvenience...

allow debugger get_resource to work from a zip
DebuggedApplication.get_resource uses pkgutil.get_data

Use pkgutil to simplify get_resource.

@davidism davidism force-pushed the masamitsu-murase: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

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@davidism davidism added the debugger label Jan 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.