title: pySerial buffer won't flush
body: <p>I'm having a problem with serial IO under both Windows and Linux using pySerial.  With this code the device never receives the command and the read times out:</p>
  
  <pre><code>import serial
  ser = serial.Serial('/dev/ttyUSB0',9600,timeout=5)
  ser.write("get")
  ser.flush()
  print ser.read()
  </code></pre>
  
  <p>This code times out the first time through, but subsequent iterations succeed:</p>
  
  <pre><code>import serial
  ser = serial.Serial('/dev/ttyUSB0',9600,timeout=5)
  while True:
      ser.write("get")
      ser.flush()
      print ser.read()
  </code></pre>
  
  <p>Can anyone tell what's going on?  I tried to add a call to sync() but it wouldn't take a serial object as it's argument.</p>
  
  <p>Thanks,
  Robert</p>