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

Can't open orphan path on bare importlib.resources.files() under zipapp #121735

Open
winstontsai opened this issue Jul 14, 2024 · 15 comments
Open
Assignees
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@winstontsai
Copy link

winstontsai commented Jul 14, 2024

Bug report

Bug description:

Context: In Python 3.12 the function importlib.resources.files() was updated: https://docs.python.org/3/library/importlib.resources.html#importlib.resources.files

Changed in version 3.12: package parameter was renamed to anchor. anchor can now be a non-package module and if omitted will default to the caller’s module. package is still accepted for compatibility but will raise a DeprecationWarning. Consider passing the anchor positionally or using importlib_resources >= 5.10 for a compatible interface on older Pythons.

The Issue: When using importlib.resources.files(), I am able to open and read a text file included as package data in my package. However, if I zip up my package with zipapp and run the .pyz file, it is unable to read the text file.
If I use importlib.resources.files("mypkg") it will work in both cases.

Minimal example:

Create a project directory named mypkg with the src layout.

Create the following files.

mypkg/src/mypkg/a.py

import importlib.resources

def main():
    x = importlib.resources.files() / "data.txt"
    print(x.read_text())

mypkg/src/mypkg/data.txt

datadata

In pyproject.toml make sure to set up the entry script and include the data file.

mypkg/pyproject.toml

[project.scripts]
myscript = "mypkg.a:main"

[tool.setuptools.package-data]
mypkg = ["*.txt"]

Install the package into a fresh Python (virtual) environment with pip.
Run myscript and verify it prints datadata.

Now back in the mypkg project root folder, we will generate a .pyz file with zipapp and run the program from the .pyz file.

Run pip install . --target buildtemp --upgrade && python3 -m zipapp buildtemp --main mypkg.a:main -p '/usr/bin/env python3' -o mypkg.pyz in the terminal.

Run ./mypkg.pyz. This results in an error:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/win/code/sandbox/python/mypkg/./mypkg.pyz/__main__.py", line 3, in <module>
  File "/home/win/code/sandbox/python/mypkg/./mypkg.pyz/mypkg/a.py", line 6, in main
  File "/home/win/.local/share/mise/installs/python/3.12.4/lib/python3.12/importlib/resources/abc.py", line 89, in read_text
    with self.open(encoding=encoding) as strm:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/win/.local/share/mise/installs/python/3.12.4/lib/python3.12/importlib/resources/_adapters.py", line 139, in open
    raise FileNotFoundError("Can't open orphan path")
FileNotFoundError: Can't open orphan path

Note that if you change x = importlib.resources.files() / "data.txt" to x = importlib.resources.files("mypkg") / "data.txt", it will work when running the .pyz file.

CPython versions tested on:

3.12

Operating systems tested on:

Linux, macOS

Linked PRs

@winstontsai winstontsai added the type-bug An unexpected behavior, bug, or error label Jul 14, 2024
Gatsik added a commit to Gatsik/client that referenced this issue Aug 4, 2024
this version was in the recent 0.21.0 release and worked fine

the irc library is broken (for us) since jaraco/irc@c95c063
the reason is that it uses importlib.resources.files() to import codes
and this function is buggy -- it doesn't work with freezed code
(see also python/cpython#121735. wimglenn/resources-example#6)
and (what a coincidence!) broken implementation of files() function was written
by the same person -- see python/cpython#100598
@wimglenn
Copy link
Contributor

wimglenn commented Aug 14, 2024

ping @jaraco in case you missed this one

@jaraco
Copy link
Member

jaraco commented Aug 14, 2024

The code that handles the module inference is here:

@functools.singledispatch
def resolve(cand: Optional[Anchor]) -> types.ModuleType:
return cast(types.ModuleType, cand)
@resolve.register
def _(cand: str) -> types.ModuleType:
return importlib.import_module(cand)
@resolve.register
def _(cand: None) -> types.ModuleType:
return resolve(_infer_caller().f_globals['__name__'])
def _infer_caller():
"""
Walk the stack and find the frame of the first caller not in this module.
"""
def is_this_file(frame_info):
return frame_info.filename == __file__
def is_wrapper(frame_info):
return frame_info.function == 'wrapper'
not_this_file = itertools.filterfalse(is_this_file, inspect.stack())
# also exclude 'wrapper' due to singledispatch in the call stack
callers = itertools.filterfalse(is_wrapper, not_this_file)
return next(callers).frame

Next step is to determine what expectation is missed when running under zipapp.

@jaraco jaraco changed the title Cannot read package data file after opening with importlib.resources.files(anchor) and running with zipapp Can't open orphan path on bare importlib.resources.files() under zipapp Aug 14, 2024
@jaraco
Copy link
Member

jaraco commented Aug 14, 2024

I was able to replicate the issue without going through the wheel build process:

 draft 🐚 mkdir -p buildtemp/mypkg
 draft 🐚 cat > buildtemp/mypkg/a.py
import importlib.resources


def main():
    x = importlib.resources.files() / "data.txt"
    print(x.read_text())
 draft 🐚 echo datadata > buildtemp/mypkg/data.txt
 draft 🐚 py -m zipapp buildtemp --main mypkg.a:main -p '/usr/bin/env py' -o mypkg.pyz
 draft 🐚 ./mypkg.pyz
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/jaraco/draft/./mypkg.pyz/__main__.py", line 3, in <module>
    mypkg.a.main()
    ~~~~~~~~~~~~^^
  File "/Users/jaraco/draft/./mypkg.pyz/mypkg/a.py", line 6, in main
    print(x.read_text())
          ~~~~~~~~~~~^^
  File "/opt/python/lib/python3.13/importlib/resources/abc.py", line 89, in read_text
    with self.open(encoding=encoding) as strm:
         ~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "/opt/python/lib/python3.13/importlib/resources/_adapters.py", line 139, in open
    raise FileNotFoundError("Can't open orphan path")
FileNotFoundError: Can't open orphan path

@jaraco
Copy link
Member

jaraco commented Aug 14, 2024

The issue is that CompatibilityFiles is being activated for loading resources.

 draft 🐚 py -m pdb mypkg.pyz
> /Users/jaraco/draft/mypkg.pyz/__main__.py(2)<module>()
-> import mypkg.a
(Pdb) c
Traceback (most recent call last):
  File "/opt/python/lib/python3.13/pdb.py", line 2435, in main
    pdb._run(target)
    ~~~~~~~~^^^^^^^^
  File "/opt/python/lib/python3.13/pdb.py", line 2192, in _run
    self.run(target.code)
    ~~~~~~~~^^^^^^^^^^^^^
  File "/opt/python/lib/python3.13/bdb.py", line 651, in run
    exec(cmd, globals, locals)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jaraco/draft/mypkg.pyz/__main__.py", line 3, in <module>
    mypkg.a.main()
    ~~~~~~~~~~~~^^
  File "/Users/jaraco/draft/mypkg.pyz/mypkg/a.py", line 6, in main
    print(x.read_text())
          ~~~~~~~~~~~^^
  File "/opt/python/lib/python3.13/importlib/resources/abc.py", line 89, in read_text
    with self.open(encoding=encoding) as strm:
         ~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "/opt/python/lib/python3.13/importlib/resources/_adapters.py", line 139, in open
    raise FileNotFoundError("Can't open orphan path")
FileNotFoundError: Can't open orphan path
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
> /opt/python/lib/python3.13/importlib/resources/_adapters.py(139)open()
-> raise FileNotFoundError("Can't open orphan path")
(Pdb) u
> /opt/python/lib/python3.13/importlib/resources/abc.py(89)read_text()
-> with self.open(encoding=encoding) as strm:
(Pdb) u
> /Users/jaraco/draft/mypkg.pyz/mypkg/a.py(6)main()
-> print(x.read_text())
(Pdb) x
<importlib.resources._adapters.CompatibilityFiles.OrphanPath object at 0x41f4c584f90>

CompatibilityFiles gets employed when there's no proper resource provider found. I'll figure out why.

@jaraco jaraco self-assigned this Aug 14, 2024
@jaraco
Copy link
Member

jaraco commented Aug 14, 2024

It's clear that the bare call to files() is getting CompatibiltyFiles when the call with an anchor returns a proper MultiplexedPath:

(Pdb) importlib.resources.files()
<importlib.resources._adapters.CompatibilityFiles.SpecPath object at 0x41f4c595a10>
(Pdb) importlib.resources.files('mypkg')
MultiplexedPath('/Users/jaraco/draft/mypkg.pyz/mypkg/')

By changing the main() function to emit the inferred caller's name,

def main():
    print(importlib.resources._common._infer_caller().f_globals['__name__'])

I can confirm that the inferred name is correct when it emits mypkg.a.

Interestingly, if I then replace the main function with a static 'mypkg.a', the reported error occurs.

def main():
    x = importlib.resources.files('mypkg.a') / "data.txt"
    print(x.read_text())

So the issue seems to be that files('mypkg') works as expected but files('mypkg.a') does not, and it's only coincidental that files() calls files('mypkg.a').

importlib.resources has a behavior that when given a module will resolve resources in the package of that module.

It seems that the zipimporter as attached to the module is not resolving a resource reader:

(Pdb) importlib.import_module('mypkg.a').__spec__.loader.get_resource_reader('mypkg.a')
(Pdb) importlib.import_module('mypkg.a').__spec__.loader.get_resource_reader('mypkg')
(Pdb) importlib.import_module('mypkg').__spec__.loader.get_resource_reader('mypkg')
<importlib.resources.readers.NamespaceReader object at 0x3df2e585410>

I'm slightly surprised to see NamespaceReader and not a ZipReader.

@jaraco
Copy link
Member

jaraco commented Aug 14, 2024

It seems the issue traces to the logic in get_resource_reader:

cpython/Lib/zipimport.py

Lines 258 to 270 in 6ae942f

def get_resource_reader(self, fullname):
"""Return the ResourceReader for a package in a zip file.
If 'fullname' is a package within the zip file, return the
'ResourceReader' object for the package. Otherwise return None.
"""
try:
if not self.is_package(fullname):
return None
except ZipImportError:
return None
from importlib.readers import ZipReader
return ZipReader(self, fullname)

When checking loader.is_package for mypkg.a, it returns False:

(Pdb) loader = importlib.import_module('mypkg.a').__spec__.loader
(Pdb) loader.is_package('mypkg.a')
False

In the early days of importlib.resources, all resources needed to be relative to a package (and not a module). Later, that restriction was relaxed to allow resources to be loaded relative to a module.

But it seems that get_resource_reader didn't get the corresponding treatment.

I've confirmed the same issue occurs when using importlib_resources:

 draft [1] 🐚 cat buildtemp/mypkg/a.py
import importlib_resources


def main():
    x = importlib_resources.files('mypkg.a') / "data.txt"
    print(x.read_text())
 draft 🐚 pip install -t buildtemp importlib_resources
Collecting importlib_resources
  Using cached importlib_resources-6.4.0-py3-none-any.whl.metadata (3.9 kB)
Using cached importlib_resources-6.4.0-py3-none-any.whl (38 kB)
Installing collected packages: importlib_resources
Successfully installed importlib_resources-6.4.0
 draft 🐚 py -m zipapp buildtemp --main mypkg.a:main -p '/usr/bin/env py' -o mypkg.pyz
 draft 🐚 ./mypkg.pyz
Traceback (most recent call last):
...
FileNotFoundError: /Users/jaraco/draft/./mypkg.pyz/mypkg/a/data.txt

I suspect the resolution is going to be update get_resource_reader to accept a module.

But first things first, let's figure out why this use-case isn't covered by the tests.

@jaraco
Copy link
Member

jaraco commented Aug 14, 2024

As a check, if I remove the is_package check:

 cpython main 🐚 git diff
diff --git a/Lib/zipimport.py b/Lib/zipimport.py
index f2724dd0268..c0a4abcd95d 100644
--- a/Lib/zipimport.py
+++ b/Lib/zipimport.py
@@ -256,16 +256,8 @@ def load_module(self, fullname):
 
 
     def get_resource_reader(self, fullname):
-        """Return the ResourceReader for a package in a zip file.
-
-        If 'fullname' is a package within the zip file, return the
-        'ResourceReader' object for the package.  Otherwise return None.
+        """Return the ResourceReader for a module in a zip file.
         """
-        try:
-            if not self.is_package(fullname):
-                return None
-        except ZipImportError:
-            return None
         from importlib.readers import ZipReader
         return ZipReader(self, fullname)

The routine then fails, but with a different error:

 draft 🐚 ./mypkg.pyz
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/jaraco/draft/./mypkg.pyz/__main__.py", line 3, in <module>
    mypkg.a.main()
    ~~~~~~~~~~~~^^
  File "/Users/jaraco/draft/./mypkg.pyz/mypkg/a.py", line 6, in main
    print(x.read_text())
          ~~~~~~~~~~~^^
  File "/Users/jaraco/code/python/cpython/Lib/zipfile/_path/__init__.py", line 426, in read_text
    with self.open('r', encoding, *args, **kwargs) as strm:
         ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jaraco/code/python/cpython/Lib/zipfile/_path/__init__.py", line 391, in open
    raise FileNotFoundError(self)
FileNotFoundError: /Users/jaraco/draft/./mypkg.pyz/mypkg/a/data.txt

That's encouraging, suggesting that the ZipReader is getting involved, but that it still doesn't honor resources adjacent to modules.

@jaraco
Copy link
Member

jaraco commented Aug 14, 2024

I started working on a test, seeking to extend these tests to zip files, but realized that the current test structure isn't easily amenable to extension to zip. In python/importlib_resources@3faf336, I've done some refactoring in order to leverage the zip fixtures for this purpose.

jaraco added a commit to python/importlib_resources that referenced this issue Aug 14, 2024
Module files zip tests is marked as xfail due to the issue reported in python/cpython#121735.
jaraco added a commit to python/importlib_resources that referenced this issue Aug 14, 2024
Module files zip tests is marked as xfail due to the issue reported in python/cpython#121735.
@jaraco jaraco reopened this Aug 14, 2024
@jaraco
Copy link
Member

jaraco commented Aug 14, 2024

I'm releasing importlib_resources 6.4.1 with a fix, but that fix obviously only applies to the backport. We'll need to apply those changes to CPython as well, likely with the aforementioned diff to zipimport.

@wimglenn
Copy link
Contributor

wimglenn commented Aug 14, 2024

Quick turnaround, thank you. If I understand devguide correctly, miss-islington should presumably backport the CPython change into 3.12.x as bugfix (but not any earlier versions)?

@jaraco
Copy link
Member

jaraco commented Aug 14, 2024

That's right. And I think it was 3.12 that introduced this feature, so there shouldn't be any users of earlier versions expecting anything different.

jaraco added a commit to jaraco/cpython that referenced this issue Aug 15, 2024
@jaraco
Copy link
Member

jaraco commented Aug 15, 2024

I've nearly got the feature ported, but there's a failure in one of the new tests (ImplicitContextFileZipTests.test_implicit_files_submodule):

test test_importlib failed -- Traceback (most recent call last):
  File "/Users/jaraco/code/python/cpython/Lib/test/test_importlib/resources/test_files.py", line 123, in test_implicit_files_submodule
    assert importlib.import_module('somepkg.submod').val == 'resources are the best'
           ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/Users/jaraco/code/python/cpython/Lib/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1386, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1359, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1330, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 752, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/private/var/folders/f2/2plv6q2n7l932m2x004jlw340000gn/T/tmpjcv3yk54/zipped modules.zip/somepkg/submod.py", line 3, in <module>
    val = res.files().joinpath('res.txt').read_text(encoding='utf-8')
  File "/Users/jaraco/code/python/cpython/Lib/zipfile/_path/__init__.py", line 426, in read_text
    with self.open('r', encoding, *args, **kwargs) as strm:
         ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jaraco/code/python/cpython/Lib/zipfile/_path/__init__.py", line 391, in open
    raise FileNotFoundError(self)
FileNotFoundError: /private/var/folders/f2/2plv6q2n7l932m2x004jlw340000gn/T/tmpjcv3yk54/zipped modules.zip/somepkg/submod/res.txt

Somehow the submod is being included in the path (even though that doesn't happen in importlib_resources.

@jaraco
Copy link
Member

jaraco commented Aug 15, 2024

But when I inspect the reader directly, everything looks fine:

> /Users/jaraco/code/python/cpython/Lib/test/test_importlib/resources/test_files.py(123)test_implicit_files_submodule()
-> breakpoint()
(Pdb) import somepkg.submod
(Pdb) somepkg.submod.__spec__.loader
<zipimporter object "/private/var/folders/f2/2plv6q2n7l932m2x004jlw340000gn/T/tmpxzp59s01/zipped modules.zip/somepkg/">
(Pdb) somepkg.submod.__spec__.loader.get_resource_reader('somepkg.submod')
<importlib.resources.readers.ZipReader object at 0x10443c1a0>
(Pdb) reader = somepkg.submod.__spec__.loader.get_resource_reader('somepkg.submod')
(Pdb) reader.prefix
'somepkg/'
(Pdb) reader.files()
Path('/private/var/folders/f2/2plv6q2n7l932m2x004jlw340000gn/T/tmpxzp59s01/zipped modules.zip', 'somepkg/')
(Pdb) from importlib.resources._adapters import wrap_spec
(Pdb) spec = wrap_spec(somepkg.submod)
(Pdb) spec
<importlib.resources._adapters.SpecLoaderAdapter object at 0x10443c1a0>
(Pdb) spec.loader.get_resource_reader(spec.name)
<importlib.resources.readers.ZipReader object at 0x104382210>
(Pdb) reader = spec.loader.get_resource_reader(spec.name)
(Pdb) reader.prefix
'somepkg/'
(Pdb) reader.files()
Path('/private/var/folders/f2/2plv6q2n7l932m2x004jlw340000gn/T/tmpxzp59s01/zipped modules.zip', 'somepkg/')
(Pdb) reader.files().joinpath('res.txt').read_text()
'resources are the best'

So I'm stumped as to why the same call fails from somepkg.submod.

@jaraco
Copy link
Member

jaraco commented Aug 15, 2024

I think I found the issue - a lingering importlib_resources reference.

@jaraco
Copy link
Member

jaraco commented Aug 15, 2024

Yes, that's all it was (whew!).

jaraco added a commit to jaraco/cpython that referenced this issue Aug 15, 2024
Gatsik added a commit to Gatsik/cpython that referenced this issue Aug 16, 2024
Gatsik added a commit to Gatsik/cpython that referenced this issue Aug 16, 2024
@picnixz picnixz added the stdlib Python modules in the Lib dir label Aug 17, 2024
kai687 pushed a commit to kai687/sphinxawesome-theme that referenced this issue Aug 19, 2024
Bumps
[importlib-resources](https://github.com/python/importlib_resources)
from 6.4.0 to 6.4.3.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/python/importlib_resources/blob/main/NEWS.rst">importlib-resources's
changelog</a>.</em></p>
<blockquote>
<h1>v6.4.3</h1>
<h2>Bugfixes</h2>
<ul>
<li>When inferring the caller in
<code>files()</code><code>python/cpython#123085</code></li>
</ul>
<h1>v6.4.2</h1>
<h2>Bugfixes</h2>
<ul>
<li>Merged fix for UTF-16 BOM handling in functional tests. (<a
href="https://github.com/python/importlib_resources/issues/312">#312</a>)</li>
</ul>
<h1>v6.4.1</h1>
<h2>Bugfixes</h2>
<ul>
<li><code>python/cpython#121735</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/python/importlib_resources/commit/d02141768b62468e46064614276036ea5c746056"><code>d021417</code></a>
Finalize</li>
<li><a
href="https://github.com/python/importlib_resources/commit/0ecbc3b374ae84ae10ded5e1ad1d8775e12c2dd7"><code>0ecbc3b</code></a>
Merge pull request <a
href="https://github.com/python/importlib_resources/issues/314">#314</a>
from python/<a
href="https://github.com/python/importlib_resources/issues/123085">gh-123085</a>/inferred-compiled</li>
<li><a
href="https://github.com/python/importlib_resources/commit/79fa62f4b5cbf8f358560651a714b282aee2226c"><code>79fa62f</code></a>
Add docstring and reference to the issue.</li>
<li><a
href="https://github.com/python/importlib_resources/commit/90c0e420ef15256f116342c97ea984a2fa604cc3"><code>90c0e42</code></a>
Rely on <code>resources.__name__</code> for easier portability.</li>
<li><a
href="https://github.com/python/importlib_resources/commit/d618902dbe0e9f94e634a95bc9bbaf941236fc0c"><code>d618902</code></a>
Add news fragment.</li>
<li><a
href="https://github.com/python/importlib_resources/commit/ebc5b97ffe1d20eb6ebc536dd1f6b385f83652a5"><code>ebc5b97</code></a>
Extract the filename from the topmost frame of the stack.</li>
<li><a
href="https://github.com/python/importlib_resources/commit/4ea81bf920f6cc6377ccc7fbc1f4f343927f4f20"><code>4ea81bf</code></a>
Extract a function for computing 'this filename' once.</li>
<li><a
href="https://github.com/python/importlib_resources/commit/cba8dce7839977c66806ef05e122cf38ed14a113"><code>cba8dce</code></a>
Adapt changes for new fixtures.</li>
<li><a
href="https://github.com/python/importlib_resources/commit/198adec064edf0c10aac45ab85c68535ba038a59"><code>198adec</code></a>
<a
href="https://github.com/python/importlib_resources/issues/121735">gh-121735</a>:
Fix inferring caller when resolving importlib.resources.files()</li>
<li><a
href="https://github.com/python/importlib_resources/commit/21afd614ce6976b43185a0931f988ea81862eb8d"><code>21afd61</code></a>
Merge changes to syncronize the 6.4 release with downstream CPython
changes.</li>
<li>Additional commits viewable in <a
href="https://github.com/python/importlib_resources/compare/v6.4.0...v6.4.3">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=importlib-resources&package-manager=pip&previous-version=6.4.0&new-version=6.4.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
github-actions bot pushed a commit to aio-libs/aiohttp that referenced this issue Aug 21, 2024
Bumps
[importlib-resources](https://github.com/python/importlib_resources)
from 6.1.1 to 6.4.3.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/python/importlib_resources/blob/main/NEWS.rst">importlib-resources's
changelog</a>.</em></p>
<blockquote>
<h1>v6.4.3</h1>
<h2>Bugfixes</h2>
<ul>
<li>When inferring the caller in
<code>files()</code><code>python/cpython#123085</code></li>
</ul>
<h1>v6.4.2</h1>
<h2>Bugfixes</h2>
<ul>
<li>Merged fix for UTF-16 BOM handling in functional tests. (<a
href="https://github.com/python/importlib_resources/issues/312">#312</a>)</li>
</ul>
<h1>v6.4.1</h1>
<h2>Bugfixes</h2>
<ul>
<li><code>python/cpython#121735</code></li>
</ul>
<h1>v6.4.0</h1>
<h2>Features</h2>
<ul>
<li>The functions
<code>is_resource()</code>,
<code>open_binary()</code>,
<code>open_text()</code>,
<code>path()</code>,
<code>read_binary()</code>, and
<code>read_text()</code> are un-deprecated, and support
subdirectories via multiple positional arguments.
The <code>contents()</code> function also allows subdirectories,
but remains deprecated. (<a
href="https://github.com/python/importlib_resources/issues/303">#303</a>)</li>
<li><code>python/cpython#109829</code></li>
</ul>
<h1>v6.3.2</h1>
<p>Bugfixes</p>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/python/importlib_resources/commit/d02141768b62468e46064614276036ea5c746056"><code>d021417</code></a>
Finalize</li>
<li><a
href="https://github.com/python/importlib_resources/commit/0ecbc3b374ae84ae10ded5e1ad1d8775e12c2dd7"><code>0ecbc3b</code></a>
Merge pull request <a
href="https://github.com/python/importlib_resources/issues/314">#314</a>
from python/<a
href="https://github.com/python/importlib_resources/issues/123085">gh-123085</a>/inferred-compiled</li>
<li><a
href="https://github.com/python/importlib_resources/commit/79fa62f4b5cbf8f358560651a714b282aee2226c"><code>79fa62f</code></a>
Add docstring and reference to the issue.</li>
<li><a
href="https://github.com/python/importlib_resources/commit/90c0e420ef15256f116342c97ea984a2fa604cc3"><code>90c0e42</code></a>
Rely on <code>resources.__name__</code> for easier portability.</li>
<li><a
href="https://github.com/python/importlib_resources/commit/d618902dbe0e9f94e634a95bc9bbaf941236fc0c"><code>d618902</code></a>
Add news fragment.</li>
<li><a
href="https://github.com/python/importlib_resources/commit/ebc5b97ffe1d20eb6ebc536dd1f6b385f83652a5"><code>ebc5b97</code></a>
Extract the filename from the topmost frame of the stack.</li>
<li><a
href="https://github.com/python/importlib_resources/commit/4ea81bf920f6cc6377ccc7fbc1f4f343927f4f20"><code>4ea81bf</code></a>
Extract a function for computing 'this filename' once.</li>
<li><a
href="https://github.com/python/importlib_resources/commit/cba8dce7839977c66806ef05e122cf38ed14a113"><code>cba8dce</code></a>
Adapt changes for new fixtures.</li>
<li><a
href="https://github.com/python/importlib_resources/commit/198adec064edf0c10aac45ab85c68535ba038a59"><code>198adec</code></a>
<a
href="https://github.com/python/importlib_resources/issues/121735">gh-121735</a>:
Fix inferring caller when resolving importlib.resources.files()</li>
<li><a
href="https://github.com/python/importlib_resources/commit/21afd614ce6976b43185a0931f988ea81862eb8d"><code>21afd61</code></a>
Merge changes to syncronize the 6.4 release with downstream CPython
changes.</li>
<li>Additional commits viewable in <a
href="https://github.com/python/importlib_resources/compare/v6.1.1...v6.4.3">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=importlib-resources&package-manager=pip&previous-version=6.1.1&new-version=6.4.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
shaldengeki added a commit to shaldengeki/monorepo that referenced this issue Aug 22, 2024
Bumps
[importlib-resources](https://github.com/python/importlib_resources)
from 6.4.0 to 6.4.3.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/python/importlib_resources/blob/main/NEWS.rst">importlib-resources's
changelog</a>.</em></p>
<blockquote>
<h1>v6.4.3</h1>
<h2>Bugfixes</h2>
<ul>
<li>When inferring the caller in
<code>files()</code><code>python/cpython#123085</code></li>
</ul>
<h1>v6.4.2</h1>
<h2>Bugfixes</h2>
<ul>
<li>Merged fix for UTF-16 BOM handling in functional tests. (<a
href="https://github.com/python/importlib_resources/issues/312">#312</a>)</li>
</ul>
<h1>v6.4.1</h1>
<h2>Bugfixes</h2>
<ul>
<li><code>python/cpython#121735</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/python/importlib_resources/commit/d02141768b62468e46064614276036ea5c746056"><code>d021417</code></a>
Finalize</li>
<li><a
href="https://github.com/python/importlib_resources/commit/0ecbc3b374ae84ae10ded5e1ad1d8775e12c2dd7"><code>0ecbc3b</code></a>
Merge pull request <a
href="https://github.com/python/importlib_resources/issues/314">#314</a>
from python/<a
href="https://github.com/python/importlib_resources/issues/123085">gh-123085</a>/inferred-compiled</li>
<li><a
href="https://github.com/python/importlib_resources/commit/79fa62f4b5cbf8f358560651a714b282aee2226c"><code>79fa62f</code></a>
Add docstring and reference to the issue.</li>
<li><a
href="https://github.com/python/importlib_resources/commit/90c0e420ef15256f116342c97ea984a2fa604cc3"><code>90c0e42</code></a>
Rely on <code>resources.__name__</code> for easier portability.</li>
<li><a
href="https://github.com/python/importlib_resources/commit/d618902dbe0e9f94e634a95bc9bbaf941236fc0c"><code>d618902</code></a>
Add news fragment.</li>
<li><a
href="https://github.com/python/importlib_resources/commit/ebc5b97ffe1d20eb6ebc536dd1f6b385f83652a5"><code>ebc5b97</code></a>
Extract the filename from the topmost frame of the stack.</li>
<li><a
href="https://github.com/python/importlib_resources/commit/4ea81bf920f6cc6377ccc7fbc1f4f343927f4f20"><code>4ea81bf</code></a>
Extract a function for computing 'this filename' once.</li>
<li><a
href="https://github.com/python/importlib_resources/commit/cba8dce7839977c66806ef05e122cf38ed14a113"><code>cba8dce</code></a>
Adapt changes for new fixtures.</li>
<li><a
href="https://github.com/python/importlib_resources/commit/198adec064edf0c10aac45ab85c68535ba038a59"><code>198adec</code></a>
<a
href="https://github.com/python/importlib_resources/issues/121735">gh-121735</a>:
Fix inferring caller when resolving importlib.resources.files()</li>
<li><a
href="https://github.com/python/importlib_resources/commit/21afd614ce6976b43185a0931f988ea81862eb8d"><code>21afd61</code></a>
Merge changes to syncronize the 6.4 release with downstream CPython
changes.</li>
<li>Additional commits viewable in <a
href="https://github.com/python/importlib_resources/compare/v6.4.0...v6.4.3">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=importlib-resources&package-manager=pip&previous-version=6.4.0&new-version=6.4.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Charles Guo <shaldengeki@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

4 participants