Title: last_event_id() crash: AttributeError: 'Scope' object has no attribute '_last_event_id'. · Issue #3113 · getsentry/sentry-python · GitHub
Open Graph Title: last_event_id() crash: AttributeError: 'Scope' object has no attribute '_last_event_id'. · Issue #3113 · getsentry/sentry-python
X Title: last_event_id() crash: AttributeError: 'Scope' object has no attribute '_last_event_id'. · Issue #3113 · getsentry/sentry-python
Description: How do you use Sentry? Sentry Saas (sentry.io) Version master Steps to Reproduce Run this file: import sentry_sdk sentry_sdk.init() with sentry_sdk.push_scope() as scope: sentry_sdk.last_event_id() Expected Result No crash. Actual Result...
Open Graph Description: How do you use Sentry? Sentry Saas (sentry.io) Version master Steps to Reproduce Run this file: import sentry_sdk sentry_sdk.init() with sentry_sdk.push_scope() as scope: sentry_sdk.last_event_id()...
X Description: How do you use Sentry? Sentry Saas (sentry.io) Version master Steps to Reproduce Run this file: import sentry_sdk sentry_sdk.init() with sentry_sdk.push_scope() as scope: sentry_sdk.last_event_id()...
Opengraph URL: https://github.com/getsentry/sentry-python/issues/3113
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"last_event_id() crash: AttributeError: 'Scope' object has no attribute '_last_event_id'.","articleBody":"### How do you use Sentry?\n\nSentry Saas (sentry.io)\n\n### Version\n\nmaster\n\n### Steps to Reproduce\n\nRun this file:\r\n\r\n```python\r\nimport sentry_sdk\r\n\r\nsentry_sdk.init()\r\n\r\nwith sentry_sdk.push_scope() as scope:\r\n sentry_sdk.last_event_id()\r\n```\r\n\n\n### Expected Result\n\nNo crash.\n\n### Actual Result\n\nCrash:\r\n\r\n```\r\n$ python example.py\r\nTraceback (most recent call last):\r\n File \"/.../example.py\", line 6, in \u003cmodule>\r\n sentry_sdk.last_event_id()\r\n File \"/.../sentry_sdk/api.py\", line 343, in last_event_id\r\n return Scope.last_event_id()\r\n ^^^^^^^^^^^^^^^^^^^^^\r\n File \"/.../sentry_sdk/scope.py\", line 330, in last_event_id\r\n return cls.get_isolation_scope()._last_event_id\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\nAttributeError: 'Scope' object has no attribute '_last_event_id'. Did you mean: 'last_event_id'?\r\n```\r\n\r\n#3064 added `last_event_id()` and `_last_event_id` but I think it missed copying `_last_event_id` in `Scope.__copy__`.","author":{"url":"https://github.com/adamchainz","@type":"Person","name":"adamchainz"},"datePublished":"2024-05-30T16:07:15Z","url":"https://github.com/getsentry/sentry-python/issues/3113"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:5a681048-101a-e6e4-0257-f6e0d14b0375 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AEE4:367E0F:32A816:444FDA:6B0436CE |
| html-safe-nonce | 836ed5389c530733bd6cae2d51b6c078489a6badf20e0ff468ff8b023d9540c9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRUU0OjM2N0UwRjozMkE4MTY6NDQ0RkRBOjZCMDQzNkNFIiwidmlzaXRvcl9pZCI6IjMzODYxNjM3MDE2ODM0NjMxOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ff8252e088c84030358ed96d0fda49638733531ef0294642b8da5a25e51c1e1b |
| hovercard-subject-tag | issue:2326044957 |
| 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/getsentry/sentry-python/3113/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c011c47c26343e6b7f16886ca650423f6b8a8f67c4406d4f1ce5f023f60d951e/getsentry/sentry-python/issues/3113 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c011c47c26343e6b7f16886ca650423f6b8a8f67c4406d4f1ce5f023f60d951e/getsentry/sentry-python/issues/3113 |
| og:image:alt | How do you use Sentry? Sentry Saas (sentry.io) Version master Steps to Reproduce Run this file: import sentry_sdk sentry_sdk.init() with sentry_sdk.push_scope() as scope: sentry_sdk.last_event_id()... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | adamchainz |
| hostname | github.com |
| expected-hostname | github.com |
| None | b7a1d2b9101496921b08579fbee988d014345aef2f5bd660d1f8c7332d81560e |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-python git https://github.com/getsentry/sentry-python.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 137814779 |
| octolytics-dimension-repository_nwo | getsentry/sentry-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 137814779 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-python |
| 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 | c3dd496c3da6ea6b77e69c09279d2b81604654f1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width