GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: Preliminary support for Python 3.13 by sentrivana · Pull Request #3200 · getsentry/sentry-python

Conversation

@sentrivana

@sentrivana sentrivana commented Jun 25, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

No RC yet, just beta releases, but we can already start setting stuff up.

3.13 release schedule: https://peps.python.org/pep-0719/#schedule

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
sentrivana added 2 commits June 25, 2024 14:00
@sentrivana
feat(tests): Test common against 3.13
2b2711f
@sentrivana
Merge branch 'master' into ivana/python-3.13
ac4d443
@sentrivana sentrivana added the Do not merge label Jun 25, 2024
sentrivana added 3 commits June 25, 2024 14:01
@sentrivana
fix ci yaml
240fc01
@sentrivana
allow prereleases
854dbf0
@sentrivana
fix
4f5fe0a
@sentrivana sentrivana added the Python:3.13 label Jun 25, 2024
@sentrivana sentrivana changed the title Test against Python 3.13 tests: Test against Python 3.13 Jun 25, 2024
@rominf rominf mentioned this pull request Jul 5, 2024
Support Python 3.13 (coming Oct 2024) #2664
Closed
rominf added 2 commits July 16, 2024 15:22
@rominf
fix(utils): Handle partialmethod in qualname_from_function (CPyth…
b9d1e3e
…on 3.13) (#3272)

The `_partialmethod` attribute of methods wrapped with `partialmethod()`
was renamed to `__partialmethod__` in CPython 3.13:
python/cpython#16600
@rominf
fix(tests): Fix exception on copying frame.f_locals (Python 3.13) (#…
49b4cf3
…3271)

Starting from Python 3.13, `frame.f_locals` is not `dict` anymore, but
`FrameLocalsProxy`, that cannot be copied using `copy.copy()`. In Python
3.13 and later, it should be copied using a method `.copy()`. The new way
of copying works the same as the old one for versions of Python prior to
3.13, according to the documentation (both copying methods produce a
shallow copy).

Since Python 3.13, `FrameLocalsProxy` skips items of `locals()` that have
non-`str` keys; this is a CPython implementation detail, so we hence
disable `test_non_string_variables` test on Python 3.13.

See:
https://peps.python.org/pep-0667/
python/cpython#118921
python/cpython#118923
https://docs.python.org/3.13/whatsnew/3.13.html#porting-to-python-3-13
https://docs.python.org/3/library/copy.html
https://github.com/python/cpython/blame/7b413952e817ae87bfda2ac85dd84d30a6ce743b/Objects/frameobject.c#L148
@sentrivana sentrivana linked an issue Jul 16, 2024 that may be closed by this pull request
Support Python 3.13 (coming Oct 2024) #2664
Closed
@sentrivana sentrivana changed the title tests: Test against Python 3.13 feat: Support Python 3.13 Jul 16, 2024
sentrivana added 2 commits July 16, 2024 15:26
@sentrivana
Merge branch 'master' into ivana/python-3.13
a994756
@sentrivana
need new pytest for 3.13
7508cb5
@sentrivana sentrivana changed the title feat: Support Python 3.13 feat: Preliminary support for Python 3.13 Jul 16, 2024
@sentrivana
sentrivana marked this pull request as ready for review July 16, 2024 13:41
@sentrivana
sentrivana requested review from antonpirker and szokeasaurusrex July 16, 2024 13:41
@sentrivana
Merge branch 'master' into ivana/python-3.13
e2eb799
szokeasaurusrex
szokeasaurusrex reviewed Jul 16, 2024
View reviewed changes

@szokeasaurusrex szokeasaurusrex left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these allow-prereleases: true have any affect on non-3.13 tests? I would be hesitant to merge this if so

Edit: Just noticed the "Do not merge" label, is that still accurate?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sentrivana sentrivana removed the Do not merge label Jul 16, 2024
antonpirker
antonpirker approved these changes Jul 16, 2024
View reviewed changes

@antonpirker antonpirker left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread sentry_sdk/utils.py

if include_local_variables:
rv["vars"] = copy(frame.f_locals)
rv["vars"] = frame.f_locals.copy()

@antonpirker antonpirker Jul 16, 2024

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this change?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@sentrivana sentrivana Jul 16, 2024

Copy link
Copy Markdown
Collaborator Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit has the details.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

antonpirker reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@szokeasaurusrex szokeasaurusrex Jul 16, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ Basically, frame.f_locals is no longer a dict in 3.13

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

antonpirker reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@sentrivana

sentrivana commented Jul 16, 2024

Copy link
Copy Markdown
Collaborator Author

Do these allow-prereleases: true have any affect on non-3.13 tests? I would be hesitant to merge this if so

Will double check this.

Edit: Just noticed the "Do not merge" label, is that still accurate?

No, removed now, thanks for noticing!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codecov

codecov Bot commented Jul 16, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.46%. Comparing base (cf8e37f) to head (e2eb799).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3200      +/-   ##
==========================================
+ Coverage   79.45%   79.46%   +0.01%     
==========================================
  Files         133      133              
  Lines       14290    14290              
  Branches     3004     3004              
==========================================
+ Hits        11354    11356       +2     
+ Misses       2091     2089       -2     
  Partials      845      845              
Files Coverage Δ
sentry_sdk/utils.py 82.64% <100.00%> (+0.37%) ⬆️

... and 1 file with indirect coverage changes

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sentrivana

sentrivana commented Jul 16, 2024

Copy link
Copy Markdown
Collaborator Author

@szokeasaurusrex allow-prereleases will only kick in if the specified Python version is not generally available (all older Python versions are, so no effect there), see here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

szokeasaurusrex
szokeasaurusrex approved these changes Jul 16, 2024
View reviewed changes

@szokeasaurusrex szokeasaurusrex left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sentrivana
sentrivana merged commit a98f660 into master Jul 16, 2024
@sentrivana
sentrivana deleted the ivana/python-3.13 branch July 16, 2024 14:10
arjennienhuis pushed a commit to arjennienhuis/sentry-python that referenced this pull request Sep 30, 2024
@sentrivana @rominf @arjenzorgdoc
feat: Preliminary support for Python 3.13 (getsentry#3200)
869e366
Adding preliminary support for Python 3.13.

The `_partialmethod` attribute of methods wrapped with `partialmethod()`
was renamed to `__partialmethod__` in CPython 3.13:
python/cpython#16600

Starting from Python 3.13, `frame.f_locals` is not `dict` anymore, but
`FrameLocalsProxy`, that cannot be copied using `copy.copy()`. In Python
3.13 and later, it should be copied using a method `.copy()`. The new way
of copying works the same as the old one for versions of Python prior to
3.13, according to the documentation (both copying methods produce a
shallow copy).

Since Python 3.13, `FrameLocalsProxy` skips items of `locals()` that have
non-`str` keys; this is a CPython implementation detail, so we hence
disable `test_non_string_variables` test on Python 3.13.

See:
https://peps.python.org/pep-0667/
python/cpython#118921
python/cpython#118923
https://docs.python.org/3.13/whatsnew/3.13.html#porting-to-python-3-13
https://docs.python.org/3/library/copy.html
https://github.com/python/cpython/blame/7b413952e817ae87bfda2ac85dd84d30a6ce743b/Objects/frameobject.c#L148

---------

Co-authored-by: Roman Inflianskas <[email protected]>
turicas added a commit to turicas/sentry-python that referenced this pull request Jun 6, 2025
@turicas
feat: Preliminary support for Python 3.13 (getsentry#3200)
298a192
Partial cherry-pick of: a98f660

Adding preliminary support for Python 3.13.

The `_partialmethod` attribute of methods wrapped with `partialmethod()`
was renamed to `__partialmethod__` in CPython 3.13:
python/cpython#16600

Starting from Python 3.13, `frame.f_locals` is not `dict` anymore, but
`FrameLocalsProxy`, that cannot be copied using `copy.copy()`. In Python
3.13 and later, it should be copied using a method `.copy()`. The new way
of copying works the same as the old one for versions of Python prior to
3.13, according to the documentation (both copying methods produce a
shallow copy).

Since Python 3.13, `FrameLocalsProxy` skips items of `locals()` that have
non-`str` keys; this is a CPython implementation detail, so we hence
disable `test_non_string_variables` test on Python 3.13.

See:
https://peps.python.org/pep-0667/
python/cpython#118921
python/cpython#118923
https://docs.python.org/3.13/whatsnew/3.13.html#porting-to-python-3-13
https://docs.python.org/3/library/copy.html
https://github.com/python/cpython/blame/7b413952e817ae87bfda2ac85dd84d30a6ce743b/Objects/frameobject.c#L148
turicas added a commit to turicas/sentry-python that referenced this pull request Jun 6, 2025
@turicas
feat: Preliminary support for Python 3.13 (getsentry#3200)
3b4a05f
Partial cherry-pick of: a98f660

Adding preliminary support for Python 3.13.

The `_partialmethod` attribute of methods wrapped with `partialmethod()`
was renamed to `__partialmethod__` in CPython 3.13:
python/cpython#16600

Starting from Python 3.13, `frame.f_locals` is not `dict` anymore, but
`FrameLocalsProxy`, that cannot be copied using `copy.copy()`. In Python
3.13 and later, it should be copied using a method `.copy()`. The new way
of copying works the same as the old one for versions of Python prior to
3.13, according to the documentation (both copying methods produce a
shallow copy).

Since Python 3.13, `FrameLocalsProxy` skips items of `locals()` that have
non-`str` keys; this is a CPython implementation detail, so we hence
disable `test_non_string_variables` test on Python 3.13.

See:
https://peps.python.org/pep-0667/
python/cpython#118921
python/cpython#118923
https://docs.python.org/3.13/whatsnew/3.13.html#porting-to-python-3-13
https://docs.python.org/3/library/copy.html
https://github.com/python/cpython/blame/7b413952e817ae87bfda2ac85dd84d30a6ce743b/Objects/frameobject.c#L148
turicas added a commit to turicas/sentry-python that referenced this pull request Jun 6, 2025
@turicas
feat: Preliminary support for Python 3.13 (getsentry#3200)
09787da
Partial cherry-pick of: a98f660

Adding preliminary support for Python 3.13.

The `_partialmethod` attribute of methods wrapped with `partialmethod()`
was renamed to `__partialmethod__` in CPython 3.13:
python/cpython#16600

Starting from Python 3.13, `frame.f_locals` is not `dict` anymore, but
`FrameLocalsProxy`, that cannot be copied using `copy.copy()`. In Python
3.13 and later, it should be copied using a method `.copy()`. The new way
of copying works the same as the old one for versions of Python prior to
3.13, according to the documentation (both copying methods produce a
shallow copy).

Since Python 3.13, `FrameLocalsProxy` skips items of `locals()` that have
non-`str` keys; this is a CPython implementation detail, so we hence
disable `test_non_string_variables` test on Python 3.13.

See:
https://peps.python.org/pep-0667/
python/cpython#118921
python/cpython#118923
https://docs.python.org/3.13/whatsnew/3.13.html#porting-to-python-3-13
https://docs.python.org/3/library/copy.html
https://github.com/python/cpython/blame/7b413952e817ae87bfda2ac85dd84d30a6ce743b/Objects/frameobject.c#L148
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@szokeasaurusrex szokeasaurusrex szokeasaurusrex approved these changes
+1 more reviewer
@antonpirker antonpirker antonpirker approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

Python:3.13

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Support Python 3.13 (coming Oct 2024)

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@sentrivana @antonpirker @szokeasaurusrex @rominf
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.