Name: BenoƮt Dejean
Member since: 2004-04-02 21:26:28
Last Login: N/A
Homepage: http://www.gnome.org
17 Sep 2005 (updated 17 Sep 2005 at 17:12 UTC) »
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[0] != errno.EINTR:
sys.exit(e)
else:
continue
The socket.* error classes are just Exception. It would be nice to turn them into OSError :)
12 Jun 2005 (updated 12 Jun 2005 at 21:18 UTC) »
Wow, Drivel 2.0 is amazing :)
TazForEver certified others as follows:
Others have certified TazForEver as follows:
[ Certification disabled because you're not logged in. ]
FOAF updates: Trust rankings are now exported, making the data available to other users and websites. An external FOAF URI has been added, allowing users to link to an additional FOAF file.
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!