importlib.resources.files do not work with Python 3.10 and standalone
See original GitHub issue-
Nuitka version, full Python version, flavor, OS, etc. as output by this command (it does more than you think, and we are adding more all the time):
python -m nuitka --version
0.8rc3
Commercial: None
Python: 3.10.2 (main, Jan 16 2022, 17:11:27) [GCC 11.2.0]
Flavor: Debian Python
Executable: /tmp/venv/bin/python
OS: Linux
Arch: x86_64
Distribution: Debian (based on None) None
- How did you install Nuitka and Python
git clone
of the develop
branch and install via pip
into an venv
.
- Also supply a Short, Self Contained, Correct, Example
Building the following foo.py
via python -m nuitka --standalone foo.py
from importlib.resources import files
import nuitka
print(files('nuitka'))
Running /tmp/foo.dist/foo
produces the following output:
<importlib._adapters.DegenerateFiles.Path object at 0x7f8005ff2980>
but I was expecting
/tmp/foo.dist/nuitka
which it does if the same code is compiled with Python 3.9.
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (12 by maintainers)
Top Results From Across the Web
importlib.resources
This module leverages Python's import system to provide access to resources within packages. If you can import a package, you can access resources...
Read more >importlib-resources
importlib_resources is a backport of Python standard library importlib.resources module for older Pythons. The key goal of this module is to replace parts ......
Read more >Using importlib_resources - Read the Docs
importlib_resources is a library that leverages Python's import system to provide ... Resources and packages do not have to exist as physical files...
Read more >What's New in Python 3.9 - Library Changes - Andy Pearce
A new importlib.resources.files() function has also been added which allows access to resources stored in nested containers. It returns a ...
Read more >Absolute vs Relative Imports in Python
If you've worked on a Python project that has more than one file, chances are you've had to use an import statement before....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is working on develop right now and will be in 1.1 release, iteration methods may not be working fully yet though, but access, tests, etc. should be all fine.
Ah, yes
sid
, I didn’t have any of that yet. I think, using/sid
will allow me to detect that. The “based on” output, is another thing, looks silly for Debian proper. Thanks. Thefiles
will be added once I finally get tests withopen_resource
usage to pass. Once I have something to point you to, I would appreciate if you can see it saying “Sid” for version as well.