1
2
3
4
5
6
7
8
9
10
11 | def buffer(self, buf):
"""
Returns a textual description of the contents of the argument passed
as a buffer or None if an error occurred and the MAGIC_ERROR flag
is set. A call to errno() will return the numeric error code.
"""
r = _buffer(self._magic_t, buf, len(buf))
if isinstance(r, str):
return r
else:
return str(r, 'utf-8')
|