Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 62907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:32:58+00:00 2026-05-10T18:32:58+00:00

Just a curiosity: is there an already-coded way to convert a printed traceback back

  • 0

Just a curiosity: is there an already-coded way to convert a printed traceback back to the exception that generated it? 🙂 Or to a sys.exc_info-like structure?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T18:32:58+00:00Added an answer on May 10, 2026 at 6:32 pm

    Converting a traceback to the exception object wouldn’t be too hard, given common exception classes (parse the last line for the exception class and the arguments given to it at instantiation.) The traceback object (the third argument returned by sys.exc_info()) is an entirely different matter, though. The traceback object actually contains the chain of frame objects that constituted the stack at the time of the exception. Including local variables, global variables, et cetera. It is impossible to recreate that just from the displayed traceback.

    The best you could do would be to parse each ‘File ‘X’, line N, in Y:’ line and create fake frame objects that are almost entirely empty. There would be very little value in it, as basically the only thing you would be able to do with it would be to print it. What are you trying to accomplish?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just out of curiosity - is there another way to obtain the platform's path
This is just to satisfy my own curiosity. Is there an implementation of this:
Just of a curiosity, is there any practical use of Void struct except in
Just out of curiosity, what is the preferred way to achieve interprocess synchronization on
Just out of curiosity: I know I can tell the compiler if I want
This is just a question to satisfy my curiosity. But to me it is
Just looking for the first step basic solution here that keeps the honest people
Just how much slower are events? I have written a streaming XML parser (that
Disclaimer: this is just out of curiosity; I'm no expert at all when it
I wonder if there are anything like a Javascript template system that wraps HTML,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.