Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/lib64/python3....
File: io.py
"""The io module provides the Python interfaces to stream handling. The
[0] Fix | Delete
builtin open function is defined in this module.
[1] Fix | Delete
[2] Fix | Delete
At the top of the I/O hierarchy is the abstract base class IOBase. It
[3] Fix | Delete
defines the basic interface to a stream. Note, however, that there is no
[4] Fix | Delete
separation between reading and writing to streams; implementations are
[5] Fix | Delete
allowed to raise an OSError if they do not support a given operation.
[6] Fix | Delete
[7] Fix | Delete
Extending IOBase is RawIOBase which deals simply with the reading and
[8] Fix | Delete
writing of raw bytes to a stream. FileIO subclasses RawIOBase to provide
[9] Fix | Delete
an interface to OS files.
[10] Fix | Delete
[11] Fix | Delete
BufferedIOBase deals with buffering on a raw byte stream (RawIOBase). Its
[12] Fix | Delete
subclasses, BufferedWriter, BufferedReader, and BufferedRWPair buffer
[13] Fix | Delete
streams that are readable, writable, and both respectively.
[14] Fix | Delete
BufferedRandom provides a buffered interface to random access
[15] Fix | Delete
streams. BytesIO is a simple stream of in-memory bytes.
[16] Fix | Delete
[17] Fix | Delete
Another IOBase subclass, TextIOBase, deals with the encoding and decoding
[18] Fix | Delete
of streams into text. TextIOWrapper, which extends it, is a buffered text
[19] Fix | Delete
interface to a buffered raw stream (`BufferedIOBase`). Finally, StringIO
[20] Fix | Delete
is an in-memory stream for text.
[21] Fix | Delete
[22] Fix | Delete
Argument names are not part of the specification, and only the arguments
[23] Fix | Delete
of open() are intended to be used as keyword arguments.
[24] Fix | Delete
[25] Fix | Delete
data:
[26] Fix | Delete
[27] Fix | Delete
DEFAULT_BUFFER_SIZE
[28] Fix | Delete
[29] Fix | Delete
An int containing the default buffer size used by the module's buffered
[30] Fix | Delete
I/O classes. open() uses the file's blksize (as obtained by os.stat) if
[31] Fix | Delete
possible.
[32] Fix | Delete
"""
[33] Fix | Delete
# New I/O library conforming to PEP 3116.
[34] Fix | Delete
[35] Fix | Delete
__author__ = ("Guido van Rossum <guido@python.org>, "
[36] Fix | Delete
"Mike Verdone <mike.verdone@gmail.com>, "
[37] Fix | Delete
"Mark Russell <mark.russell@zen.co.uk>, "
[38] Fix | Delete
"Antoine Pitrou <solipsis@pitrou.net>, "
[39] Fix | Delete
"Amaury Forgeot d'Arc <amauryfa@gmail.com>, "
[40] Fix | Delete
"Benjamin Peterson <benjamin@python.org>")
[41] Fix | Delete
[42] Fix | Delete
__all__ = ["BlockingIOError", "open", "IOBase", "RawIOBase", "FileIO",
[43] Fix | Delete
"BytesIO", "StringIO", "BufferedIOBase",
[44] Fix | Delete
"BufferedReader", "BufferedWriter", "BufferedRWPair",
[45] Fix | Delete
"BufferedRandom", "TextIOBase", "TextIOWrapper",
[46] Fix | Delete
"UnsupportedOperation", "SEEK_SET", "SEEK_CUR", "SEEK_END"]
[47] Fix | Delete
[48] Fix | Delete
[49] Fix | Delete
import _io
[50] Fix | Delete
import abc
[51] Fix | Delete
[52] Fix | Delete
from _io import (DEFAULT_BUFFER_SIZE, BlockingIOError, UnsupportedOperation,
[53] Fix | Delete
open, FileIO, BytesIO, StringIO, BufferedReader,
[54] Fix | Delete
BufferedWriter, BufferedRWPair, BufferedRandom,
[55] Fix | Delete
IncrementalNewlineDecoder, TextIOWrapper)
[56] Fix | Delete
[57] Fix | Delete
OpenWrapper = _io.open # for compatibility with _pyio
[58] Fix | Delete
[59] Fix | Delete
# Pretend this exception was created here.
[60] Fix | Delete
UnsupportedOperation.__module__ = "io"
[61] Fix | Delete
[62] Fix | Delete
# for seek()
[63] Fix | Delete
SEEK_SET = 0
[64] Fix | Delete
SEEK_CUR = 1
[65] Fix | Delete
SEEK_END = 2
[66] Fix | Delete
[67] Fix | Delete
# Declaring ABCs in C is tricky so we do it here.
[68] Fix | Delete
# Method descriptions and default implementations are inherited from the C
[69] Fix | Delete
# version however.
[70] Fix | Delete
class IOBase(_io._IOBase, metaclass=abc.ABCMeta):
[71] Fix | Delete
__doc__ = _io._IOBase.__doc__
[72] Fix | Delete
[73] Fix | Delete
class RawIOBase(_io._RawIOBase, IOBase):
[74] Fix | Delete
__doc__ = _io._RawIOBase.__doc__
[75] Fix | Delete
[76] Fix | Delete
class BufferedIOBase(_io._BufferedIOBase, IOBase):
[77] Fix | Delete
__doc__ = _io._BufferedIOBase.__doc__
[78] Fix | Delete
[79] Fix | Delete
class TextIOBase(_io._TextIOBase, IOBase):
[80] Fix | Delete
__doc__ = _io._TextIOBase.__doc__
[81] Fix | Delete
[82] Fix | Delete
RawIOBase.register(FileIO)
[83] Fix | Delete
[84] Fix | Delete
for klass in (BytesIO, BufferedReader, BufferedWriter, BufferedRandom,
[85] Fix | Delete
BufferedRWPair):
[86] Fix | Delete
BufferedIOBase.register(klass)
[87] Fix | Delete
[88] Fix | Delete
for klass in (StringIO, TextIOWrapper):
[89] Fix | Delete
TextIOBase.register(klass)
[90] Fix | Delete
del klass
[91] Fix | Delete
[92] Fix | Delete
try:
[93] Fix | Delete
from _io import _WindowsConsoleIO
[94] Fix | Delete
except ImportError:
[95] Fix | Delete
pass
[96] Fix | Delete
else:
[97] Fix | Delete
RawIOBase.register(_WindowsConsoleIO)
[98] Fix | Delete
[99] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function