New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Errors with bytes as strings in python3 #49
Comments
Thanks very much. I will update it as you suggested. |
@qiuwch @jskinn I am on Anaconda 3.5.2 on Win, did not install via pip, changed init.py as above and then python3 setup.py install. I can connect to the server (client.isconnected() == True), but then I am running always into timeout (ERROR:init:317:Can not receive a response from server, timeout after 5.00 seconds) when requesting from server (i.e. e.g. filename = client.request('vget /camera/0/lit') ). My questions:
|
Ok I found server logs (RealisticRendering-Win64-65d6144-171cd97\WindowsNoEditor\RealisticRendering\Saved\Logs) and the following lines seem to indicate that port 9000 might indeed be already in use:
So I guess I need to find a way to make the server listen on another port. |
I have been running To try answering my own question if port on the server side can be easily set to something else: it doesn't seem so, it seems that port is hard coded (alongside image resolution 640x480) into constructor unrealcv\Source\UnrealCV\Public\ServerConfig.h. |
My above statement about port is not true, see #35. Sorry for having cluttered this thread a bit. |
@jskinn Hello, did you try to get image? For me, normal string works after your modification, but image data doesn't work. |
I have tried, and my get image doesn't work either. These modifications were suggested before get image was available in the API. |
@qiuwch I'm not the original poster, but I ran into the same issue a while back and fixed it with a stopgap as well. After reinstalling unrealcv with your command, I am having no issues. Thanks for the assistance! |
With the fix from #65, and multiple reports of unrealcv working with python3, I think this issue can be closed. |
Yep, can confirm it works for me now in python 3. Thanks |
The current client version installed with pip does not work with python 3.
It's close, the only issue is the use of strings as byte arrays.
This can be solved by changing __init__.py as follows, which work for both python3.4 and python 2.7 (I tested on 3.4.3 and 2.7.6):
line 73:
payload = b""
line 87:
return payload.decode('UTF-8')
line 109:
wfile.write(payload.encode('UTF-8'))
This has the added benefit of ensuring the character encoding is the same in both client and server code.
Thanks.
The text was updated successfully, but these errors were encountered: