given, the stream will seek to that position first and back afterwards,
and the total of bytes written is not updated.
'''
- self.fileobj.write(s, pos)
if pos is None:
+ self.fileobj.write(s)
self.bytes_written += len(s)
+ elif isinstance(self.fileobj, _LowLevelFile):
+ self.fileobj.write(s, pos) # change offset update in _LowLevelFile
+ else: # implement the seek here, e.g. for extfileobj
+ p0 = self.fileobj.tell()
+ os.lseek (self.fd, pos, os.SEEK_SET)
+ self.fileobj.write(s)
+ os.lseek (self.fd, p0, os.SEEK_SET)
+ # do not update bytes_written
def __enc_write(self, s):