On this page
io.UnsupportedOperation
Prev: io.TextIOWrapper | Up: io | Next: io.Writer
Rel: io.BlockingIOError, io.BufferedIOBase, io.BufferedRandom, io.BufferedReader
Ref: docs.python.org โ io.UnsupportedOperation
Tags: #public #python3 #stdlib #io
Import
import io
from io import UnsupportedOperation
Signature & Overview
io.UnsupportedOperation(...)
io.UnsupportedOperation class.
Methods & Attributes
UnsupportedOperation.add_note(self, note, /)โ Add a note to the exceptionUnsupportedOperation.with_traceback(self, tb, /)โ Set self.traceback to tb and return self.
Usage
import io
buf = io.StringIO("hi")
try:
buf.fileno()
except io.UnsupportedOperation:
assert True
Gotchas
- Inherits from BOTH
OSErrorandValueError: Raised when calling an unsupported stream method (likefileno()onStringIO, orwrite()on a read-only file).
REPL Inspect
from io import UnsupportedOperation
help(UnsupportedOperation)
Linked from
Related notes
- tuts/python3/stdlib_module/io/TextIOWrapper Linked here; links to this page; shared tags: #io, #stdlib
- tuts/python3/stdlib_module/io/Writer Linked here; links to this page; shared tags: #io, #stdlib
- tuts/python3/stdlib_module/io Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/io/BlockingIOError Linked here; shared tags: #io, #stdlib
- tuts/python3/stdlib_module/io/BufferedIOBase Linked here; shared tags: #io, #stdlib
- tuts/python3/stdlib_module/io/BufferedRandom Linked here; shared tags: #io, #stdlib
- tuts/python3/stdlib_module/io/BufferedReader Linked here; shared tags: #io, #stdlib
- tuts/c/stdlib/stdio_and_file_io shared tags: #io, #stdlib
- tuts/cpp/stdlib/io_and_filesystem shared tags: #io, #stdlib
- tuts/cpp/stdlib/io_and_filesystem/format_and_print shared tags: #io, #stdlib