<div class="gmail_quote">On 25 September 2012 11:51, Mark Lawrence <span dir="ltr"><<a href="mailto:breamoreboy@yahoo.co.uk" target="_blank">breamoreboy@yahoo.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 25/09/2012 11:38, Oscar Benjamin wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
On 25 September 2012 08:27, Mark Lawrence <<a href="mailto:breamoreboy@yahoo.co.uk" target="_blank">breamoreboy@yahoo.co.uk</a>> wrote:<br>
<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
On 25/09/2012 03:32, Mark Adam wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Mon, Sep 24, 2012 at 5:55 PM, Oscar Benjamin<br>
<<a href="mailto:oscar.j.benjamin@gmail.com" target="_blank">oscar.j.benjamin@gmail.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
try:<br>
      f.pos = 256<br>
except IOError:<br>
      print('Unseekable file')<br>
</blockquote>
<br>
<br>
</blockquote></div>
Something along these lines <a href="http://docs.python.org/dev/**" target="_blank">http://docs.python.org/dev/**</a><br>
whatsnew/3.3.html#pep-3151-**<u></u>reworking-the-os-and-io-**<u></u>exception-hierarchy<<a href="http://docs.python.org/dev/whatsnew/3.3.html#pep-3151-reworking-the-os-and-io-exception-hierarchy" target="_blank">http://<u></u>docs.python.org/dev/whatsnew/<u></u>3.3.html#pep-3151-reworking-<u></u>the-os-and-io-exception-<u></u>hierarchy</a>>?<br>

</blockquote><div class="im">
<br>
<br>
I just tried to find out what error would be raised by seeking on a file<br>
that doesn't support seeking and II think it's just OSError in the reworked<br>
hierarchy. The error in Python 2.7 is<br>
<br>
Traceback (most recent call last):<br>
   File "tmp.py", line 2, in <module><br>
     sys.stdin.seek(5)<br>
IOError: [Errno 29] Illegal seek<br>
<br>
This corresponds to ESPIPE from errno.h which isn't referred to anywhere in<br>
pip 3151:<br>
<a href="http://www.python.org/dev/peps/pep-3151/" target="_blank">http://www.python.org/dev/<u></u>peps/pep-3151/</a><br>
<br>
So I guess it would still need to be<br>
<br>
try:<br>
     f.pos = 256<br>
except OSError as e:<br>
     if e.errno != 29:<br>
         raise<br>
     print('Unseekable file')<br>
<br>
Oscar<br>
<br>
<br>
<br>
</div></blockquote>
<br>
The thing I was thinking of is actually in the thread "syntax to continue into the next subsequent except block" over on Python ideas.</blockquote><div><br></div><div>This?</div><div><br></div>try:<br>     f.pos = 256<br>
except OSError as e if e.errno == 29:<br>     print('Unseekable file')</div><div class="gmail_quote"><br></div><div class="gmail_quote"><div>Oscar</div></div>