【发布时间】:2012-05-26 15:37:24
【问题描述】:
这是在博客上发布的代码。这是我的第一次尝试。我不知道它有什么错误。我正在使用代理服务器,我得到的错误是与服务器的连接失败。
谁能帮帮我好吗eeeeeeeeee :/
import wordpresslib
# dummy data to be on safe side
data = "Post content, just ensuring data is not empty"
url='http://agneesa.wordpress.com/wordpress/xmlrpc.php'
# insert correct username and password
wp=wordpresslib.WordPressClient(url,'agnsa','pan@13579')
wp.selectBlog(0)
post=wordpresslib.WordPressPost()
post.title='try'
post.description=data
idPost=wp.newPost(post,True)
这是回溯
这是回溯文件
Traceback (most recent call last):
File "C:\Python27\Lib\example.py", line 34, in <module>
post.categories = (wp.getCategoryIdFromName('Python'),)
File "C:\Python27\Lib\wordpresslib.py", line 332, in getCategoryIdFromName
for c in self.getCategoryList():
File "C:\Python27\Lib\wordpresslib.py", line 321, in getCategoryList
self.user, self.password)
File "C:\Python27\Lib\xmlrpclib.py", line 1224, in __call__
return self.__send(self.__name, args)
File "C:\Python27\Lib\xmlrpclib.py", line 1578, in __request
verbose=self.__verbose
File "C:\Python27\Lib\xmlrpclib.py", line 1264, in request
return self.single_request(host, handler, request_body, verbose)
File "C:\Python27\Lib\xmlrpclib.py", line 1292, in single_request
self.send_content(h, request_body)
File "C:\Python27\Lib\xmlrpclib.py", line 1439, in send_content
connection.endheaders(request_body)
File "C:\Python27\Lib\httplib.py", line 954, in endheaders
self._send_output(message_body)
File "C:\Python27\Lib\httplib.py", line 814, in _send_output
self.send(msg)
File "C:\Python27\Lib\httplib.py", line 776, in send
self.connect()
File "C:\Python27\Lib\httplib.py", line 757, in connect
self.timeout, self.source_address)
File "socket.py", line 571, in create_connection
raise err
error: [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
【问题讨论】:
-
我希望这不是您的实际密码...
-
编辑问题以显示您获得的实际回溯
-
扩展尼克所说的内容...当您发布有关代码崩溃情况的问题时,我们总是需要查看回溯/崩溃的副本以帮助您确定问题的性质.不是每个人都可以通过查看您尝试运行的代码来弄清楚。特别是如果它是一个自定义库。如果您强调始终包含该信息,您一定会获得更快、更准确的答案。
-
@lara 欢迎来到 StackOverflow。隔几个小时发布nearly-identical questions 是不受欢迎的;仅使用此新信息编辑您的旧问题也会将其提升到页面顶部,并且会阻止人们复制其他人已经发布的工作以尝试解决您的问题。
-
@Dougal 感谢您抓住那个。这是完全相同的代码和连接问题。帮助我停止调查。
标签: python wordpress networking proxy