Put, possibly replace, file contents with (new) data

def write(self, data):
        'Put, possibly replace, file contents with (new) data'
        if not hasattr(data, 'read'):
            data = six.BytesIO(data)#StringIO(data)
        self.jfs.up(self.path, data)