MCPcopy
hub / github.com/cool-RR/PySnooper / open

Method open

tests/mini_toolbox/pathlib.py:1375–1389  ·  view source on GitHub ↗

Open the file pointed by this path and return a file object, as the built-in open() function does.

(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None)

Source from the content-addressed store, hash-verified

1373 return grp.getgrgid(self.stat().st_gid).gr_name
1374
1375 def open(self, mode='r', buffering=-1, encoding=None,
1376 errors=None, newline=None):
1377 """
1378 Open the file pointed by this path and return a file object, as
1379 the built-in open() function does.
1380 """
1381 if self._closed:
1382 self._raise_closed()
1383 if sys.version_info >= (3, 3):
1384 return io.open(
1385 str(self), mode, buffering, encoding, errors, newline,
1386 opener=self._opener)
1387 else:
1388 return io.open(str(self), mode, buffering,
1389 encoding, errors, newline)
1390
1391 def read_bytes(self):
1392 """

Callers 11

read_bytesMethod · 0.95
read_textMethod · 0.95
write_bytesMethod · 0.95
write_textMethod · 0.95
test_file_outputFunction · 0.80
test_unavailable_sourceFunction · 0.80
test_overwriteFunction · 0.80
test_chineseFunction · 0.80
_openerMethod · 0.80
_raw_openMethod · 0.80

Calls 1

_raise_closedMethod · 0.95

Tested by 5

test_file_outputFunction · 0.64
test_unavailable_sourceFunction · 0.64
test_overwriteFunction · 0.64
test_chineseFunction · 0.64