summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2008-06-16 22:59:20 +0000
committercliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2008-06-16 22:59:20 +0000
commiteaa968801f2eeb7cfe71bd885ab6f5c0cd39d252 (patch)
tree2867f92e7886cb27784e4abf39efca33efc9c7d5
parent9c592b3a8d2b044f43771677abd369cf868e2ce9 (diff)
downloadpyserial-git-eaa968801f2eeb7cfe71bd885ab6f5c0cd39d252.tar.gz
- check for strings patch
- FreeBSD device name patch - update history
-rw-r--r--pyserial/CHANGES.txt3
-rw-r--r--pyserial/LICENSE.txt2
-rw-r--r--pyserial/serial/serialposix.py6
-rw-r--r--pyserial/serial/serialwin32.py4
4 files changed, 11 insertions, 4 deletions
diff --git a/pyserial/CHANGES.txt b/pyserial/CHANGES.txt
index 3dee174..c23f406 100644
--- a/pyserial/CHANGES.txt
+++ b/pyserial/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/pyserial/LICENSE.txt b/pyserial/LICENSE.txt
index 12eddd3..e8664f4 100644
--- a/pyserial/LICENSE.txt
+++ b/pyserial/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/pyserial/serial/serialposix.py b/pyserial/serial/serialposix.py
index 61252e2..4538707 100644
--- a/pyserial/serial/serialposix.py
+++ b/pyserial/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/pyserial/serial/serialwin32.py b/pyserial/serial/serialwin32.py
index f0d447b..004c3d1 100644
--- a/pyserial/serial/serialwin32.py
+++ b/pyserial/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)