Title: Handling python exceptions · Issue #106 · sofa-framework/SofaPython3 · GitHub
Open Graph Title: Handling python exceptions · Issue #106 · sofa-framework/SofaPython3
X Title: Handling python exceptions · Issue #106 · sofa-framework/SofaPython3
Description: The discussion started in #92 . The following scene will behave differently either we are using SofaPython(2) or SofaPython3: Test scene # test.py def createScene(root) root = '2' + 2 Using SofaPython(2): [ERROR] [PythonScript] TypeError...
Open Graph Description: The discussion started in #92 . The following scene will behave differently either we are using SofaPython(2) or SofaPython3: Test scene # test.py def createScene(root) root = '2' + 2 Using SofaPyt...
X Description: The discussion started in #92 . The following scene will behave differently either we are using SofaPython(2) or SofaPython3: Test scene # test.py def createScene(root) root = '2' + 2 Using...
Opengraph URL: https://github.com/sofa-framework/SofaPython3/issues/106
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Handling python exceptions","articleBody":"The discussion started in #92 . \r\n\r\nThe following scene will behave differently either we are using SofaPython(2) or SofaPython3:\r\n\r\n**Test scene**\r\n```python\r\n# test.py\r\ndef createScene(root)\r\n root = '2' + 2\r\n```\r\n\r\n**Using SofaPython(2):**\r\n```\r\n[ERROR] [PythonScript] TypeError: cannot concatenate 'str' and 'int' objects\r\n File \"test.py\", line 2, in createScene\r\n root = '2' + 2\r\n```\r\n\r\n**Using SofaPython3:**\r\n```\r\n[ERROR] [SofaPython3::SceneLoader] TypeError: can only concatenate str (not \"int\") to str\r\n\r\nAt:\r\n test.py(2): createScene\r\n```\r\n\r\nIn order to have the same behavior, we would have to place an exception hook in python interpreter of the plugin SofaPython3. However, this was not possible before python 3.8:\r\n\u003e @damienmarchal in #92 \r\n\u003eI think there is two issue mixed together.\r\n\u003e One is about the exception risen from python. In SofaPython they were catched by a dedicated hook installed by Sofa in the python interpreter. Because of multithreading this feature was broken before 3.8 and thus SofPython3 was not using it. The consequence is that when there is an error at the python level the behavior is different.\r\n","author":{"url":"https://github.com/jnbrunet","@type":"Person","name":"jnbrunet"},"datePublished":"2021-01-26T14:01:52.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/106/SofaPython3/issues/106"}
| 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:715b3ef8-3bd9-19ed-8146-f6dafce6cc27 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C8FC:18EDB3:A0FA51E:D00401A:697F067C |
| html-safe-nonce | 5d961ad125116509a7014733a5f113880753700616bd0b9e5e7d7ec18a53313a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOEZDOjE4RURCMzpBMEZBNTFFOkQwMDQwMUE6Njk3RjA2N0MiLCJ2aXNpdG9yX2lkIjoiOTExOTc5MDY5ODg5NDEzMjg2MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e70f8a0972c7d785c69fe99b0001a1cf5c900791f9b16ee0698c1496147bd83a |
| hovercard-subject-tag | issue:794255129 |
| 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/sofa-framework/SofaPython3/106/issue_layout |
| twitter:image | https://opengraph.githubassets.com/de88c500651a2e9425f679102e6ed8d92455afd27d9b4abb8404c7aa825da5f8/sofa-framework/SofaPython3/issues/106 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/de88c500651a2e9425f679102e6ed8d92455afd27d9b4abb8404c7aa825da5f8/sofa-framework/SofaPython3/issues/106 |
| og:image:alt | The discussion started in #92 . The following scene will behave differently either we are using SofaPython(2) or SofaPython3: Test scene # test.py def createScene(root) root = '2' + 2 Using SofaPyt... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jnbrunet |
| hostname | github.com |
| expected-hostname | github.com |
| None | 60279d4097367e16897439d16d6bbe4180663db828c666eeed2656988ffe59f6 |
| turbo-cache-control | no-preview |
| go-import | github.com/sofa-framework/SofaPython3 git https://github.com/sofa-framework/SofaPython3.git |
| octolytics-dimension-user_id | 11028508 |
| octolytics-dimension-user_login | sofa-framework |
| octolytics-dimension-repository_id | 260159147 |
| octolytics-dimension-repository_nwo | sofa-framework/SofaPython3 |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 260159147 |
| octolytics-dimension-repository_network_root_nwo | sofa-framework/SofaPython3 |
| 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 | 7c85641c598ad130c74f7bcc27f58575cac69551 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width