Title: Ugly traceback in PythonException · Issue #1359 · pythonnet/pythonnet · GitHub
Open Graph Title: Ugly traceback in PythonException · Issue #1359 · pythonnet/pythonnet
X Title: Ugly traceback in PythonException · Issue #1359 · pythonnet/pythonnet
Description: Environment Pythonnet version: 2.5.0 and earlier Python version: 3.7 and 2.7 Operating System: any .NET Runtime: any Details Describe what you were trying to get done. Within Unity, when a PythonException is thrown, we usually print the ...
Open Graph Description: Environment Pythonnet version: 2.5.0 and earlier Python version: 3.7 and 2.7 Operating System: any .NET Runtime: any Details Describe what you were trying to get done. Within Unity, when a PythonEx...
X Description: Environment Pythonnet version: 2.5.0 and earlier Python version: 3.7 and 2.7 Operating System: any .NET Runtime: any Details Describe what you were trying to get done. Within Unity, when a PythonEx...
Opengraph URL: https://github.com/pythonnet/pythonnet/issues/1359
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Ugly traceback in PythonException","articleBody":"### Environment\r\n\r\n- Pythonnet version: 2.5.0 and earlier\r\n- Python version: 3.7 and 2.7\r\n- Operating System: any\r\n- .NET Runtime: any\r\n\r\n### Details\r\n\r\n- Describe what you were trying to get done.\r\n\r\nWithin Unity, when a PythonException is thrown, we usually print the exception. It comes out looking like:\r\n```\r\nPythonException: TypeError : cannot create weak reference to 'PySideTestUI' object\r\n[' File \"\u003cstring\u003e\", line 3, in \u003cmodule\u003e/n', ' File \"/Users/bhudson/projects/com.unity.scripting.python/com.unity.scripting.python/Samples/PySideExample/PySideExample.py\", line 168, in create_or_reinitialize/n _PYSIDE_UI = PySideTestUI()/n', ' File \"/Users/bhudson/projects/com.unity.scripting.python/com.unity.scripting.python/Samples/PySideExample/PySideExample.py\", line 54, in __init__/n self._dialog = self.load_ui_widget(ui_path.replace(\"////\", \"/\"))/n', ' File \"/Users/bhudson/projects/com.unity.scripting.python/com.unity.scripting.python/Samples/PySideExample/PySideExample.py\", line 130, in load_ui_widget/n ui.useCameraButton.clicked.connect(self.use_camera)/n']\r\n```\r\nAll on one line. It's very hard to read.\r\n\r\nThe pythonnet issue is that we have a list of strings that got str() called on it rather than joining them. Then a separate bug is that something is flipping backslashes to slashes but I don't think that's pythonnet's responsibility.\r\n\r\nThe reason is here: https://github.com/pythonnet/pythonnet/blob/master/src/runtime/pythonexception.cs#L53","author":{"url":"https://github.com/benoithudson","@type":"Person","name":"benoithudson"},"datePublished":"2021-01-19T03:09:05.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1359/pythonnet/issues/1359"}
| 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:d2bcdd50-dcd7-2e64-9336-fc63d3a90e14 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D4CC:EB10B:1FA53A7:2AF28FC:697083AB |
| html-safe-nonce | 5332f073548c9e6c0c88b9bcdf5d5ea9d078de86ab8a79e18e4d3faa57428dc3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENENDOkVCMTBCOjFGQTUzQTc6MkFGMjhGQzo2OTcwODNBQiIsInZpc2l0b3JfaWQiOiI3MjMzNDIwNTk2OTcwODE2NDI3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b7035eb7b61cc2565f5b001a0cdd4cac1104dd6bb15aa14f31d4b8d28843f562 |
| hovercard-subject-tag | issue:788669166 |
| 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/1359/issue_layout |
| twitter:image | https://opengraph.githubassets.com/66339967301dd04eed16f278fc421dc0fb7ce03d81862c5ac3f00038f80ab2d2/pythonnet/pythonnet/issues/1359 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/66339967301dd04eed16f278fc421dc0fb7ce03d81862c5ac3f00038f80ab2d2/pythonnet/pythonnet/issues/1359 |
| og:image:alt | Environment Pythonnet version: 2.5.0 and earlier Python version: 3.7 and 2.7 Operating System: any .NET Runtime: any Details Describe what you were trying to get done. Within Unity, when a PythonEx... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | benoithudson |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9920a62ba22d06470388e2904804fb7e5ec51c9e35f81784e9191394c74b2bd2 |
| 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 | 7d6181066430cc06553c8396ca201e194ae33cb9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width