Exception Attributes
OSError.filename2 — exception attribute
Read the second path for an operation involving two paths, such as a failed rename. It is separate from filename and may be None for single-path operations. The constructor example simulates a two-path failure; it performs no filesystem change.
Formal Syntax & Structure
python syntaxpython
error.filename2Return Value
object | None
Second path, when supplied.
Working Example
Example Snippetpython
import errnoerror = OSError(errno.ENOENT, "missing input", "input.txt", None, "output.txt")print(error.filename2)