MCPcopy Create free account
hub / github.com/Pylons/webtest / to_bytes

Function to_bytes

webtest/compat.py:8–11  ·  view source on GitHub ↗
(value, charset='latin1')

Source from the content-addressed store, hash-verified

6
7
8def to_bytes(value, charset='latin1'):
9 if isinstance(value, str):
10 return value.encode(charset)
11 return value
12
13
14from html.entities import name2codepoint

Callers 15

TestResponseClass · 0.90
set_authorizationMethod · 0.90
encode_multipartMethod · 0.90
_append_fileMethod · 0.90
_gen_requestMethod · 0.90
callFUTMethod · 0.90
select_appFunction · 0.90
get_files_pageMethod · 0.90
get_files_pageMethod · 0.90

Calls

no outgoing calls

Tested by 15

callFUTMethod · 0.72
select_appFunction · 0.72
get_files_pageMethod · 0.72
get_files_pageMethod · 0.72
test_multiple_fileMethod · 0.72
test_iterMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…