Troubleshooting

At some point in your development career—probably by the time you write our first script—you will have encountered a Python error and received a Traceback message. The Traceback provides the context of the error and pinpoints the line that caused the issue. The issue itself is an exception and message of the error.

Python has a number of built-in exceptions whose purpose is to help the developer to diagnose errors in their code. Appendix B, Python Technical Details details solutions to common exceptions. It is not, however, an exhaustive list as some less common and user-created exceptions are not covered. A full list of built-in exceptions can be found at http://docs.python.org/2/library/exceptions.html.

Let's look at a simple example ...

Get Learning Python for Forensics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.