-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
importlib.resources.files() doesn't work correctly when importlib library is compiled #123085
Comments
Did you encounter this issue in practice, or did you theorize the concern it while reviewing the code? |
…has no source. From importlib_resources 6.4.3 (python/importlib_resources#314).
I encountered it in practice |
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://redirect.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://redirect.github.com/python/importlib_resources/issues/314">#314</a> from python/<a href="https://redirect.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://redirect.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] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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://redirect.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://redirect.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://redirect.github.com/python/importlib_resources/issues/314">#314</a> from python/<a href="https://redirect.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://redirect.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] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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://redirect.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://redirect.github.com/python/importlib_resources/issues/314">#314</a> from python/<a href="https://redirect.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://redirect.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] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charles Guo <[email protected]>
Bumps [importlib-resources](https://github.com/python/importlib_resources) from 6.1.1 to 6.4.4. <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.4</h1> <p>No significant changes.</p> <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://redirect.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://redirect.github.com/python/importlib_resources/issues/303">#303</a>)</li> <li><code>python/cpython#109829</code></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/python/importlib_resources/commit/9689f8f82ca838cd58d3d0d80828785ada7798c9"><code>9689f8f</code></a> Finalize</li> <li><a href="https://github.com/python/importlib_resources/commit/f3ad28a14feb85dc2631a8e3658f090ed0b7522d"><code>f3ad28a</code></a> 🧎♀️ Genuflect to the types.</li> <li><a href="https://github.com/python/importlib_resources/commit/045dde42b16581b99539667a87d61252bf4d08ac"><code>045dde4</code></a> 🧎♀️ Genuflect to the types.</li> <li><a href="https://github.com/python/importlib_resources/commit/2fecb5e596c7b6ff2d3f98af0ac63c9f38401c5a"><code>2fecb5e</code></a> 🧎♀️ Genuflect to the types.</li> <li><a href="https://github.com/python/importlib_resources/commit/75b301c95ce3d75626c949a26e650deceba8e62c"><code>75b301c</code></a> 🧎♀️ Genuflect to the types.</li> <li><a href="https://github.com/python/importlib_resources/commit/45167451781dd8fc03e5568da40144dd8a4f790d"><code>4516745</code></a> Merge <a href="https://github.com/jaraco/skeleton">https://github.com/jaraco/skeleton</a></li> <li><a href="https://github.com/python/importlib_resources/commit/f1350e413775a9e79e20779cc9705e28a1c55900"><code>f1350e4</code></a> Add upstream and local sections for 'type' extra, since many projects will ha...</li> <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://redirect.github.com/python/importlib_resources/issues/314">#314</a> from python/<a href="https://redirect.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>Additional commits viewable in <a href="https://github.com/python/importlib_resources/compare/v6.1.1...v6.4.4">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.4)](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] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [importlib-resources](https://github.com/python/importlib_resources) from 5.13.0 to 6.4.4. <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.4</h1> <p>No significant changes.</p> <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://redirect.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://redirect.github.com/python/importlib_resources/issues/303">#303</a>)</li> <li><code>python/cpython#109829</code></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/python/importlib_resources/commit/9689f8f82ca838cd58d3d0d80828785ada7798c9"><code>9689f8f</code></a> Finalize</li> <li><a href="https://github.com/python/importlib_resources/commit/f3ad28a14feb85dc2631a8e3658f090ed0b7522d"><code>f3ad28a</code></a> 🧎♀️ Genuflect to the types.</li> <li><a href="https://github.com/python/importlib_resources/commit/045dde42b16581b99539667a87d61252bf4d08ac"><code>045dde4</code></a> 🧎♀️ Genuflect to the types.</li> <li><a href="https://github.com/python/importlib_resources/commit/2fecb5e596c7b6ff2d3f98af0ac63c9f38401c5a"><code>2fecb5e</code></a> 🧎♀️ Genuflect to the types.</li> <li><a href="https://github.com/python/importlib_resources/commit/75b301c95ce3d75626c949a26e650deceba8e62c"><code>75b301c</code></a> 🧎♀️ Genuflect to the types.</li> <li><a href="https://github.com/python/importlib_resources/commit/45167451781dd8fc03e5568da40144dd8a4f790d"><code>4516745</code></a> Merge <a href="https://github.com/jaraco/skeleton">https://github.com/jaraco/skeleton</a></li> <li><a href="https://github.com/python/importlib_resources/commit/f1350e413775a9e79e20779cc9705e28a1c55900"><code>f1350e4</code></a> Add upstream and local sections for 'type' extra, since many projects will ha...</li> <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://redirect.github.com/python/importlib_resources/issues/314">#314</a> from python/<a href="https://redirect.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>Additional commits viewable in <a href="https://github.com/python/importlib_resources/compare/v5.13.0...v6.4.4">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=5.13.0&new-version=6.4.4)](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] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jesse Claven <[email protected]>
…has no source. From importlib_resources 6.4.3 (python/importlib_resources#314).
…has no source. From importlib_resources 6.4.3 (python/importlib_resources#314).
… source (#123102) gh-123085: Fix issue in inferred caller when resources package has no source. From importlib_resources 6.4.3 (python/importlib_resources#314).
…ackage has no source (pythonGH-123102) pythongh-123085: Fix issue in inferred caller when resources package has no source. From importlib_resources 6.4.3 (python/importlib_resourcesGH-314). (cherry picked from commit a53812d) Co-authored-by: Jason R. Coombs <[email protected]>
…ckage has no source (pythonGH-123102)
Some buildbots started failing when #123102 was merged, see:
I'll probably not have to investigate this week, but, my first guess would be that shutil.copytree copied some security metadata that says “this shouldn't be in |
In the first log, I see:
The error is the same on the other buildbot. Both are Fedora, so perhaps that's a factor. It's failing on this open call: cpython/Lib/importlib/_bootstrap_external.py Lines 206 to 207 in bbb36c0
It's conceivable the copy,
while it excludes
I'm not familiar with any OS that has such behaviors. I'd not have considered it. I did read up a bit on the I don't think I'll make much more progress on this without a local reproducer. Do you think this error can be reproduced in a Docker container? In the meantime, is the buildbot breakage worth putting in a check to allow these tests to skip or xfail when they cannot write out the compiled files? |
I couldn't reproduce it locally. It might need some specific VM settings :(
First let me try an implementation that avoids the initial copy, which should be a bit faster too: #124131 |
…on (GH-124131) Co-authored-by: Jason R. Coombs <[email protected]>
…pilation (pythonGH-124131) Co-authored-by: Jason R. Coombs <[email protected]>
[//]: # (dependabot-start)⚠️ **Dependabot is rebasing this PR**⚠️ Rebasing might not happen immediately, so don't worry if this takes some time. Note: if you make any changes to this PR yourself, they will take precedence over the rebase. --- [//]: # (dependabot-end) Bumps [importlib-resources](https://github.com/python/importlib_resources) from 6.1.3 to 6.4.5. <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.5</h1> <h2>Bugfixes</h2> <ul> <li>Omit sentinel values from a namespace path. (<a href="https://redirect.github.com/python/importlib_resources/issues/311">#311</a>)</li> </ul> <h1>v6.4.4</h1> <p>No significant changes.</p> <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://redirect.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>,</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/python/importlib_resources/commit/284148b005b57031a354402c446473f53cab2c49"><code>284148b</code></a> Finalize</li> <li><a href="https://github.com/python/importlib_resources/commit/63a7bcba42e6222971edd91f49e7efffe1972f35"><code>63a7bcb</code></a> Merge pull request <a href="https://redirect.github.com/python/importlib_resources/issues/315">#315</a> from python/bugfix/311-non-path-namespace-paths</li> <li><a href="https://github.com/python/importlib_resources/commit/2c145c5b1ff95290794b2cb63e5c924e1847456d"><code>2c145c5</code></a> Omit sentinel values from a namespace path.</li> <li><a href="https://github.com/python/importlib_resources/commit/47d73b1e7787cd66ee57be676f2385d2183f78ac"><code>47d73b1</code></a> Add test capturing failure when resolving the MultiplexedPath for a namespace...</li> <li><a href="https://github.com/python/importlib_resources/commit/4875bc5179938324d157d9917b3a0bfb5fca8dd1"><code>4875bc5</code></a> Add type annotations for _candidate_paths</li> <li><a href="https://github.com/python/importlib_resources/commit/d84ca376316016420297fbc310ba181ca7d2864d"><code>d84ca37</code></a> Fix typo in _temp_path comment.</li> <li><a href="https://github.com/python/importlib_resources/commit/1a6fef299da3e0d6f74cb26e1d41fc0f13ed63ad"><code>1a6fef2</code></a> Merge <a href="https://github.com/jaraco/skeleton">https://github.com/jaraco/skeleton</a></li> <li><a href="https://github.com/python/importlib_resources/commit/790fa6e6feb9a93d39135494819b12e9df8a7bba"><code>790fa6e</code></a> Include the trailing slash in disable_error_code(overload-overlap), also requ...</li> <li><a href="https://github.com/python/importlib_resources/commit/2beb8b0c9d0f7046370e7c58c4e6baaf35154a16"><code>2beb8b0</code></a> Add support for linking usernames.</li> <li><a href="https://github.com/python/importlib_resources/commit/0c326f3f77b2420163f73d97f8fbd090fa49147d"><code>0c326f3</code></a> Add a degenerate nitpick_ignore for downstream consumers. Add a 'local' comme...</li> <li>Additional commits viewable in <a href="https://github.com/python/importlib_resources/compare/v6.1.3...v6.4.5">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.3&new-version=6.4.5)](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] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bug report
Bug description:
If
importlib
library is compiled (in particular_common.py
), then any package, that uses barefiles()
to get its resources, breaks, because_infer_caller
returns wrong frame (as mentioned in #123037 (comment),__file__
incpython/Lib/importlib/resources/_common.py
Line 96 in 35d8ac7
Reproducer:
Expectation:
data
Actual outcome:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpngnuw441/cimportlib/resources/resource.txt'
It may be important for frozen python applications, as they don't include source code
CPython versions tested on:
3.12, CPython main branch
Operating systems tested on:
Linux, Windows
Linked PRs
The text was updated successfully, but these errors were encountered: