fixes for RTS/DTR handling on open (#59)
- internal RTS/DTR state defaults to None
- serialwin32 and serialcli platforms override that to True (as before)
- serialposix leaves it unset and therefore does not touch RTS/DTR on open
(as it was in pySerial 2.7 and before)
diff --git a/serial/serialwin32.py b/serial/serialwin32.py
index 658f13f..9e300e1 100644
--- a/serial/serialwin32.py
+++ b/serial/serialwin32.py
@@ -39,6 +39,11 @@
raise SerialException("Port must be configured before it can be used.")
if self.is_open:
raise SerialException("Port is already open.")
+ # if RTS and/or DTR are not set before open, they default to True
+ if self._rts_state is None:
+ self._rts_state = True
+ if self._dtr_state is None:
+ self._dtr_state = True
# the "\\.\COMx" format is required for devices other than COM1-COM8
# not all versions of windows seem to support this properly
# so that the first few ports are used with the DOS device name