Title: Setting locals() value leads to panicked. · Issue #4314 · RustPython/RustPython · GitHub
Open Graph Title: Setting locals() value leads to panicked. · Issue #4314 · RustPython/RustPython
X Title: Setting locals() value leads to panicked. · Issue #4314 · RustPython/RustPython
Description: In the following example, we set the locals()[42] as a string "abc" in a class A. Then it causes rustpython panicked. test.py: class A(object): locals()[42] = 'abc' Behavior on rustpython(rustpython 0.1.2): thread 'main' panicked at 'dic...
Open Graph Description: In the following example, we set the locals()[42] as a string "abc" in a class A. Then it causes rustpython panicked. test.py: class A(object): locals()[42] = 'abc' Behavior on rustpython(rustpytho...
X Description: In the following example, we set the locals()[42] as a string "abc" in a class A. Then it causes rustpython panicked. test.py: class A(object): locals()[42] = 'abc' Behavior on ru...
Opengraph URL: https://github.com/RustPython/RustPython/issues/4314
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Setting locals() value leads to panicked.","articleBody":"In the following example, we set the locals()[42] as a string \"abc\" in a class A. Then it causes rustpython panicked. \r\n\r\n\r\n\r\ntest.py:\r\n```\r\n\r\nclass A(object):\r\n locals()[42] = 'abc'\r\n\r\n```\r\n\r\nBehavior on rustpython(rustpython 0.1.2):\r\n```\r\nthread 'main' panicked at 'dict has non-string keys: [PyObject PyInt { value: 42 }]', vm/src/builtins/dict.rs:537:48\r\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\r\n```\r\n\r\n\r\nExpected behavior(behavior on CPython 3.9.1):\r\nwork well on the Python interpreter\r\n\r\n\r\nStep to reproduce:\r\ntype \"cargo run --release test.py\" on the console of Ubuntu 18.04 and MacOS Big Sur 11.7.1\r\nrust version: rustc 1.65.0","author":{"url":"https://github.com/xiaxinmeng","@type":"Person","name":"xiaxinmeng"},"datePublished":"2022-12-08T06:47:45.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/4314/RustPython/issues/4314"}
| 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:74d27fc4-7c96-575c-3b44-58afe5a7ca70 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D972:1D772C:500816:6CAE3E:696AABD9 |
| html-safe-nonce | d2ae783a88d5dec20f672fab6eb86112701a337342e054235ae41aa73b9c6fa2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOTcyOjFENzcyQzo1MDA4MTY6NkNBRTNFOjY5NkFBQkQ5IiwidmlzaXRvcl9pZCI6IjYwNDMyNzQ3OTU0OTI3NDgyNDkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 44ac45028be52c3dd76e0e894ceeda9cec7e70dcc07ca2c2968de0fd871a1b6e |
| hovercard-subject-tag | issue:1483858338 |
| 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/RustPython/RustPython/4314/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6d4b52e9fc48ece9283f325f261e31a38b08a0f9863b310ca68af770901893e1/RustPython/RustPython/issues/4314 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6d4b52e9fc48ece9283f325f261e31a38b08a0f9863b310ca68af770901893e1/RustPython/RustPython/issues/4314 |
| og:image:alt | In the following example, we set the locals()[42] as a string "abc" in a class A. Then it causes rustpython panicked. test.py: class A(object): locals()[42] = 'abc' Behavior on rustpython(rustpytho... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | xiaxinmeng |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3eaf9b8cf1badcd7041a8ad480b9d9b28bea0ef1cc821ca9ff20f2cc7f4fe4b9 |
| turbo-cache-control | no-preview |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| 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 | dd9a979046e6382bd084e2bd873bf65f797125ff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width