我正在尝试剥离字符b,'()
。我遇到的问题是它说 TypeError 'str' 不支持缓冲区接口。
以下是此代码的相关部分:
import urllib3
def command_uptime():
http = urllib3.PoolManager()
r = http.request('GET', 'https://nightdev.com/hosted/uptime.php?channel=TrippedNW')
rawData = r.data
liveTime = bytes(rawData.strip("b,\'()", rawData))
message = "Tripped has been live for: ", liveTime
send_message(CHAN, message)