Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/aio-libs/aiohttp
/ str_to_bytes
Function
str_to_bytes
aiohttp/helpers.py:201–204 ·
view source on GitHub ↗
(s, encoding='utf-8')
Source
from the content-addressed store, hash-verified
199
200
201
def
str_to_bytes(s, encoding=
'utf-8'
):
202
if
isinstance(s, str):
203
return
s.encode(encoding)
204
return
s
205
206
207
def
guess_filename(obj, default=None):
Callers
nothing calls this directly
Calls
1
encode
Method · 0.80
Tested by
no test coverage detected