Skip to content

InterruptedError

In Python, InterruptedError is a built-in exception that occurs when a system call is interrupted by an external signal.

This exception corresponds to the C errno value EINTR. Since Python 3.5 and PEP 475, the interpreter automatically retries system calls that are interrupted by a signal instead of raising InterruptedError, so you’ll rarely see it in normal operation. It can still surface if a signal handler raises an exception, or when calling lower-level functions that haven’t adopted the automatic-retry behavior.

InterruptedError Occurs When

  • Performing system calls in multithreaded programs

InterruptedError Can Be Used When

  • Managing signals in asynchronous operations
  • Implementing robust error handling in applications that rely on system calls

Tutorial

An Intro to Threading in Python

In this intermediate-level tutorial, you'll learn how to use threading in your Python programs. You'll see how to create threads, how to coordinate and synchronize them, and how to handle common problems that arise in threading.

intermediate best-practices

For additional information on related topics, take a look at the following resources:


By Leodanis Pozo Ramos • Updated June 7, 2026