On this page
  1. pathlib.UnsupportedOperation
  2. Import
  3. Signature & Overview
  4. Methods & Attributes
  5. Usage
  6. Gotchas
  7. REPL Inspect

pathlib.UnsupportedOperation

Prev: pathlib.PureWindowsPath | Up: pathlib | Next: pathlib.WindowsPath
Rel: pathlib.Path, pathlib.PosixPath, pathlib.PurePath, pathlib.PurePosixPath
Ref: docs.python.org โ€” pathlib.UnsupportedOperation
Tags: #public #python3 #stdlib #pathlib


Import

import pathlib
from pathlib import UnsupportedOperation

Signature & Overview

pathlib.UnsupportedOperation(...)

An exception that is raised when an unsupported operation is attempted.

Methods & Attributes

Usage

import os
from pathlib import UnsupportedOperation, WindowsPath

# Raised when instantiating a concrete path for a different OS
if os.name == "posix":
    try:
        WindowsPath("C:/temp")
    except UnsupportedOperation as exc:
        assert "WindowsPath" in str(exc)

Gotchas

REPL Inspect

from pathlib import UnsupportedOperation
help(UnsupportedOperation)

Linked from

Related notes