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

Method write_bytes

tests/mini_toolbox/pathlib.py:1405–1414  ·  view source on GitHub ↗

Open the file in bytes mode, write to it, and close the file.

(self, data)

Source from the content-addressed store, hash-verified

1403 return f.read()
1404
1405 def write_bytes(self, data):
1406 """
1407 Open the file in bytes mode, write to it, and close the file.
1408 """
1409 if not isinstance(data, pycompat.binary_type):
1410 raise TypeError(
1411 'data must be %s, not %s' %
1412 (pycompat.binary_type.__name__, data.__class__.__name__))
1413 with self.open(mode='wb') as f:
1414 return f.write(data)
1415
1416 def write_text(self, data, encoding=None, errors=None):
1417 """

Callers

nothing calls this directly

Calls 2

openMethod · 0.95
writeMethod · 0.45

Tested by

no test coverage detected