Guilherme Polo <ggpolo at gmail.com> added the comment: Hi Fergus, I would suggest using "if not data" to check for EOF ---------- nosy: +gpolo __________________________________ Tracker <report at bugs.python.org> <http://bugs.python.org/issue2489> __________________________________