Name: Benoît Dejean
Member since: 2004-04-02 21:26:28
Last Login: N/A
I spent my lunch hacking a dirty remote shell in python.
signal.signal(signal.SIGCHLD, reaper) # ... while True: client, who = server.accept()
Blam ! When the server process receives SIGCHLD, accept() is interrupted. So I added a try/except around the accept() :
while True: try: client, who = server.accept() except OSError, e: if e.errno != errno.EINTR: sys.exit(e) else: continue
Re-blam. I didn't paid attention to the previous exception's type. It was socket.error. I though it was a subclass of OSError ... it's not. issubclass(socket.error, OSError) == False. pydoc socket :/
The correct except statement is :
while True: try: client, who = server.accept() except socket.error, e: if e.args != errno.EINTR: sys.exit(e) else: continue
The socket.* error classes are just Exception. It would be nice to turn them into OSError :)
TazForEver certified others as follows:
Others have certified TazForEver as follows:
[ Certification disabled because you're not logged in. ]
New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.
Keep up with the latest Advogato features by reading the Advogato status blog.
If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!