Title: pythonnet (clr) hacks the import mechanism in Python - not compatible with Kivy · Issue #547 · pythonnet/pythonnet · GitHub
Open Graph Title: pythonnet (clr) hacks the import mechanism in Python - not compatible with Kivy · Issue #547 · pythonnet/pythonnet
X Title: pythonnet (clr) hacks the import mechanism in Python - not compatible with Kivy · Issue #547 · pythonnet/pythonnet
Description: https://groups.google.com/forum/#!search/pythonnet|sort:date/kivy-users/X0R7FUtysAk/IBKUJuyGBQAJ The problem was that importing the clr module does modify the import function and this seems to be globally. For standard importing (i.e. ...
Open Graph Description: https://groups.google.com/forum/#!search/pythonnet|sort:date/kivy-users/X0R7FUtysAk/IBKUJuyGBQAJ The problem was that importing the clr module does modify the import function and this seems to be...
X Description: https://groups.google.com/forum/#!search/pythonnet|sort:date/kivy-users/X0R7FUtysAk/IBKUJuyGBQAJ The problem was that importing the clr module does modify the import function and this seems to be...
Opengraph URL: https://github.com/pythonnet/pythonnet/issues/547
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"pythonnet (clr) hacks the import mechanism in Python - not compatible with Kivy","articleBody":"https://groups.google.com/forum/#!search/pythonnet%7Csort:date/kivy-users/X0R7FUtysAk/IBKUJuyGBQAJ\r\n\r\n\r\n\u003e The problem was that importing the clr module does modify the __import__ function and this seems to be globally. \r\n\u003e \r\n\u003e For standard importing (i.e. import xyz or from xyz imprt abc) this does not cause a problem, but in kivy/factory.py it calls __import__ in a way that is not supported by the overridden __import__() from the clr implementation.\r\n\u003e \r\n\u003e As a work around I now have factory.py create a reference to the __import__ as self._local_import and then around line 140 in factory.py I replace\r\n\u003e \r\n\u003e \r\n\u003e module = __import__(name=item['module'], fromlist='.') \r\n\u003e \r\n\u003e with \r\n\u003e \r\n\u003e module = self._local_import(name=item['module'], fromlist='.')\r\n\u003e \r\n\u003e \r\n\u003e And it appears that as long as factory.py is used at least once before the clr module is imported then things seem to work out.\r\n\u003e \r\n\u003e This seems like a hack and I would prefer to have something local to the clr importing that reverts __import__ to what it was, but my attempts to do so only fixed the __import__ locally to the module that did the importing and not globally like the import clr is doing.\r\n\u003e \r\n\u003e I guess this is more of a python thing but can anyone think of a way to correct this w/o having to modify kivy/factory.py?\r\n\u003e ","author":{"url":"https://github.com/den-run-ai","@type":"Person","name":"den-run-ai"},"datePublished":"2017-09-26T17:37:15.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/547/pythonnet/issues/547"}
| 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:75a2d41d-e15b-5580-e439-276d62510c5a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C732:36B19:13274E4:1AC6B7B:6970CC70 |
| html-safe-nonce | 66aa64cee483811de50ebac1df26aa6ef86aeee0f460721eae1ba9204eb6e673 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzMyOjM2QjE5OjEzMjc0RTQ6MUFDNkI3Qjo2OTcwQ0M3MCIsInZpc2l0b3JfaWQiOiIyMzA3MjY1NzUzMjU5MjMyMzY4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f0c194dfd82eaa8c9a61f1f45d52e1141d526d223a5df37383f0b580c31efb44 |
| hovercard-subject-tag | issue:260708900 |
| 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/547/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8246b199b94458a430bfc15cefd1d05d1041f38907ae0f6072a589c74a94169c/pythonnet/pythonnet/issues/547 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8246b199b94458a430bfc15cefd1d05d1041f38907ae0f6072a589c74a94169c/pythonnet/pythonnet/issues/547 |
| og:image:alt | https://groups.google.com/forum/#!search/pythonnet|sort:date/kivy-users/X0R7FUtysAk/IBKUJuyGBQAJ The problem was that importing the clr module does modify the import function and this seems to be... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | den-run-ai |
| hostname | github.com |
| expected-hostname | github.com |
| None | 721764876e433c894814212f8100f6610f1dde78a987acc2e385d8be8e170e9c |
| 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 | 6ff3d08f4ee1c3f89ebedf4df8fc8fe851190294 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width