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 — gh-102778: Add sys.last_exc, deprecate sys.last_type, sys.last_value,sys.last_traceback by iritkatriel · Pull Request #102779 · python/cpython

Conversation

@iritkatriel

@iritkatriel iritkatriel commented Mar 17, 2023 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member
  • Issue: Add sys.last_exc, deprecate sys.last_type, sys.last_value and sys.last_traceback #102778

Sorry, something went wrong.

Uh oh!

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

All reactions
@iritkatriel
pythongh-102778: Add sys.last_exc, deprecate sys.last_type, sys.last_…
75e1496
…value, sys.last_traceback
@bedevere-bot bedevere-bot mentioned this pull request Mar 17, 2023
Add sys.last_exc, deprecate sys.last_type, sys.last_value and sys.last_traceback #102778
Closed
@bedevere-bot bedevere-bot added the awaiting core review label Mar 17, 2023
@iritkatriel
add news
56185a9
AlexWaygood
AlexWaygood reviewed Mar 17, 2023
View reviewed changes
Comment thread Doc/library/sys.rst Resolved

Uh oh!

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

iritkatriel and others added 2 commits March 17, 2023 13:51
@iritkatriel @AlexWaygood
use directive
4b7c631
Co-authored-by: Alex Waygood <[email protected]>
@iritkatriel
Merge branch 'main' into sys-last-exc
4a29bc7
AlexWaygood
AlexWaygood reviewed Mar 17, 2023
View reviewed changes

@AlexWaygood AlexWaygood 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.

A few more docs nits

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Doc/whatsnew/3.12.rst Resolved

Uh oh!

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

Comment thread Doc/whatsnew/3.12.rst Resolved

Uh oh!

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

Comment thread Misc/NEWS.d/next/Core and Builtins/2023-03-17-13-43-34.gh-issue-102778.ANDv8I.rst Resolved

Uh oh!

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

@iritkatriel @AlexWaygood
Apply suggestions from code review
e1cc312
Co-authored-by: Alex Waygood <[email protected]>
@iritkatriel iritkatriel added the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Mar 17, 2023
@bedevere-bot

bedevere-bot commented Mar 17, 2023

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @iritkatriel for commit e1cc312 🤖

If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot bedevere-bot removed the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Mar 17, 2023
@iritkatriel
Merge branch 'main' into sys-last-exc
139cd0b
@iritkatriel
iritkatriel requested a review from gvanrossum March 17, 2023 18:03
gvanrossum
gvanrossum approved these changes Mar 17, 2023
View reviewed changes

@gvanrossum gvanrossum 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.

Shouldn’t pdb.pm() be changed to use sys.last_exc?

Sorry, something went wrong.

Uh oh!

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

All reactions
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Mar 17, 2023
@iritkatriel

iritkatriel commented Mar 17, 2023

Copy link
Copy Markdown
Member Author

Shouldn’t pdb.pm() be changed to use sys.last_exc?

Yes, idlelib too. But I'm not sure whether we do that now or in 3.14 when it won't interfere with backports.

All reactions

Sorry, something went wrong.

Uh oh!

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

iritkatriel
iritkatriel commented Mar 17, 2023
View reviewed changes
Comment thread Doc/whatsnew/3.12.rst Resolved

Uh oh!

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

@iritkatriel
doc tweak
008355f
@gvanrossum

gvanrossum commented Mar 17, 2023

Copy link
Copy Markdown
Member

Shouldn’t pdb.pm() be changed to use sys.last_exc?

Yes, idlelib too. But I'm not sure whether we do that now or in 3.14 when it won't interfere with backports.

I would do it now, but look both (in case user code sets one or the other): if sys.last_exc exists, use that, else if sys.last_(type,value,traceback) exist, use those, else fail. Then in the future we can delete the code checking for the latter.

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

Sorry, something went wrong.

Uh oh!

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

@iritkatriel
update stdlib
242708e
@iritkatriel
iritkatriel requested a review from terryjreedy as a code owner March 17, 2023 20:45
@iritkatriel
variable name type --> typ
2ce2c26
@iritkatriel iritkatriel added the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Mar 17, 2023
@bedevere-bot

bedevere-bot commented Mar 17, 2023

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @iritkatriel for commit 2ce2c26 🤖

If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot bedevere-bot removed the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Mar 17, 2023
@iritkatriel
iritkatriel merged commit e1e9bab into python:main Mar 18, 2023
@bedevere-bot bedevere-bot removed the awaiting merge label Mar 18, 2023
@terryjreedy

terryjreedy commented Mar 19, 2023 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Please revert the changes to idlelib. (Why the rush before I could respond.) I dislike the awkward workaround changes, which IDLE does not need, and they cannot be backported. I would much prefer to make more extensive changes that get rid of nearly all references to the deprecated attributes and which can be backported.

For instance, in test_stackviewer setup, replace svs.last_type ... = svs.exec_info() with svs.last_exc = svs.exec_info()[1]. In the teardown, replace del ... with del svs.last_exc, leaving no usage of the deprecated names. In other modules, add sys.last_exc = sys.last_value and eliminate all other uses of the old names. In June 2024, eliminate the use of last_value.

Let me request again (from the previous PR that was closed) that idlelib changes be put in a separate PR that I can review and backport.

All reactions

Sorry, something went wrong.

Uh oh!

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

@iritkatriel

iritkatriel commented Mar 19, 2023

Copy link
Copy Markdown
Member Author

Sorry, will revert and fix.

All reactions

Sorry, something went wrong.

Uh oh!

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

@iritkatriel iritkatriel mentioned this pull request Mar 19, 2023
gh-102778: revert changes to idlelib #102825
Merged
@iritkatriel

iritkatriel commented Mar 19, 2023

Copy link
Copy Markdown
Member Author

In other modules, add sys.last_exc = sys.last_value and eliminate all other uses of the old names.

If a user tries to access sys.last_type or sys.last_traceback then it won't work. Is this not an issue?

All reactions

Sorry, something went wrong.

Uh oh!

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

@iritkatriel
iritkatriel deleted the sys-last-exc branch March 19, 2023 11:50
@terryjreedy

terryjreedy commented Mar 19, 2023 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Yes, sys.last_type, sys.last_value, sys.last_traceback = excinfo should remain as long as the REPL does the same. I should add a comment in the file. I believe other settings are only for internal use for stackviewer and its test, but will check.

All reactions

Sorry, something went wrong.

Uh oh!

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

Fidget-Spinner pushed a commit to Fidget-Spinner/cpython that referenced this pull request Mar 27, 2023
@iritkatriel @Fidget-Spinner
pythongh-102778: Add sys.last_exc, deprecate sys.last_type, sys.last_…
0d85488
…value,sys.last_traceback (python#102779)
warsaw pushed a commit to warsaw/cpython that referenced this pull request Apr 11, 2023
@iritkatriel @warsaw
pythongh-102778: Add sys.last_exc, deprecate sys.last_type, sys.last_…
bb6764d
…value,sys.last_traceback (python#102779)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@AlexWaygood AlexWaygood AlexWaygood left review comments
@gvanrossum gvanrossum gvanrossum approved these changes
@terryjreedy terryjreedy Awaiting requested review from terryjreedy terryjreedy is a code owner

Uh oh!

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

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

5 participants

@iritkatriel @bedevere-bot @gvanrossum @terryjreedy @AlexWaygood
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.