The following is the error I encountered during programming and recorded, starting from 2017-6-21
----------------------------------------
Exception happened during processing of request from (' 127.0.0.1 ', 48039)
Traceback (most recent):
File "/opt/python3/lib/python3.6/socketserver.py", line 639, in Process_request_thread
Self.finish_request (Request, client_address)
File "/opt/python3/lib/python3.6/socketserver.py", line 361, in Finish_request
Self. Requesthandlerclass (Request, client_address, self)
File "/opt/python3/lib/python3.6/socketserver.py", line 696, in __init__
Self.handle ()
File "/root/python_study/high_ftp/core/main.py", line-up, in handle
Recv_cmd = Self.request.recv (1024x768). Decode ()
Unicodedecodeerror: ' Utf-8 ' codec can ' t decode byte 0xd3 in position 1:invalid continuation byte
The calculation file size was found using Len, which was not used in the same way. Modified using the Os.path.getsize calculation
Exception happened during processing of request from (' 127.0.0.1 ', 4316)
Traceback (most recent):
File "C:\Python36-32\lib\socketserver.py", line 639, in Process_request_thread
Self.finish_request (Request, client_address)
File "C:\Python36-32\lib\socketserver.py", line 361, in Finish_request
Self. Requesthandlerclass (Request, client_address, self)
File "C:\Python36-32\lib\socketserver.py", line 696, in __init__
Self.handle ()
File "D:\51cto\python\Advance4\homework\Adv_ftp\high_ftp\core\main.py", line 106, in handle
Out_result = Fun (**cmd_json)
File "D:\51cto\python\Advance4\homework\Adv_ftp\high_ftp\core\main.py", line-up, in put
NEW_FILE_MD5 = M.hexdegest ()
Attributeerror: ' _hashlib. HASH ' object has no attribute ' hexdegest '
The spelling is wrong.
Traceback (most recent):
File "d:/1_oldboys14_py/advance4/homework/adv_ftp/high_ftp/ftpclient/ftpclient_core.py", line 121, in <module >
Ftp.interaction ()
File "d:/1_oldboys14_py/advance4/homework/adv_ftp/high_ftp/ftpclient/ftpclient_core.py", line +, in interaction
out = func (mess)
Typeerror:get () takes 1 positional argument but 2 were given
The reason is: I found that I defined 2 functions with the same name, resulting in an error
Traceback (most recent):
File "d:/1_oldboys14_py/advance4/homework/adv_ftp/high_ftp/ftpclient/ftpclient_core.py", line 123, in <module >
Ftp.interaction ()
File "d:/1_oldboys14_py/advance4/homework/adv_ftp/high_ftp/ftpclient/ftpclient_core.py", line +, in interaction
out = func (mess)
File "d:/1_oldboys14_py/advance4/homework/adv_ftp/high_ftp/ftpclient/ftpclient_core.py", line $, in get
If recv_msg[' id '] = = ' 200 ':
Typeerror:string indices must be integers
Type error
----------------------------------------
Exception happened during processing of request from (' 127.0.0.1 ', 53957)
Traceback (most recent):
File "D:\Python36\lib\socketserver.py", line 639, in Process_request_thread
Self.finish_request (Request, client_address)
File "D:\Python36\lib\socketserver.py", line 361, in Finish_request
Self. Requesthandlerclass (Request, client_address, self)
File "D:\Python36\lib\socketserver.py", line 696, in __init__
Self.handle ()
File "D:\1_oldboyS14_Py\Advance4\homework\Adv_ftp\high_ftp\core\main.py", line 126, in handle
Out_result = Fun (**cmd_json)
File "D:\1_oldboyS14_Py\Advance4\homework\Adv_ftp\high_ftp\core\main.py", line +, in get
Self.request.send (Kwargs.encode (' Utf-8 '))
Attributeerror: ' Dict ' object has no attribute ' encode '
should be sent when converted to string send
----------------------------------------
Exception happened during processing of request from (' 127.0.0.1 ', 54134)
Traceback (most recent):
File "D:\Python36\lib\socketserver.py", line 639, in Process_request_thread
Self.finish_request (Request, client_address)
File "D:\Python36\lib\socketserver.py", line 361, in Finish_request
Self. Requesthandlerclass (Request, client_address, self)
File "D:\Python36\lib\socketserver.py", line 696, in __init__
Self.handle ()
File "D:\1_oldboyS14_Py\Advance4\homework\Adv_ftp\high_ftp\core\main.py", line 127, in handle
Out_result = Fun (**cmd_json)
File "D:\1_oldboyS14_Py\Advance4\homework\Adv_ftp\high_ftp\core\main.py", line +, in get
Self.request.send (Line.encode (' Utf-8 '))
Attributeerror: ' Bytes ' object has no attribute ' encode '
File open Read is RB mode, so there's no need to encode.
Typeerror:argument of type ' socket ' is not iterable
Wrong writing.
It should be: if S is self.server: written as if s in Self.server.
Python Learning-Fault logging