Closed ghost closed 8 years ago
Changed socketserver to SocketServer in each occurrence, now it runs as intended. Don't know why I have to capitalize it on my system but that's how the official documentation suggests it.
Feel free to close and edit your script if necessary. Thanks for writing it anyways.
I've been a bit perplexed trying to reproduce this issue, however, going to push out a fix later today to make it work on systems where capitalization is necessary. (catching the importerror and trying alternative)
Thanks for the report and the solution - it had me absolutely baffled!
I'm just a natural scientist and not a real programmer, but you should use:
except:
import SocketServer as socketserver
To avoid having to capitalize class socketserver.BaseRequestHandler and socketserver.UDPServer below.
Else people with systems like mine get:
Traceback (most recent call last):
File "DoubtfullyMalignant.py", line 60, in <module>
class DoubtfullyMalignant(socketserver.BaseRequestHandler):
NameError: name 'socketserver' is not defined
I feel this is relevant since it is a Raspberry Pi2 running python, so it can serve your code 24/7.
PS: Windows 7 was just a test to be honest, to see if it is just a problem with the Pi's python 2.7
Thanks for the friendly reply and fix. Sorry for bugging again, I'm sure this is the last fix necessary :smile:
DoubtfullyMalignant.py
On v2.7 you get: ImportError: No module named socketserver On v3.5 you get: SyntaxError: Missing parentheses in call to 'print'
Affected systems: Ubuntu Server and Windows 7
Please fix.