Title: BUG: [py3.11] AttributeError: 'PathDistribution' object has no attribute '_normalized_name' · Issue #98706 · python/cpython · GitHub
Open Graph Title: BUG: [py3.11] AttributeError: 'PathDistribution' object has no attribute '_normalized_name' · Issue #98706 · python/cpython
X Title: BUG: [py3.11] AttributeError: 'PathDistribution' object has no attribute '_normalized_name' · Issue #98706 · python/cpython
Description: This shows up while trying to run the numpy test suite with python 3.11 and the newest pytest etc. ==================================== ERRORS ==================================== ________________________ ERROR collecting test session __...
Open Graph Description: This shows up while trying to run the numpy test suite with python 3.11 and the newest pytest etc. ==================================== ERRORS ==================================== _________________...
X Description: This shows up while trying to run the numpy test suite with python 3.11 and the newest pytest etc. ==================================== ERRORS ==================================== _________________...
Opengraph URL: https://github.com/python/cpython/issues/98706
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"BUG: [py3.11] AttributeError: 'PathDistribution' object has no attribute '_normalized_name'","articleBody":"This shows up while [trying](https://github.com/conda-forge/numpy-feedstock/pull/283) to run the numpy test suite with python 3.11 and the newest pytest etc.\r\n\r\n```\r\n==================================== ERRORS ====================================\r\n________________________ ERROR collecting test session _________________________\r\n\r\n[...]\r\n\r\n=========================== short test summary info ============================\r\nERROR - AttributeError: 'PathDistribution' object has no attribute '_normalized_name'\r\nERROR - AttributeError: 'PathDistribution' object has no attribute '_normalized_name'\r\n2 errors in 1.41s\r\n```\r\n\r\nMore precisely, the error appears in the vendored import_lib module\r\n```\r\n[...]/lib/python3.11/importlib/metadata/__init__.py:472: in load\r\n ordered = sorted(eps, key=by_group)\r\n by_group = operator.attrgetter('group')\r\n cls = \u003cclass 'importlib.metadata.SelectableGroups'\u003e\r\n eps = \u003citertools.chain object at 0x7f19804ea5f0\u003e\r\n[...]/lib/python3.11/importlib/metadata/__init__.py:1013: in \u003cgenexpr\u003e\r\n eps = itertools.chain.from_iterable(\r\n .0 = \u003cgenerator object unique_everseen at 0x7f19805e9d40\u003e\r\n[...]/lib/python3.11/importlib/metadata/_itertools.py:16: in unique_everseen\r\n k = key(element)\r\nE AttributeError: 'PathDistribution' object has no attribute '_normalized_name'\r\n element = \u003cimportlib_metadata.PathDistribution object at 0x7f19802c0450\u003e\r\n iterable = \u003citertools.chain object at 0x7f19804eae00\u003e\r\n key = operator.attrgetter('_normalized_name')\r\n seen = set()\r\n seen_add = \u003cbuilt-in method add of set object at 0x7f198035b060\u003e\r\n```\r\n\r\nTurns out this is https://github.com/python/importlib_metadata/issues/396 (fixed in 4.13.0), where @jaraco noted: \r\n\u003e Perhaps importlib_metadata should provide a compatibility shim to honor name normalization in distributions not supplying it (or at least not crash).\r\n\r\nUnfortunately, the vendored version present in python 3.11 is [only](https://github.com/python/cpython/blob/3.11/Lib/importlib/metadata/__init__.py) at 4.11.3, hence does not carry the fix.","author":{"url":"https://github.com/h-vetinari","@type":"Person","name":"h-vetinari"},"datePublished":"2022-10-26T08:50:48.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/98706/cpython/issues/98706"}
| 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:8022bad4-c09f-c56e-bb53-7cb8396e52e1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 996C:11D50D:BC474F:FB5AC1:696996F4 |
| html-safe-nonce | 54b4b31d2a802e4ce9c3247495b9dd2720d1b0f3ef7c992047ac2935a5ddfe25 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OTZDOjExRDUwRDpCQzQ3NEY6RkI1QUMxOjY5Njk5NkY0IiwidmlzaXRvcl9pZCI6IjgzNjA4ODA3NzUyMzczMTAxOTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 08984cf65d766592df307b6d07b07f1409b650ab1a43aeca24094a271d2319f9 |
| hovercard-subject-tag | issue:1423663988 |
| 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/cpython/98706/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2cfaf9d9a31d443ec3ab50d65b3f3675d47142ccd55b3ae1b1253608137b6c3a/python/cpython/issues/98706 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2cfaf9d9a31d443ec3ab50d65b3f3675d47142ccd55b3ae1b1253608137b6c3a/python/cpython/issues/98706 |
| og:image:alt | This shows up while trying to run the numpy test suite with python 3.11 and the newest pytest etc. ==================================== ERRORS ==================================== _________________... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | h-vetinari |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3542e147982176a7ebaa23dfb559c8af16f721c03ec560c68c56b64a0f35e751 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| 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 | af80af7cc9e3de9c336f18b208a600950a3c187c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width