Title: '' object has no attribute '_register_selector'
Type: behaviour Severity: normal
Components: Any Versions: Jython 2.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: BjarkeBB, zyasoft
Priority: Keywords:

Created on 2017-05-08.11:13:35 by BjarkeBB, last changed 2017-05-19.03:01:30 by zyasoft.

File name Uploaded Description Edit Remove
rc.log BjarkeBB, 2017-05-08.11:13:35
msg11363 (view) Author: Bjarke B. Blendstrup (BjarkeBB) Date: 2017-05-08.11:17:23
I'm trying to use the carreralib

When I execute the connection from python, it works:
[root@CLOUDCITY ~]# python
Python 2.7.10 (default, Jun 20 2016, 14:45:40) 
[GCC 5.3.1 20160406 (Red Hat 5.3.1-6)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from carreralib import ControlUnit
>>> cu = ControlUnit('FF:B8:21:1D:DF:7F')
>>> cu.request()
Status(fuel=(0, 0, 0, 0, 0, 0, 0, 0), start=0, mode=2, pit=(False, False, False, False, False, False, False, False), display=8)

But when I try to do the same via Jython, I get the attached exception from the ControlUnit constructor.

My java code:
PythonInterpreter python = new PythonInterpreter();
python.exec("import sys");
python.exec("from carreralib import ControlUnit");
python.exec("cu = ControlUnit('FF:B8:21:1D:DF:7F')");

My project is a spring-boot project, and I use the mvn package:
msg11364 (view) Author: Jim Baker (zyasoft) Date: 2017-05-08.16:34:05
Ordinary files, as wrapped by, cannot be selected on in Jython, only sockets; see (including possible future directions).

But the exception thrown should be better. Most likely we can follow whatever is done with respect to CPython on Windows, which has a similar restriction.
msg11365 (view) Author: Bjarke B. Blendstrup (BjarkeBB) Date: 2017-05-08.17:07:14
AFAIK it's trying to open a BlueTooth connection - is that not a socket?

But then again, I might not know what I'm talking about...
msg11383 (view) Author: Jim Baker (zyasoft) Date: 2017-05-19.03:01:30
It is a socket, but I don't know if there's good Java support for such sockets. Maybe we could to support AF_BLUETOOTH?
Date User Action Args
2017-05-19 03:01:30zyasoftsetmessages: + msg11383
2017-05-08 17:07:14BjarkeBBsetmessages: + msg11365
2017-05-08 16:34:06zyasoftsetnosy: + zyasoft
messages: + msg11364
2017-05-08 11:17:24BjarkeBBsetmessages: + msg11363
2017-05-08 11:13:35BjarkeBBcreate