Chapter 12. Debugging IronPython Applications

WHAT'S IN THIS CHAPTER?

  • Diagnosing and understanding IronPython warnings

  • Getting error information using sys

  • Using the Python debugger to debug an application

  • Using the CLR debugger to debug an application

  • Using Visual Studio to debug an application

  • Adding exceptions to your application

Most applications have a bug or two in them at some point. In fact, unless your application is mind-numbingly simple (making it of dubious value), you can probably count on seeing at least a few bugs. When working with a language such as C#, the debugging process can be difficult, but at least you know directly where to start for debugging. You simply use the debugger built into Visual Studio. Unfortunately, IronPython isn't built into Visual Studio and lacks a dedicated Integrated Development Environment (IDE) of its own. As a result, debugging is more difficult for IronPython developers because you don't have a ready-made debugging solution.

IronPython developers aren't without resources. Debugging requires a different approach in IronPython, but in many respects you can use the same techniques you normally do to work through the debugging process. For example, most developers don't go directly to the debugger — they begin with warnings and error messages. Fortunately, IronPython has a robust set of both warning and error-handling features, which makes your job easier.

You can also use any of a number of debuggers with IronPython — these debuggers simply won't ...

Get Professional IronPython™ 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.