Title: files(...).joinpath doesn't accept variable number of arguments in Python 3.10+ · Issue #257 · python/importlib_resources · GitHub
Open Graph Title: files(...).joinpath doesn't accept variable number of arguments in Python 3.10+ · Issue #257 · python/importlib_resources
X Title: files(...).joinpath doesn't accept variable number of arguments in Python 3.10+ · Issue #257 · python/importlib_resources
Description: This happens to me when I try to access resources in a native namespace package. Tested on: Windows, Python 3.10.4 Docker in WSL2, image python:3.10-slim, Python 3.10.5 The reason seems to be that importlib_resources.files() returns Mult...
Open Graph Description: This happens to me when I try to access resources in a native namespace package. Tested on: Windows, Python 3.10.4 Docker in WSL2, image python:3.10-slim, Python 3.10.5 The reason seems to be that ...
X Description: This happens to me when I try to access resources in a native namespace package. Tested on: Windows, Python 3.10.4 Docker in WSL2, image python:3.10-slim, Python 3.10.5 The reason seems to be that ...
Opengraph URL: https://github.com/python/importlib_resources/issues/257
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"files(...).joinpath doesn't accept variable number of arguments in Python 3.10+","articleBody":"This happens to me when I try to access resources in a native namespace package.\r\n\r\nTested on:\r\n- Windows, `Python 3.10.4`\r\n- Docker in WSL2, image `python:3.10-slim`, `Python 3.10.5`\r\n\r\n---\r\n\r\nThe reason seems to be that `importlib_resources.files()` returns `MultiplexedPath` from stdlib (`importlib.readers`) rather than from `importlib_resources.readers`.\r\n\r\nTo recreate:\r\n1. Install any namespace package, e.g. `sphinxcontrib-htmlhelp`;\r\n ```\r\n pip install sphinxcontrib-htmlhelp\r\n ```\r\n\r\n1. Use `files` with `joinpath` to get the path of a resource.\r\n ```python\r\n from importlib_resources import files\r\n\r\n print(root:=files('sphinxcontrib'), 'from', root.__module__)\r\n print(root.joinpath('htmlhelp', 'templates'))\r\n ```\r\n\r\nExpected output (which I get with Pythons 3.7-3.9):\r\n```\r\nMultiplexedPath('/usr/local/lib/python3.9/site-packages/sphinxcontrib') from importlib_resources.readers\r\n/usr/local/lib/python3.9/site-packages/sphinxcontrib/htmlhelp/templates\r\n```\r\n\r\nBug with Pythons 3.10:\r\n```\r\nMultiplexedPath('/usr/local/lib/python3.10/site-packages/sphinxcontrib') from importlib.readers\r\nTraceback (most recent call last):\r\n File \"\u003cstring>\", line 1, in \u003cmodule>\r\nTypeError: MultiplexedPath.joinpath() takes 2 positional arguments but 3 were given\r\n```\r\n\r\nI also tested with the code in #254 but to no aval.","author":{"url":"https://github.com/Jakub-CZ","@type":"Person","name":"Jakub-CZ"},"datePublished":"2022-07-12T15:30:25Z","url":"https://github.com/python/importlib_resources/issues/257"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:886ea655-2a4d-61ac-3a67-8d9d8da129ef |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9128:2463C6:F13FFD:143DD5B:6B005B4F |
| html-safe-nonce | 5e4065e2bba01132d3b15589d36be4037cc04544a232982349b8a72a32117b02 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MTI4OjI0NjNDNjpGMTNGRkQ6MTQzREQ1Qjo2QjAwNUI0RiIsInZpc2l0b3JfaWQiOiI0MTUzOTA4MDg5NTk2MzgzNTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a691310bd0382bb85cba9c8ed48adff058f05f66b036db1d6596c38924aa3449 |
| hovercard-subject-tag | issue:1302227080 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/importlib_resources/257/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6665d612a0ab761ea76a3ecf0e3c1e1bdd03a7d0fa6d4066b9384750c6ad06a7/python/importlib_resources/issues/257 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6665d612a0ab761ea76a3ecf0e3c1e1bdd03a7d0fa6d4066b9384750c6ad06a7/python/importlib_resources/issues/257 |
| og:image:alt | This happens to me when I try to access resources in a native namespace package. Tested on: Windows, Python 3.10.4 Docker in WSL2, image python:3.10-slim, Python 3.10.5 The reason seems to be that ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Jakub-CZ |
| hostname | github.com |
| expected-hostname | github.com |
| None | 29be975efff6507a5d135de9c7d634cf7ff8f0c55222a64386ab3202209aaf73 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/importlib_resources git https://github.com/python/importlib_resources.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 306147182 |
| octolytics-dimension-repository_nwo | python/importlib_resources |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 306147182 |
| octolytics-dimension-repository_network_root_nwo | python/importlib_resources |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | eacd927ba6112e3b01ba99c762bd699a4a4f5df7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width