MCPcopy
hub / github.com/pyload/pyload / tob

Function tob

module/lib/bottle.py:115–117  ·  view source on GitHub ↗

Convert anything to bytes

(data, enc='utf8')

Source from the content-addressed store, hash-verified

113 return x if isinstance(x, unicode) else unicode(str(x), enc, err)
114
115def tob(data, enc='utf8'):
116 """ Convert anything to bytes """
117 return data.encode(enc) if isinstance(data, unicode) else bytes(data)
118
119tonat = touni if py3k else tob
120tonat.__doc__ = """ Convert anything to native strings """

Callers 5

wsgiMethod · 0.85
parse_authFunction · 0.85
cookie_encodeFunction · 0.85
cookie_decodeFunction · 0.85
cookie_is_encodedFunction · 0.85

Calls 1

encodeMethod · 0.45

Tested by

no test coverage detected