MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / write

Function write

pager_lib/six.py:770–781  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

768 return
769
770 def write(data):
771 if not isinstance(data, basestring):
772 data = str(data)
773 # If the file has an encoding, encode unicode with it.
774 if (isinstance(fp, file) and
775 isinstance(data, unicode) and
776 fp.encoding is not None):
777 errors = getattr(fp, "errors", None)
778 if errors is None:
779 errors = "strict"
780 data = data.encode(fp.encoding, errors)
781 fp.write(data)
782 want_unicode = False
783 sep = kwargs.pop("sep", None)
784 if sep is not None:

Callers 2

print_Function · 0.70
mainFunction · 0.50

Calls 2

encodeMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected