Hypatia
Hypatia

Reputation: 1

PyObex from socket import MSG_WAITALL

UPDATE: I was able to get this working on a Linux OS with Python 2.7 and PyOBEX. I still don't know the cause of the below, but suspect that it is due to my machine being windows or the way I installed it.

I am looking to send files with OBEX (OBject EXchange) from an Android. I am working with Windows 10. I have installed PyBluez and PyOBEX. I am trying to run the example given on the PyOBEX documentation page.

from PyOBEX.client import BrowserClient
port = 12
addr = '5C:AF:06:E1:81:7B'
client = BrowserClient(addr, port)
client.connect()
client.listdir()
client.disconnect()

But I am getting this error when I try to import.

File "pyobexTest", line 1, in from PyOBEX.client import BrowserClient File "C:\Python27\lib\site-packages\PyOBEX\client.py", line 26, in from common import OBEX_Version File "C:\Python27\lib\site-packages\PyOBEX\common.py", line 24, in from socket import MSG_WAITALL ImportError: cannot import name MSG_WAITALL

I was following this link: Python and Bluetooth/OBEX, where I saw that someone with XP got this same message. Does this mean that PyOBEX doesn't work for Windows 10? Is there a way to correct this error or perhaps another library that would be more effective for Windows? Btw, I am using Python 2.7 (I also tried 3.6 and that seemed to also have some issues).

Upvotes: 0

Views: 588

Answers (1)

David Boddie
David Boddie

Reputation: 1046

Sorry to hear that you had problems on Windows, especially as it was so recently, because the MSG_WAITALL problems on Windows were fixed quite a long time ago but the fix may not be in the PyPI distributed versions of PyOBEX.

The package is maintained and distributed from this repository these days:

https://bitbucket.org/dboddie/pyobex

PyOBEX should also work with Python 3 but you will need to use the python3 branch instead of the default branch.

Upvotes: 1

Related Questions