I ran the same droopy.py with Python 2 then Python 3.
--auth works as expected with Python 2.
With Python 3.6.4 on Win 7 -64bit, I get this error:
>python droopy.py --auth test:test
Exceptionhappenedduringprocessingofrequestfrom ('127.0.0.1', 53806)
Traceback (mostrecentcalllast):
File"C:\Users\user\AppData\Local\Programs\Python\Python36-32\lib\socketserver.py", line639, inprocess_request_threadself.finish_request(request, client_address)
File"C:\Users\user\AppData\Local\Programs\Python\Python36-32\lib\socketserver.py", line361, infinish_requestself.RequestHandlerClass(request, client_address, self)
File"C:\Users\user\AppData\Local\Programs\Python\Python36-32\lib\socketserver.py", line696, in__init__self.handle()
File"droopy.py", line352, inhandlehttpserver.BaseHTTPRequestHandler.handle(self)
File"C:\Users\user\AppData\Local\Programs\Python\Python36-32\lib\http\server.py", line418, inhandleself.handle_one_request()
File"C:\Users\user\AppData\Local\Programs\Python\Python36-32\lib\http\server.py", line406, inhandle_one_requestmethod()
File"droopy.py", line77, indecoratedexpected='Basic '+base64.b64encode(self.auth)
File"C:\Users\user\AppData\Local\Programs\Python\Python36-32\lib\base64.py", line58, inb64encodeencoded=binascii.b2a_base64(s, newline=False)
TypeError: abytes-likeobjectisrequired, not'str'
I ran the same
droopy.pywith Python 2 then Python 3.--authworks as expected with Python 2.With Python 3.6.4 on Win 7 -64bit, I get this error:
>python droopy.py --auth test:test