diff options
-rw-r--r-- | CHANGES.txt | 3 | ||||
-rw-r--r-- | LICENSE.txt | 2 | ||||
-rw-r--r-- | serial/serialposix.py | 6 | ||||
-rw-r--r-- | serial/serialwin32.py | 4 |
4 files changed, 11 insertions, 4 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 3dee174..c23f406 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -257,6 +257,9 @@ Bugfixes (posix): - [Bug 1554183] setRTS/setDTR refrence to nonexisting local "on" - [Bug 1513653] file descriptor not closed when exception is thrown +- FreeBSD now uses cuadX instead of cuaaX (Patrick Phalen) +- Check for string in write function. Using uncode causes strange errors, this + helps catching errors early (Tom Lynn) Bugfixes (win32): diff --git a/LICENSE.txt b/LICENSE.txt index 12eddd3..e8664f4 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2001-2004 Chris Liechti <cliechti@gmx.net>; +Copyright (c) 2001-2008 Chris Liechti <cliechti@gmx.net>; All Rights Reserved. This is the Python license. In short, you can use this product in diff --git a/serial/serialposix.py b/serial/serialposix.py index 61252e2..4538707 100644 --- a/serial/serialposix.py +++ b/serial/serialposix.py @@ -13,7 +13,7 @@ import sys, os, fcntl, termios, struct, select, errno from serialutil import * -VERSION = "$Revision: 1.34 $".split()[1] #extract CVS version +VERSION = "$Revision: 1.35 $".split()[1] #extract CVS version #Do check the Python version as some constants have moved. if (sys.hexversion < 0x020100f0): @@ -46,7 +46,7 @@ elif plat[:3] == 'bsd' or \ plat[:7] == 'openbsd' or \ plat[:6] == 'darwin': #BSD (confirmed for freebsd4: cuaa%d) def device(port): - return '/dev/cuaa%d' % port + return '/dev/cuad%d' % port elif plat[:6] == 'netbsd': #NetBSD 1.6 testing by Erk def device(port): @@ -326,6 +326,8 @@ class Serial(SerialBase): def write(self, data): """Output the given string over the serial port.""" if self.fd is None: raise portNotOpenError + if not isinstance(data, str): + raise TypeError('expected str, got %s' % type(data)) t = len(data) d = data while t > 0: diff --git a/serial/serialwin32.py b/serial/serialwin32.py index f0d447b..004c3d1 100644 --- a/serial/serialwin32.py +++ b/serial/serialwin32.py @@ -11,7 +11,7 @@ import win32event # We use events and the WaitFor[Single|Multiple]Objects functi import win32con # constants. from serialutil import * -VERSION = "$Revision: 1.35 $".split()[1] #extract CVS version +VERSION = "$Revision: 1.36 $".split()[1] #extract CVS version #from winbase.h. these should realy be in win32con MS_CTS_ON = 16 @@ -216,6 +216,8 @@ class Serial(SerialBase): def write(self, data): """Output the given string over the serial port.""" if not self.hComPort: raise portNotOpenError + if not isinstance(data, str): + raise TypeError('expected str, got %s' % type(data)) #print repr(s), if data: #~ win32event.ResetEvent(self._overlappedWrite.hEvent) |