Bug 11156 - In python3 module 'socket' has no attribute 'AF_BLUETOOTH'
Summary: In python3 module 'socket' has no attribute 'AF_BLUETOOTH'
Status: RESOLVED FIXED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: 2018.05
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-16 19:14 UTC by Grzegorz Blach
Modified: 2018-11-02 10:16 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
Support for socket.AF_BLUETOOTH (1.10 KB, patch)
2018-07-17 11:18 UTC, Grzegorz Blach
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Grzegorz Blach 2018-07-16 19:14:12 UTC
I have build system image for RaspberryPi 2 using `make raspberrypi2_defconfig` with some customization. For eg. I have enabled bluez-tools, bluez-utils 5.x, rpi-bt-firmware and of course python3. When I try to create bluetooth socket, I get an error:

Python 3.6.3 (default, Jul 16 2018, 20:00:50) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> s = socket.socket(socket.AF_BLUETOOTH, socket.SOCK_STREAM, socket.BTPROTO_RFCOMM)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'socket' has no attribute 'AF_BLUETOOTH'


Bluetooth sockets works correctly in python3 on Raspbian.
Comment 1 Grzegorz Blach 2018-07-17 11:18:51 UTC
Created attachment 7666 [details]
Support for socket.AF_BLUETOOTH

Ok, I found a solution, but unfortunately my patch makes a circular dependencies, so I must disable libmount Python bindings.