pvdao / pybluez

Automatically exported from code.google.com/p/pybluez
GNU General Public License v2.0
0 stars 0 forks source link

python3 UnicodeDecodeError in DeviceDiscoverer find_devices #67

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1.  I'm using bluez package 5.19-1 on arch linux arm
     Linux alarmpi 3.12.21-1-ARCH #1 PREEMPT Sat Jun 7 07:17:37 MDT 2014 armv6l GNU/Linux
2.  Using the python3.4.1 and pybluez packages for that platform
3.  Simple discoverer script:

#!/usr/bin/env python3
import bluetooth

discoverer = bluetooth.bluez.DeviceDiscoverer()
discoverer.find_devices()

4. Output is 

Traceback (most recent call last):
  File "./inquiry2.py", line 5, in <module>
    discoverer.find_devices()
  File "/usr/lib/python3.4/site-packages/bluetooth/bluez.py", line 389, in find_devices
    _bt.hci_filter_all_events (flt)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 4: invalid 
start byte

5.  What I suspect is going on here is that a Python is using str objects, and 
the underlying library is trying to store 8bit ascii bytes in them.

Original issue reported on code.google.com by robert.s...@gmail.com on 14 Jun 2014 at 4:12

GoogleCodeExporter commented 8 years ago
Confirming.

Original comment by adys...@gmail.com on 11 Aug 2014 at 5:26

GoogleCodeExporter commented 8 years ago
The problem stems from this call:

>>> 
bluetooth._bluetooth.hci_filter_all_events('\x00\x00\x00\x00\x00\x00\x00\x00\x00
\x00\x00\x00\x00\x00\x00\x00')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 4: invalid 
start byte

Original comment by adys...@gmail.com on 11 Aug 2014 at 5:29

GoogleCodeExporter commented 8 years ago

Original comment by karu...@wp.pl on 1 Feb 2015 at 6:56