INNER CODE UNIT · Python
_determine_file_encoding
pymzml/pymzML · pymzml/run.py:261
def _determine_file_encoding(self, path):
"""
Determine the encoding used for the file in path.
Arguments:
path (str): path to the mzml files
Returns:
mzml_encoding (str): encoding type of the file
"""
if os.path.exists(path):
if path.endswith(".gz") or path.endswith(".igz"):
import gzip
_open = gzip.open
else:
_open = open
with _open(path, "rb") as sniffer: