summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.txt1
-rw-r--r--serial/serialposix.py5
2 files changed, 6 insertions, 0 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 7091cc1..16def23 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -463,6 +463,7 @@ Bugfixes (posix):
- [Bug pyserial:137] Patch to add non-standard baudrates to Cygwin
- [Bug pyserial:141] open: Pass errno from IOError to SerialException
- [Bug pyserial:125] Undefined 'base' on list_ports_posix.py, function usb_lsusb
+- [Bug pyserial:151] Serial.write() without a timeout uses 100% CPU on POSIX
- [Patch pyserial:30] [PATCH 1/1] serial.Serial() should not raise IOError.
Bugfixes (win32):
diff --git a/serial/serialposix.py b/serial/serialposix.py
index 131e31b..fa5c999 100644
--- a/serial/serialposix.py
+++ b/serial/serialposix.py
@@ -506,6 +506,11 @@ class PosixSerial(SerialBase):
_, ready, _ = select.select([], [self.fd], [], timeleft)
if not ready:
raise writeTimeoutError
+ else:
+ # wait for write operation
+ _, ready, _ = select.select([], [self.fd], [], None)
+ if not ready:
+ raise SerialException('write failed (select)')
d = d[n:]
tx_len -= n
except OSError, v: