示例#1
0
 def readinto(self, b: bytearray) -> Optional[int]:
     raise io.UnsupportedOperation()
示例#2
0
 def detach(self):
     raise io.UnsupportedOperation("detach() not supported")
示例#3
0
 def _check_can_read(self):
     if not self.readable():
         raise io.UnsupportedOperation("File not open for reading")
示例#4
0
 def readline(self, size=-1):
     """Read a line."""
     raise io.UnsupportedOperation("cannot read a line from a Jupyter redirect")
示例#5
0
 def truncate(self, size=None):
     """Truncate both buffers."""
     raise io.UnsupportedOperation("cannot truncate Jupyter redirect")
示例#6
0
 def seek(self, offset, whence=io.SEEK_SET):
     """Seek to a location."""
     raise io.UnsupportedOperation("cannot seek Jupyter redirect")
示例#7
0
 def detach(self):
     """This operation is not supported."""
     raise io.UnsupportedOperation("cannot detach a Jupyter redirect")
示例#8
0
 def _check_can_write(self):
     if self._mode != _MODE_WRITE:
         self._check_not_closed()
         raise io.UnsupportedOperation("File not open for writing")
 def readinto(self, buf):
     raise io.UnsupportedOperation('readinto')
示例#10
0
 def read(self, n=-1):
     raise io.UnsupportedOperation("read")
示例#11
0
 def _check_can_read(self):
     if self._mode not in (_MODE_READ, _MODE_READ_EOF):
         self._check_not_closed()
         raise io.UnsupportedOperation("File not open for reading")
示例#12
0
 def write(self, b):
     # This is needed because python will not always return the correct
     # kind of error even though writeable returns False.
     raise io.UnsupportedOperation("write")
示例#13
0
 def write(self, b: bytes) -> int:
     raise io.UnsupportedOperation()
示例#14
0
 def __next__(self):
     """Iterator API."""
     raise io.UnsupportedOperation('Cannot iterate an EncryptingStream')
示例#15
0
 def read(self, size=-1):
     raise io.UnsupportedOperation('read')
示例#16
0
 def seek(self, pos: int, whence: int = 0) -> int:
     if self._seekable:
         return self._bytes_io.seek(pos, whence)
     raise io.UnsupportedOperation('seek')
示例#17
0
 def write(self, value):
     raise io.UnsupportedOperation('write')
示例#18
0
 def seek(self, pos: int, whence: int = 0) -> int:
     if self._seekable:
         return super(SlowBytesIO, self).seek(pos, whence)
     raise io.UnsupportedOperation('seek')
示例#19
0
 def truncate(self, size=None):
     """Truncate the streams."""
     raise io.UnsupportedOperation("cannot truncate Jupyter redirect")
示例#20
0
 def write(self, _):
     """See io.RawIOBase.write."""
     raise io.UnsupportedOperation('write')
示例#21
0
 def read(self, size=None):
     """Read from the stream"""
     raise io.UnsupportedOperation("cannot read a Jupyter redirect")
示例#22
0
 def readinto1(self, *args, **kwargs):
     if 'r' not in self.mode and '+' not in self.mode:
         raise io.UnsupportedOperation('not readable')
     return self.stream.readinto1(*args, **kwargs)
示例#23
0
 def seek(self, offset, whence=io.SEEK_SET):
     """Sets the location in both the stdbuf and the membuf."""
     raise io.UnsupportedOperation("cannot seek Jupyter redirect")
示例#24
0
 def read(self, size=-1):
     if 'r' not in self.mode and '+' not in self.mode:
         raise io.UnsupportedOperation('not readable')
     return self.stream.read(size)
示例#25
0
 def readinto(self, b):
     """Read bytes into buffer from both streams."""
     raise io.UnsupportedOperation("cannot read into Jupyter redirect")
示例#26
0
 def readlines(self, hint=-1):
     if 'r' not in self.mode and '+' not in self.mode:
         raise io.UnsupportedOperation('not readable')
     return self.stream.readlines(hint)
示例#27
0
 def fileno_opt(self):
     raise io.UnsupportedOperation('Not a real file')
示例#28
0
 def write(self, s):
     if 'r' in self.mode and '+' not in self.mode:
         raise io.UnsupportedOperation('not writable')
     return self.stream.write(s)
示例#29
0
 def _check_can_write(self):
     if not self.writable():
         raise io.UnsupportedOperation("File not open for writing")
示例#30
0
 def fileno(self) -> int:
     raise io.UnsupportedOperation(
         "redirected stdin is pseudofile, has no fileno()")