Title: `dir1/file.txt' must be only a file name · Issue #104 · python/importlib_resources · GitHub
Open Graph Title: `dir1/file.txt' must be only a file name · Issue #104 · python/importlib_resources
X Title: `dir1/file.txt' must be only a file name · Issue #104 · python/importlib_resources
Description: Backport of the importlib.resources module. Contribute to python/importlib_resources development by creating an account on GitHub.
Open Graph Description: Backport of the importlib.resources module. Contribute to python/importlib_resources development by creating an account on GitHub.
X Description: Backport of the importlib.resources module. Contribute to python/importlib_resources development by creating an account on GitHub.
Opengraph URL: https://github.com/python/importlib_resources
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`dir1/file.txt' must be only a file name","articleBody":"In GitLab by @omry3 on Jun 24, 2020, 22:59\n\n\nFrom https://importlib-resources.readthedocs.io/en/latest/:\n\"In our terminology, a resource is a file tree that is located within an importable Python package.\"\n\nBecause this is talking about a file tree, I would expect to be able to check for resources in sub directories inside the importable Python package.\nThis does not seem to be the case.\nThe example below has two issues I am wondering about:\n1. How do I check if a directory exists?\n2. Why the error `dir1/file.txt' must be only a file name`? it seems that this should be supported based on the project terminology.\n\nSource tree: [test-importlib.zip](/uploads/85bd6dd8df9e755c800ed0598d48091d/test-importlib.zip)\n\nStructure:\n```\n$ tree\n.\n├── package\n│ ├── dir1\n│ │ └── file.txt\n│ ├── file.txt\n│ └── __init__.py\n└── test.py\n```\n\nOutput:\n```\n$ python test.py \nis_resource(\"package\", \"file.txt\") True\nis_resource(\"package\", \"dir1\") False , how do I check if a directory exists?\nis_resource(\"package\", \"dir1/file.txt\") failed with dir1/file.txt' must be only a file name'\nis_resource(\"package.dir1\", \"file.txt\") False need an __init__.py in dir1\n```\n\nThanks.","author":{"url":"https://github.com/jaraco","@type":"Person","name":"jaraco"},"datePublished":"2020-10-21T22:19:08Z","url":"https://github.com/python/importlib_resources/issues/104"}
| 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 | /:user_id/:repository/issues/:id(.:format) |
| route-controller | issues |
| route-action | show |
| fetch-nonce | v2:7e374e66-7e6f-3b99-9fd7-d527a527078e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9784:13710D:269CDE:3458B2:6B0068B9 |
| html-safe-nonce | 97a5cead2a473f08fc4cfb89544c44db6d6b56c8bca077d6eabfe2d3423ba83a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Nzg0OjEzNzEwRDoyNjlDREU6MzQ1OEIyOjZCMDA2OEI5IiwidmlzaXRvcl9pZCI6IjM1MTQ3MjUyMzM2NTMyMTMzNjkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 31d0080a18a1ccf4ca3e74f9c0e232176c194b0048b8b41c18f052852328abab |
| hovercard-subject-tag | repository:306147182 |
| 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/python/importlib_resources/issues/104 |
| twitter:image | https://opengraph.githubassets.com/c57f91aa6d857c62fabc90dfbc11706fc52d4dbfcb573e80635009d7c11428e6/python/importlib_resources |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c57f91aa6d857c62fabc90dfbc11706fc52d4dbfcb573e80635009d7c11428e6/python/importlib_resources |
| og:image:alt | Backport of the importlib.resources module. Contribute to python/importlib_resources development by creating an account on GitHub. |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6527e91c60c0b29d16606ff32ac5df8ecdc37a2a62205ea057a14d7762c870fa |
| turbo-cache-control | no-cache |
| 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 | 46f1cd2ae3cd8ae1a81019b5d619742e76f13bbd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width