MCPcopy Index your code
hub / github.com/python/cpython / _get_encoding_arg

Function _get_encoding_arg

Lib/importlib/resources/_functional.py:63–75  ·  view source on GitHub ↗
(path_names, encoding)

Source from the content-addressed store, hash-verified

61
62
63def _get_encoding_arg(path_names, encoding):
64 # For compatibility with versions where *encoding* was a positional
65 # argument, it needs to be given explicitly when there are multiple
66 # *path_names*.
67 # This limitation can be removed in Python 3.15.
68 if encoding is _MISSING:
69 if len(path_names) > 1:
70 raise TypeError(
71 "'encoding' argument required with multiple path names",
72 )
73 else:
74 return 'utf-8'
75 return encoding
76
77
78def _get_resource(anchor, path_names):

Callers 2

open_textFunction · 0.85
read_textFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…