MCPcopy
hub / github.com/csev/py4e / open

Method open

lectures/srt-split/pysrt/srtfile.py:144–155  ·  view source on GitHub ↗

open([path, [encoding]]) If you do not provide any encoding, it can be detected if the file contain a bit order mark, unless it is set to utf-8 as default.

(cls, path='', encoding=None, error_handling=ERROR_PASS)

Source from the content-addressed store, hash-verified

142
143 @classmethod
144 def open(cls, path='', encoding=None, error_handling=ERROR_PASS):
145 """
146 open([path, [encoding]])
147
148 If you do not provide any encoding, it can be detected if the file
149 contain a bit order mark, unless it is set to utf-8 as default.
150 """
151 new_file = cls(path=path, encoding=encoding)
152 source_file = cls._open_unicode_file(path, claimed_encoding=encoding)
153 new_file.read(source_file, error_handling=error_handling)
154 source_file.close()
155 return new_file
156
157 @classmethod
158 def from_string(cls, source, **kwargs):

Callers 15

skulpt.jsFile · 0.80
skulpt.min.jsFile · 0.80
x.pyFile · 0.80
y.pyFile · 0.80
input_fileMethod · 0.80
output_fileMethod · 0.80
saveMethod · 0.80
_open_unicode_fileMethod · 0.80
foundation.min.jsFile · 0.80
foundation.jsFile · 0.80
foundation.min.jsFile · 0.80
scotchPanels.jsFile · 0.80

Calls 3

_open_unicode_fileMethod · 0.80
readMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected