代码拉取完成,页面将自动刷新
diff -purN requests-ftp-0.3.1.orig/requests_ftp/ftp.py requests-ftp-0.3.1/requests_ftp/ftp.py
--- requests-ftp-0.3.1.orig/requests_ftp/ftp.py 2015-08-13 16:57:27.000000000 -0400
+++ requests-ftp-0.3.1/requests_ftp/ftp.py 2018-08-02 10:13:15.801731787 -0400
@@ -99,7 +99,7 @@ def build_text_response(request, data, c
def build_binary_response(request, data, code):
'''Build a response for data whose encoding is unknown.'''
- return build_response(request, data, code, None)
+ return build_response(request, data, code, None)
def build_response(request, data, code, encoding):
@@ -113,7 +113,8 @@ def build_response(request, data, code,
response.raw = data
response.url = request.url
response.request = request
- response.status_code = int(code.split()[0])
+ last_valid_line_from_code = [line for line in code.split('\n') if line][-1]
+ response.status_code = int(last_valid_line_from_code.split()[0])
if hasattr(data, "content_len"):
response.headers['Content-Length'] = str(data.content_len)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。