-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
A probable bug with zip imports #169
Comments
I confirmed this is an issue, by importing and running the package as shown here https://docs.python.org/3/library/zipimport.html#examples |
Please can you give concrete steps to reproduce, including how to create the zip to begin with? |
Yes, of course. One easy way to reproduce this is to use a regular pipx run build
PYTHONPATH=dist/em_keyboard-5.0.1.dev3-py3-none-any.whl python3.13 -m em grinning_face This will currently error in
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I haven't confirmed, but seems like there might be an issue with zip imports here:
em-keyboard/src/em/cli.py
Lines 13 to 16 in 75a819a
The
as_file
context manager, when exiting, according to the docsSo
importlib.resources
reads the file from the .zip, creates a temporary file, and deletes it when exiting, after which it can no longer be read.I think best would be to call
read_text
oropen
on theimportlib.resources.abc.Traversable
and never make apathlib.Path
out of it.The text was updated successfully, but these errors were encountered: