天道酬勤,学无止境

google-search-appliance

在 Python 3 中从服务器返回回复时引发 BadStatusLine 异常(BadStatusLine exception raised when returning reply from server in Python 3)

问题 我正在尝试将脚本移植到 python 3,该脚本提交在这里找到的 XML 提要: https://developers.google.com/search-appliance/documentation/files/pushfeed_client.py.txt 在运行 2to3.py 并进行一些小的调整以消除任何语法错误后,脚本失败了: (py33dev) d:\dev\workspace>python pushfeed_client.py --datasource="TEST1" --feedtype="full" --url="http://gsa:19900/xmlfeed" --xmlfilename="test.xml" Traceback (most recent call last): File "pushfeed_client.py", line 108, in <module> main(sys.argv) File "pushfeed_client.py", line 56, in main result = urllib.request.urlopen(request_url) File "C:\Python33\Lib\urllib\request.py", line 156, in urlopen return opener.open(url

2021-06-11 10:51:37    分类:技术分享    python   python-3.x   google-search-appliance

BadStatusLine exception raised when returning reply from server in Python 3

I am trying to port a script to python 3 that submits XML feeds found here: https://developers.google.com/search-appliance/documentation/files/pushfeed_client.py.txt After running 2to3.py and making a few minor adjustments to remove any syntax errors the script fails with this: (py33dev) d:\dev\workspace>python pushfeed_client.py --datasource="TEST1" --feedtype="full" --url="http://gsa:19900/xmlfeed" --xmlfilename="test.xml" Traceback (most recent call last): File "pushfeed_client.py", line 108, in <module> main(sys.argv) File "pushfeed_client.py", line 56, in main result = urllib.request

2021-04-19 03:50:12    分类:问答    python   python-3.x   google-search-appliance