Intermittent Failure on Serial Port

Serge Orlov Serge.Orlov at gmail.com
Sun Jun 11 09:37:40 EDT 2006


H J van Rooyen wrote:
> Serge Orloff wrote:
>
> | H J van Rooyen wrote:
> | > Traceback (most recent call last):
> | >   File "portofile.py", line 232, in ?
> | >     ret_val = main_routine(port, pollstruct, pfifo)
> | >   File "portofile.py", line 108, in main_routine
> | >     send_nak(port, timeout)      # so bad luck - comms error
> | >   File "/home/hvr/Polling/lib/readerpoll.py", line 125, in send_nak
> | >     port.flush()
> | > IOError: [Errno 29] Illegal seek
> | > close failed: [Errno 29] Illegal seek
> | >
> |
> |
> | > Where can I find out what the Errno 29 really means?
> | > Is this Python, the OS or maybe hardware?
> |
> | It is from kernel: grep -w 29 `locate errno`
> | /usr/include/asm-generic/errno-base.h: #define   ESPIPE          29
> |  /* Illegal seek */
> |
> | man lseek:
> |
> | ERRORS:
> |         ESPIPE fildes is associated with a pipe, socket, or FIFO.
> |
> | RESTRICTIONS:
> |         Linux  specific  restrictions:  using  lseek  on  a  tty device
> | returns ESPIPE.
>
>
> Thanks for the info - so the Kernel sometimes bombs me out - does anybody know
> why the python flush sometimes calls lseek?

I thought it was your own flush method. If it is file.flush method that
makes the issue more complicated, since stdlib file.flush doesn't call
lseek method. I suggest you run your program using strace to log system
calls, without such log it's pretty hard to say what's going on. The
most interesting part is the end, but make sure you have enough space
for the whole log, it's going to be big.




More information about the Python-list mailing list