We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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 docs
as_file
cleans up any temporary file or directory created when the resource was extracted from e.g. a zip file.
So 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.
importlib.resources
I think best would be to call read_text or open on the importlib.resources.abc.Traversable and never make a pathlib.Path out of it.
read_text
open
importlib.resources.abc.Traversable
pathlib.Path
The text was updated successfully, but these errors were encountered:
I confirmed this is an issue, by importing and running the package as shown here https://docs.python.org/3/library/zipimport.html#examples
Sorry, something went wrong.
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 .whl as the zip file and add that to PYTHONPATH:
.whl
PYTHONPATH
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 main branch with
main
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmp5yun71gaemojis.json'
Successfully merging a pull request may close this issue.
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: