question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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.

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:closed
  • Created 2 years ago
  • Comments:16 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
kayhayencommented, Sep 4, 2022

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.

1reaction
kayhayencommented, Mar 11, 2022

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. The files will be added once I finally get tests with open_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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found