Exception Classes
Custom exception classes used throughout python-pptx.PythonPptxError
Base exception class for all python-pptx exceptions.Description
This is the generic base class from which all other python-pptx exceptions inherit. You can catch this exception to handle any error raised by python-pptx.Usage
PackageNotFoundError
Raised when a presentation package cannot be found at the specified path.Description
This exception is raised when attempting to open a presentation file that doesn’t exist or cannot be accessed.Inheritance
Usage
When Raised
- Opening a presentation from a non-existent file path
- Opening a presentation from an invalid file path
- File access permission errors
InvalidXmlError
Raised when a value in the XML is not valid according to the Office Open XML schema.Description
This exception indicates that the presentation file contains XML that violates the OOXML schema specification. This can occur with corrupted files or files created by non-compliant software.Inheritance
Usage
When Raised
- Opening a corrupted presentation file
- Reading XML elements with invalid attribute values
- Processing presentations with schema violations
- Working with files created by non-compliant tools