Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #80923

Re: Interrupted system call

References <54685C24.9040208@bellfamily.org.uk>
Date 2014-11-17 09:13 +1100
Subject Re: Interrupted system call
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.15915.1416176041.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Sun, Nov 16, 2014 at 7:11 PM, Peter Bell <peter@bellfamily.org.uk> wrote:
>   File "/usr/lib/python3.4/site-packages/serial/serialposix.py", line 480,
> in read
>     if e[0] != errno.EAGAIN:
> TypeError: 'InterruptedError' object is not subscriptable
> =====================================================================
>
>
> I'm not sure how to address the 'InterruptedError'.  Can it/should it be
> masked at the user code level with a 'try:' block?  Or is there another way
> to deal with it?

At this stage, you're not getting it, because of the cascaded error,
so that's the thing to deal with.

> I presume that the subsequent error (TypeError) indicates some fault in the
> system level library.  I'm not sure where/how to report this.

Not system-level. According to the traceback, that's coming from line
480 of something in site-packages, which probably means it was
installed with pip or equivalent. Do you know where you got hold of
this module from? That's who to report this to.

It's trying to retrieve the errno from the exception. I suspect the
code was written for Python 2, and you're using it with Python 3. It's
probably possible to shorten/simplify the code somewhat.

ChrisA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Interrupted system call Chris Angelico <rosuav@gmail.com> - 2014-11-17 09:13 +1100

csiph-web