Skip to content
This repository has been archived by the owner on Jul 18, 2022. It is now read-only.

pokecli.py and web.py must *both* run on python2 or 3 #324

Closed
infinitewarp opened this issue Jul 31, 2016 · 5 comments
Closed

pokecli.py and web.py must *both* run on python2 or 3 #324

infinitewarp opened this issue Jul 31, 2016 · 5 comments

Comments

@infinitewarp
Copy link
Collaborator

infinitewarp commented Jul 31, 2016

Not sure if this is an issue we want to deal with, but I've found that because of issues in zerorpc, you have to run both pokecli.py and web.py on either python2 or python3.

If you try running one of them on py2 and the other on py3, zerorpc fails to communicate with unspecified byte problems. Maybe this is just something we should throw into the README and say that we only support running both on the same version of Python.

Thoughts?

@infinitewarp infinitewarp changed the title pokecli.py and web.py must *both* run on the either python2 or 3 pokecli.py and web.py must *both* run on python2 or 3 Jul 31, 2016
@rirze
Copy link
Contributor

rirze commented Jul 31, 2016

That's strange, cause discussions in zerorpc-python say they've fixed this issue:
0rpc/zerorpc-python#108
0rpc/zerorpc-python@d61b45e

Is it an issue of a version requirement perhaps?
It looks more like an issue between the python 2 and python 3 version of the library. Only the python 3 library is backwards compatible and as far as I can search, I can't find the python 3 package being distributed in pip like python 2 is. Disregard this comment.

@infinitewarp
Copy link
Collaborator Author

Interesting.

For reference, when I run python2 pokecli.py -i 1 and python3 web.py and try to load one of the web pages, the cli says:

2016-07-31 00:23:56,739 [   channel] [WARNING] zerorpc.ChannelMultiplexer, unable to route event: <'\x00\xcao\xd2\x8a'> _zpc_hb {'response_to': '056867b5176842eea731c9f6665af575', 'message_id': '056867b6176842eea731c9f6665af575', 'v': 3} [...]

and in the browser the web response says:

zerorpc.exceptions.LostRemote
zerorpc.exceptions.LostRemote: Lost remote after 10s heartbeat

followed by the same stack trace that the web script says to stdout:

zerorpc.ChannelMultiplexer, unable to route event: <b''> OK {'message_id': 'fa87f484-bfdc-4e26-8b94-3eafa5c65640', 'v': 3, 'response_to': '056867b5176842eea731c9f6665af575'} [...]
127.0.0.1 - - [31/Jul/2016 00:24:06] "GET /[redacted] HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/Users/infinitewarp/.envs/poketrainer3/lib/python3.5/site-packages/flask/app.py", line 2000, in __call__
    return self.wsgi_app(environ, start_response)
  File "/Users/infinitewarp/.envs/poketrainer3/lib/python3.5/site-packages/flask/app.py", line 1991, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/Users/infinitewarp/.envs/poketrainer3/lib/python3.5/site-packages/flask/app.py", line 1567, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/infinitewarp/.envs/poketrainer3/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/Users/infinitewarp/.envs/poketrainer3/lib/python3.5/site-packages/flask/app.py", line 1988, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/infinitewarp/.envs/poketrainer3/lib/python3.5/site-packages/flask/app.py", line 1641, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/infinitewarp/.envs/poketrainer3/lib/python3.5/site-packages/flask/app.py", line 1544, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/infinitewarp/.envs/poketrainer3/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/Users/infinitewarp/.envs/poketrainer3/lib/python3.5/site-packages/flask/app.py", line 1639, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/infinitewarp/.envs/poketrainer3/lib/python3.5/site-packages/flask/app.py", line 1625, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Users/infinitewarp/Documents/code/poketrainer/web.py", line 67, in status
    latlng = c.current_location()
  File "/Users/infinitewarp/.envs/poketrainer3/src/zerorpc/zerorpc/core.py", line 278, in <lambda>
    return lambda *args, **kargs: self(method, *args, **kargs)
  File "/Users/infinitewarp/.envs/poketrainer3/src/zerorpc/zerorpc/core.py", line 270, in __call__
    return self._process_response(request_event, bufchan, timeout)
  File "/Users/infinitewarp/.envs/poketrainer3/src/zerorpc/zerorpc/core.py", line 227, in _process_response
    reply_event = bufchan.recv(timeout=timeout)
  File "/Users/infinitewarp/.envs/poketrainer3/src/zerorpc/zerorpc/channel.py", line 255, in recv
    event = self._input_queue.get(timeout=timeout)
  File "/Users/infinitewarp/.envs/poketrainer3/lib/python3.5/site-packages/gevent/queue.py", line 284, in get
    return self.__get_or_peek(self._get, block, timeout)
  File "/Users/infinitewarp/.envs/poketrainer3/lib/python3.5/site-packages/gevent/queue.py", line 261, in __get_or_peek
    result = waiter.get()
  File "/Users/infinitewarp/.envs/poketrainer3/lib/python3.5/site-packages/gevent/hub.py", line 878, in get
    return self.hub.switch()
  File "/Users/infinitewarp/.envs/poketrainer3/lib/python3.5/site-packages/gevent/hub.py", line 609, in switch
    return greenlet.switch(self)
zerorpc.exceptions.LostRemote: Lost remote after 10s heartbeat

@rirze
Copy link
Contributor

rirze commented Jul 31, 2016

Yah this seems completely out of our hands:
0rpc/zerorpc-python#37
0rpc/zerorpc-python#128

This is an active bug that they never got around to fixing...
Your idea to warn users of this problem is probably the better approach to this issue.

@infinitewarp
Copy link
Collaborator Author

That pull request adds some relevant notes to our README and tells users to pick one version of Python.

@jekirl
Copy link
Owner

jekirl commented Jul 31, 2016

agreed!

@jekirl jekirl closed this as completed Jul 31, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants