Title: importhook.cs breaks python's import interface · Issue #1245 · pythonnet/pythonnet · GitHub
Open Graph Title: importhook.cs breaks python's import interface · Issue #1245 · pythonnet/pythonnet
X Title: importhook.cs breaks python's import interface · Issue #1245 · pythonnet/pythonnet
Description: Environment Pythonnet version: 2.5.1 Python version: 3.7.9 Operating System: Windows 10 Details Describe what you were trying to get done. pythonnet overwrites the python's __import__ routine, but does not implement python's signature pr...
Open Graph Description: Environment Pythonnet version: 2.5.1 Python version: 3.7.9 Operating System: Windows 10 Details Describe what you were trying to get done. pythonnet overwrites the python's __import__ routine, but ...
X Description: Environment Pythonnet version: 2.5.1 Python version: 3.7.9 Operating System: Windows 10 Details Describe what you were trying to get done. pythonnet overwrites the python's __import__ routine, ...
Opengraph URL: https://github.com/pythonnet/pythonnet/issues/1245
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"importhook.cs breaks python's import interface","articleBody":"### Environment\r\n\r\n- Pythonnet version: 2.5.1\r\n- Python version: 3.7.9\r\n- Operating System: Windows 10\r\n\r\n### Details\r\n\r\n- Describe what you were trying to get done.\r\n\r\npythonnet overwrites the python's `__import__` routine, but does not implement python's signature precisely:\r\noriginal python's signature is \r\n```python\r\n__import__(name, globals=None, locals=None, fromlist=(), level=0)\r\n```\r\n\r\nMost other python modules call the name parameter as positional: `__import__(\"foo\", ...`\r\n\r\nSome packages (e.g. kivy) use `__import__` as\r\n```python\r\n __import__(\r\n name='{2}.{0}.{1}'.format(basemodule, modulename, base),\r\n globals=globals(), locals=locals(), fromlist=[modulename], level=0\r\n )\r\n```\r\ni.e. the name argument used as keyword argument in the call. Both calls are valid in python's `__import__`, but fail at the overwritten `__import__` with\r\n\r\n```python\r\nTypeError: __import__() takes at least 1 argument (0 given)\r\n```\r\n\r\nA hotfix is to alter the other modules code to\r\n```python\r\n __import__(\r\n '{2}.{0}.{1}'.format(basemodule, modulename, base),\r\n globals=globals(), locals=locals(), fromlist=[modulename], level=0\r\n )\r\n```\r\nbut the broken code is within pythonnet.","author":{"url":"https://github.com/SStarosielec","@type":"Person","name":"SStarosielec"},"datePublished":"2020-10-05T08:56:21.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/1245/pythonnet/issues/1245"}
| 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:bef69c44-22a9-46c2-5e7c-2a086e0e3314 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E510:373734:991075:D6918A:6970B580 |
| html-safe-nonce | bda0368fb3607a1b044acd8fd971d31b4369adbf8978248d3fda6c62ff16313b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTEwOjM3MzczNDo5OTEwNzU6RDY5MThBOjY5NzBCNTgwIiwidmlzaXRvcl9pZCI6IjYwNjE2Nzc2MjIyNTQ5NDE1NjgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b687bce8a66ef8f6f16cdc6bd6ffa5fe91c07b6afffd778192e66aad4d16c1ef |
| hovercard-subject-tag | issue:714653514 |
| 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/pythonnet/pythonnet/1245/issue_layout |
| twitter:image | https://opengraph.githubassets.com/54994e78a868e39d7d7cb10fe308befb5d0bf912f49db8bfdd617d26935b4be4/pythonnet/pythonnet/issues/1245 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/54994e78a868e39d7d7cb10fe308befb5d0bf912f49db8bfdd617d26935b4be4/pythonnet/pythonnet/issues/1245 |
| og:image:alt | Environment Pythonnet version: 2.5.1 Python version: 3.7.9 Operating System: Windows 10 Details Describe what you were trying to get done. pythonnet overwrites the python's __import__ routine, but ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | SStarosielec |
| hostname | github.com |
| expected-hostname | github.com |
| None | 8e0be80373b724b033cdf8a7b1f78bf5fb6a5d7a2182a9a403aa30894606e390 |
| turbo-cache-control | no-preview |
| go-import | github.com/pythonnet/pythonnet git https://github.com/pythonnet/pythonnet.git |
| octolytics-dimension-user_id | 6050430 |
| octolytics-dimension-user_login | pythonnet |
| octolytics-dimension-repository_id | 14748123 |
| octolytics-dimension-repository_nwo | pythonnet/pythonnet |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 14748123 |
| octolytics-dimension-repository_network_root_nwo | pythonnet/pythonnet |
| 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 | b8714db0002cf78dc2d2566571807e404d6cb817 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width