niklasb / webkit-server

[not actively maintained] The C++ webkit-server from capybara-webkit with useful extensions and Python bindings
MIT License
48 stars 38 forks source link

python3 support #15

Open a358003542 opened 9 years ago

a358003542 commented 9 years ago

I am not master of python , modified this now can run under python3 ,

1.

webkit_server.py line124: raise NodeError, "Unselect not allowed."

changed to raise NodeError("Unselect not allowed.")

the same line 401: raise NoX11Error("Cannot connect to X. You can try running with xvfb-run.") the same line 462: raise NoResponseError("No response received from server.") the same line 465: raise InvalidResponseError(self._read_message()) the same line 484: raise EndOfStreamError("Unexpected end of stream.")

  1. line 399 self._port = int(re.search("port: (\d+)", output.decode()).group(1))
  2. send bytes line 454 self._sock.send(bytes(arg,'utf-8'))

line 502 self._sock.send(bytes(line + "\n",'utf-8'))#

  1. recv decode line 495 c = c.decode('utf-8')#
  2. line 487 return b''.join(result)#
niklasb commented 9 years ago

Do you want to open a pull request for the changes? It would be nice to have a version that works with 2.7 as well as 3.4

a358003542 commented 9 years ago

in fact i am not good at about the transport problem about python2 to python3. i will do the modification of the raise error part , but last decode and encode and bytes and str problem , i am a little comfuse about that so i will not modified.

2015-01-28 19:22 GMT+08:00 Niklas Baumstark notifications@github.com:

Do you want to open a pull request for the changes? It would be nice to have a version that works with 2.7 as well as 3.4

— Reply to this email directly or view it on GitHub https://github.com/niklasb/webkit-server/issues/15#issuecomment-71818463 .