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

Method from_descriptor

magic/__init__.py:121–126  ·  view source on GitHub ↗
(self, fd)

Source from the content-addressed store, hash-verified

119 return self._handle509Bug(e)
120
121 def from_descriptor(self, fd):
122 with self.lock:
123 try:
124 return maybe_decode(magic_descriptor(self.cookie, fd))
125 except MagicException as e:
126 return self._handle509Bug(e)
127
128 def _handle509Bug(self, e):
129 # libmagic 5.09 has a bug where it might fail to identify the

Callers 2

from_descriptorFunction · 0.80

Calls 3

_handle509BugMethod · 0.95
maybe_decodeFunction · 0.85
magic_descriptorFunction · 0.85

Tested by 1