monk-dot / killerbee

Automatically exported from code.google.com/p/killerbee
0 stars 1 forks source link

Serial library API mismatch causing TypeError: readline issue #4

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The TypeError: readline() argument is one I know of.

It is because of a Python Serial version issue, where they changed the 
definition for the function.

The error is in dev_freakduino.py, line 92 ( print "Line:", 
self.handle.readline(eol='&')). It is used for device detection of the 
Freakduino, and needs to be rewritten to just use the standard read() until it 
finds an '&' char, instead of trying to use the readline with eol keyword.

A temporary fix is that you can comment out the call to this function (or you 
can make that simple fix by adding a while loop). The comment out would be a 
few lines in __init__.py, starting at line 52 (elif 
kbutils.isfreakduino(self.dev)).

Original issue reported on code.google.com by rmspe...@gmail.com on 6 Jul 2011 at 8:03

GoogleCodeExporter commented 9 years ago
I have brute-forced this issue to remove the call to readline with the eol 
argument, and it now tries to read up to 100 characters (as a type of timeout 
protection) looking for the "&" symbol that marks the command delimiter we 
expect. This is fixed in revision 20. Please verify this works for you.

Original comment by rmspe...@gmail.com on 13 Aug 2011 at 1:39