MCPcopy Create free account
hub / github.com/ahupp/python-magic / file

Method file

magic/compat.py:139–145  ·  view source on GitHub ↗

Returns a textual description of the contents of the argument passed as a filename or None if an error occurred and the MAGIC_ERROR flag is set. A call to errno() will return the numeric error code.

(self, filename)

Source from the content-addressed store, hash-verified

137 return bytes(b)
138
139 def file(self, filename):
140 """
141 Returns a textual description of the contents of the argument passed
142 as a filename or None if an error occurred and the MAGIC_ERROR flag
143 is set. A call to errno() will return the numeric error code.
144 """
145 return Magic.__tostr(_file(self._magic_t, Magic.__tobytes(filename)))
146
147 def descriptor(self, fd):
148 """

Callers 1

detect_from_filenameFunction · 0.80

Calls 2

__tostrMethod · 0.80
__tobytesMethod · 0.80

Tested by

no test coverage detected