Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add sys.last_exc, deprecate sys.last_type, sys.last_value and sys.last_traceback #102778

Closed
iritkatriel opened this issue Mar 17, 2023 · 4 comments · Fixed by #103314
Closed

Add sys.last_exc, deprecate sys.last_type, sys.last_value and sys.last_traceback #102778

iritkatriel opened this issue Mar 17, 2023 · 4 comments · Fixed by #103314
Labels
type-feature A feature request or enhancement

Comments

@terryjreedy
Copy link
Member

terryjreedy commented Mar 19, 2023

I appreciate the effort to remove the traces of string exceptions. Is there a plan to actually stop adding the old last_xxx vars to sys and accessing them in other non-IDLE stdlib modules? When they are added to sys by python itself (after unhandled exceptions), could they be added as properties with a getter that would emit a deprecation warning, or are properties for python-coded classes only?

@iritkatriel
Copy link
Member Author

Yes, I would like to eventually remove the old fields.

Since they are module level variables, I don't think they can be properties. But maybe there's something we can do through intercepting getattr on the module?

Fidget-Spinner pushed a commit to Fidget-Spinner/cpython that referenced this issue Mar 27, 2023
Fidget-Spinner pushed a commit to Fidget-Spinner/cpython that referenced this issue Mar 27, 2023
@iritkatriel iritkatriel reopened this Apr 6, 2023
iritkatriel added a commit to iritkatriel/cpython that referenced this issue Apr 6, 2023
@iritkatriel
Copy link
Member Author

Reopening to finish idlelib.

warsaw pushed a commit to warsaw/cpython that referenced this issue Apr 11, 2023
warsaw pushed a commit to warsaw/cpython that referenced this issue Apr 11, 2023
terryjreedy pushed a commit that referenced this issue Apr 19, 2023
#103314)

---------
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
@terryjreedy
Copy link
Member

Followup issue for idlelib is #102832 .

carljm added a commit to carljm/cpython that referenced this issue Apr 20, 2023
* main: (24 commits)
  pythongh-98040: Move the Single-Phase Init Tests Out of test_imp (pythongh-102561)
  pythongh-83861: Fix datetime.astimezone() method (pythonGH-101545)
  pythongh-102856: Clean some of the PEP 701 tokenizer implementation (python#103634)
  pythongh-102856: Skip test_mismatched_parens in WASI builds (python#103633)
  pythongh-102856: Initial implementation of PEP 701 (python#102855)
  pythongh-103583: Add ref. dependency between multibytecodec modules (python#103589)
  pythongh-83004: Harden msvcrt further (python#103420)
  pythonGH-88342: clarify that `asyncio.as_completed` accepts generators yielding tasks (python#103626)
  pythongh-102778: IDLE - make sys.last_exc available in Shell after traceback (python#103314)
  pythongh-103582: Remove last references to `argparse.REMAINDER` from docs (python#103586)
  pythongh-103583: Always pass multibyte codec structs as const (python#103588)
  pythongh-103617: Fix compiler warning in _iomodule.c (python#103618)
  pythongh-103596: [Enum] do not shadow mixed-in methods/attributes (pythonGH-103600)
  pythonGH-100530: Change the error message for non-class class patterns (pythonGH-103576)
  pythongh-95299: Remove lingering setuptools reference in installer scripts (pythonGH-103613)
  [Doc] Fix a typo in optparse.rst (python#103504)
  pythongh-101100: Fix broken reference `__format__` in `string.rst` (python#103531)
  pythongh-95299: Stop installing setuptools as a part of ensurepip and venv (python#101039)
  pythonGH-103484: Docs: add linkcheck allowed redirects entries for most cases (python#103569)
  pythongh-67230: update whatsnew note for csv changes (python#103598)
  ...
iritkatriel added a commit to iritkatriel/cpython that referenced this issue Jun 1, 2023
iritkatriel added a commit to iritkatriel/cpython that referenced this issue Jun 1, 2023
iritkatriel added a commit that referenced this issue Jun 2, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jun 2, 2023
…print_last() regarding sys.last_exc (pythonGH-105190)

(cherry picked from commit 0dafc78)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
iritkatriel added a commit that referenced this issue Jun 2, 2023
….print_last() regarding sys.last_exc (GH-105190) (#105246)

gh-102778: update documentation of PyErr_PrintEx and traceback.print_last() regarding sys.last_exc (GH-105190)
(cherry picked from commit 0dafc78)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants