【发布时间】:2011-07-25 11:45:37
【问题描述】:
在py2中有
rv = xmlrpc.pastes.newPaste(language, code, None, filename, mimetype, private)
我收到错误:期望一个带有缓冲区接口的对象
找不到任何关于 xmlrpc 和 py3 的文档。我只找到了这个 sn-p :
p1 = subprocess.Popen(['gpg','--clearsign'], stdin = subprocess.PIPE, stdout=subprocess.PIPE)
p1.stdin.write(bytes(input, 'UTF8'))
output = p1.communicate()[0]
s = ServerProxy('http://paste.pocoo.org/xmlrpc/')
pasteid = s.pastes.newPaste('text',output.decode())
print ("http://paste.pocoo.org/raw/",pasteid,"/", sep="")
但我仍然对此感到困惑......我的版本使用了很多参数,我在哪里可以找到它的完整描述/修复它?
谢谢。
【问题讨论】:
-
参数与您已经使用的相同。您只需确保文本是
str,而不是bytes。
标签: python python-3.x xmlrpclib