MCPcopy Create free account
hub / github.com/catboost/catboost / read_file_unicode

Function read_file_unicode

library/python/fs/__init__.py:332–342  ·  view source on GitHub ↗
(path, binary=True, enc='utf-8')

Source from the content-addressed store, hash-verified

330# Throws OSError
331@errorfix_win
332def read_file_unicode(path, binary=True, enc='utf-8'):
333 if not binary:
334 if six.PY2:
335 with open(path, 'r') as f:
336 return library.python.strings.to_unicode(f.read(), enc)
337 else:
338 with open(path, 'r', encoding=enc) as f:
339 return f.read()
340 # codecs.open is always binary
341 with codecs.open(path, 'r', encoding=enc, errors=library.python.strings.ENCODING_ERRORS_POLICY) as f:
342 return f.read()
343
344
345@errorfix_win

Callers

nothing calls this directly

Calls 3

openFunction · 0.50
readMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected