Open ShayneLee8 opened 6 years ago
当没有用 callback 时
ret = pcs.upload('/myowns/testPan/',test_file,'test.rar')
出现以下异常.
`
Traceback (most recent call last):
File "C:\lyxprogramfile\python3\lib\site-packages\urllib3\response.py", line 572, in _update_chunk_length
self.chunk_left = int(line, 16)
ValueError: invalid literal for int() with base 16: b''
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\lyxprogramfile\python3\lib\site-packages\urllib3\response.py", line 331, in _error_catcher yield File "C:\lyxprogramfile\python3\lib\site-packages\urllib3\response.py", line 637, in read_chunked self._update_chunk_length() File "C:\lyxprogramfile\python3\lib\site-packages\urllib3\response.py", line 576, in _update_chunk_length raise httplib.IncompleteRead(line) http.client.IncompleteRead: IncompleteRead(0 bytes read)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\lyxprogramfile\python3\lib\site-packages\requests\models.py", line 749, in generate for chunk in self.raw.stream(chunk_size, decode_content=True): File "C:\lyxprogramfile\python3\lib\site-packages\urllib3\response.py", line 461, in stream for line in self.read_chunked(amt, decode_content=decode_content): File "C:\lyxprogramfile\python3\lib\site-packages\urllib3\response.py", line 665, in read_chunked self._original_response.close() File "C:\lyxprogramfile\python3\lib\contextlib.py", line 99, in exit self.gen.throw(type, value, traceback) File "C:\lyxprogramfile\python3\lib\site-packages\urllib3\response.py", line 349, in _error_catcher raise ProtocolError('Connection broken: %r' % e, e) urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "test.py", line 24, in
`
感觉更像是网络问题?
不知为何我上传文件的进度条没有显示, 网盘也没有上传的文件。
100% |> | Time: 0:00:00
100% |> | Time: 0:00:00
显示一下就100%, 实际没有上传。 部分代码test_file = open('test.rar','rb').read() ret = pcs.upload('/myowns/testPan/',test_file,'test.txt',callback=ProgressBar())