title: serial.Serial.readline() raises SerialException, but the same code worked a week ago
body: <p>I have a pair of applications that communicate by sending text (in one direction only) over a serial port.  They have been working great for a while.  Last week the reading side stopped working <em>on my machine</em>, and raises a <code>SerialException</code> whenever I call the <code>readline()</code> method of my <code>serial.Serial</code> object.  <em>The same code works fine on another machine!</em>  The only thing I can think of that could have caused a problem is that I installed a bunch of system updates the night before this happened (Any idea how to see the history on <em>that</em>?).  I'm using Ubuntu and Python 2.7.6 (see below), and as far as I can tell I have the same python packages installed on both machines.</p>
  
  <p>I've written two small sample apps to try to troubleshoot, and am getting the following error on the reading side:</p>
  
  <pre><code>File "./reader.py", line 16, in &lt;module&gt;
    s = port.readline()
  File "/usr/local/lib/python2.7/dist-packages/serial/serialposix.py", line 475, in read
    raise SerialException('device reports readiness to read but returned no data (device disconnected or multiple access on port?)')
  </code></pre>
  
  <p>It doesn't seem to matter whether I use a "real" port or a "virtual" port, so this can be reproduced by creating two virtual ports with the following command:</p>
  
  <pre><code>socat -d -d pty,raw,echo=0 pty,raw,echo=0
  </code></pre>
  
  <p>Here is the sample "writer.py" that I created for troubleshooting:</p>
  
  <pre><code>#!/usr/bin/env python
  from __future__ import print_function
  import serial
  
  print( 'Opening port' )
  port = serial.Serial( port='/dev/pts/5',  # Substitute the correct port here!
                        baudrate=115200,
                        bytesize=serial.EIGHTBITS,
                        parity=serial.PARITY_NONE,
                        stopbits=serial.STOPBITS_ONE,
                        timeout=0.25 )
  while True:
      s = raw_input()
      if s:
          port.write( s + '\n' )
  </code></pre>
  
  <p>This works great - I can read the text coming through the port using an app like "Serial port terminal" or such.</p>
  
  <p>Here is the sample "reader.py" that works find on another machine but fails immediately on mine:</p>
  
  <pre><code>#!/usr/bin/env python
  from __future__ import print_function
  import serial
  
  print( 'Opening port' )
  port = serial.Serial( port='/dev/pts/10',
                        baudrate=115200,
                        bytesize=serial.EIGHTBITS,
                        parity=serial.PARITY_NONE,
                        stopbits=serial.STOPBITS_ONE,
                        timeout=0.25 )
  while True:
      s = port.readline()
      if s:
          print( s )
  </code></pre>
  
  <p>Once I create the virtual port with the <code>socat</code> command and run "reader.py", I always get the exception immediately.  Any ideas what might have changed on my machine that would cause this failure?</p>
  
  <p>System info:</p>
  
  <pre><code>~/temp$ uname -a
  Linux alonghi-ubu 3.13.0-65-generic #105-Ubuntu SMP Mon Sep 21 18:50:58 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
  ~/temp$ python --version
  Python 2.7.6
  </code></pre>