You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My first install of IPython Notebook on Python 3 (albeit a somewhat venerable one) in a clean virtualenv gave me a stack trace when I tried to access it from the web. The problem arises in tornado/escape.py.
It appears the issue is that neither of the two alternative imports of parse_qs at line 37 (urllib.parse or cgi) make provision for an "encoding" or "errors" keyword argument, which unfortunately parse_qs_bytes is providing both of on line 151.
For the record, removing the arguments to leave line 150 reading
result = parse_qs(qs, keep_blank_values, strict_parsing)
seems superficially to work, but I have not considered the wider ramifications as I do not currently have either the context or the headspace to do so. The real solution for me is to upgrade my Python 3 to version 3.2 or better, which makes those keyword arguments admissible in urllib.urlparse.parse_qs.
This is on Python 3.1.3, MacOS 10.6.8 with the following pip-installed packages supporting
Traceback follows. Feel free to close this issue immediately if you aren't supporting Python 3.1.
(py3)AirHead:~ sholden$ ipython3 notebook
[NotebookApp] Using existing profile dir: '/Users/sholden/.ipython/profile_default'
[NotebookApp] Serving notebooks from /Users/sholden
[NotebookApp] The port 8888 is already in use, trying another random port.
[NotebookApp] The IPython Notebook is running at: http://127.0.0.1:8889/
[NotebookApp] Use Control-C to stop this server and shut down all kernels.
ERROR:root:Uncaught exception, closing connection.
Traceback (most recent call last):
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/iostream.py", line 311, in wrapper
callback(_args)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 256, in _on_headers
headers=headers, remote_ip=remote_ip)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 391, in init
arguments = parse_qs_bytes(self.query)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/escape.py", line 151, in parse_qs_bytes
encoding='latin1', errors='strict')
TypeError: parse_qs() got an unexpected keyword argument 'encoding'
ERROR:root:Exception in callback <zmq.eventloop.stack_context._StackContextWrapper object at 0x1021e0628>
Traceback (most recent call last):
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/zmq/eventloop/ioloop.py", line 440, in _run_callback
callback()
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/iostream.py", line 311, in wrapper
callback(_args)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 256, in _on_headers
headers=headers, remote_ip=remote_ip)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 391, in init
arguments = parse_qs_bytes(self.query)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/escape.py", line 151, in parse_qs_bytes
encoding='latin1', errors='strict')
TypeError: parse_qs() got an unexpected keyword argument 'encoding'
ERROR:root:Uncaught exception, closing connection.
Traceback (most recent call last):
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/iostream.py", line 311, in wrapper
callback(_args)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 256, in _on_headers
headers=headers, remote_ip=remote_ip)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 391, in init
arguments = parse_qs_bytes(self.query)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/escape.py", line 151, in parse_qs_bytes
encoding='latin1', errors='strict')
TypeError: parse_qs() got an unexpected keyword argument 'encoding'
ERROR:root:Exception in callback <zmq.eventloop.stack_context._StackContextWrapper object at 0x1022a5cb0>
Traceback (most recent call last):
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/zmq/eventloop/ioloop.py", line 440, in _run_callback
callback()
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/iostream.py", line 311, in wrapper
callback(_args)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 256, in _on_headers
headers=headers, remote_ip=remote_ip)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 391, in init
arguments = parse_qs_bytes(self.query)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/escape.py", line 151, in parse_qs_bytes
encoding='latin1', errors='strict')
TypeError: parse_qs() got an unexpected keyword argument 'encoding'
ERROR:root:Uncaught exception, closing connection.
Traceback (most recent call last):
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/iostream.py", line 311, in wrapper
callback(_args)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 256, in _on_headers
headers=headers, remote_ip=remote_ip)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 391, in init
arguments = parse_qs_bytes(self.query)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/escape.py", line 151, in parse_qs_bytes
encoding='latin1', errors='strict')
TypeError: parse_qs() got an unexpected keyword argument 'encoding'
ERROR:root:Exception in callback <zmq.eventloop.stack_context._StackContextWrapper object at 0x1022a5e10>
Traceback (most recent call last):
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/zmq/eventloop/ioloop.py", line 440, in _run_callback
callback()
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/iostream.py", line 311, in wrapper
callback(_args)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 256, in _on_headers
headers=headers, remote_ip=remote_ip)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 391, in init
arguments = parse_qs_bytes(self.query)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/escape.py", line 151, in parse_qs_bytes
encoding='latin1', errors='strict')
TypeError: parse_qs() got an unexpected keyword argument 'encoding'
ERROR:root:Uncaught exception, closing connection.
Traceback (most recent call last):
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/iostream.py", line 311, in wrapper
callback(_args)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 256, in _on_headers
headers=headers, remote_ip=remote_ip)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 391, in init
arguments = parse_qs_bytes(self.query)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/escape.py", line 151, in parse_qs_bytes
encoding='latin1', errors='strict')
TypeError: parse_qs() got an unexpected keyword argument 'encoding'
ERROR:root:Exception in callback <zmq.eventloop.stack_context._StackContextWrapper object at 0x1022a5f70>
Traceback (most recent call last):
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/zmq/eventloop/ioloop.py", line 440, in _run_callback
callback()
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/iostream.py", line 311, in wrapper
callback(_args)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 256, in _on_headers
headers=headers, remote_ip=remote_ip)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 391, in init
arguments = parse_qs_bytes(self.query)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/escape.py", line 151, in parse_qs_bytes
encoding='latin1', errors='strict')
TypeError: parse_qs() got an unexpected keyword argument 'encoding'
The text was updated successfully, but these errors were encountered:
We did support Python 3.1 up to our 0.13 release, I think. But if there's a bug in Tornado, you'll need to contact them. It looks like they don't support 3.1 (here's a previous PR), but if you want to try, that's up to you.
But really, I think you're better off just upgrading Python. Support for Python 3 is improving fast, but all the projects I've seen take 3.2 as the minimum.
My first install of IPython Notebook on Python 3 (albeit a somewhat venerable one) in a clean virtualenv gave me a stack trace when I tried to access it from the web. The problem arises in tornado/escape.py.
It appears the issue is that neither of the two alternative imports of parse_qs at line 37 (urllib.parse or cgi) make provision for an "encoding" or "errors" keyword argument, which unfortunately parse_qs_bytes is providing both of on line 151.
For the record, removing the arguments to leave line 150 reading
seems superficially to work, but I have not considered the wider ramifications as I do not currently have either the context or the headspace to do so. The real solution for me is to upgrade my Python 3 to version 3.2 or better, which makes those keyword arguments admissible in urllib.urlparse.parse_qs.
This is on Python 3.1.3, MacOS 10.6.8 with the following pip-installed packages supporting
distribute==0.6.24
ipython==0.13.1
pyzmq==2.2.0.1
tornado==2.4.1
wsgiref==0.1.2
Traceback follows. Feel free to close this issue immediately if you aren't supporting Python 3.1.
(py3)AirHead:~ sholden$ ipython3 notebook
[NotebookApp] Using existing profile dir: '/Users/sholden/.ipython/profile_default'
[NotebookApp] Serving notebooks from /Users/sholden
[NotebookApp] The port 8888 is already in use, trying another random port.
[NotebookApp] The IPython Notebook is running at: http://127.0.0.1:8889/
[NotebookApp] Use Control-C to stop this server and shut down all kernels.
ERROR:root:Uncaught exception, closing connection.
Traceback (most recent call last):
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/iostream.py", line 311, in wrapper
callback(_args)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 256, in _on_headers
headers=headers, remote_ip=remote_ip)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 391, in init
arguments = parse_qs_bytes(self.query)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/escape.py", line 151, in parse_qs_bytes
encoding='latin1', errors='strict')
TypeError: parse_qs() got an unexpected keyword argument 'encoding'
ERROR:root:Exception in callback <zmq.eventloop.stack_context._StackContextWrapper object at 0x1021e0628>
Traceback (most recent call last):
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/zmq/eventloop/ioloop.py", line 440, in _run_callback
callback()
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/iostream.py", line 311, in wrapper
callback(_args)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 256, in _on_headers
headers=headers, remote_ip=remote_ip)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 391, in init
arguments = parse_qs_bytes(self.query)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/escape.py", line 151, in parse_qs_bytes
encoding='latin1', errors='strict')
TypeError: parse_qs() got an unexpected keyword argument 'encoding'
ERROR:root:Uncaught exception, closing connection.
Traceback (most recent call last):
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/iostream.py", line 311, in wrapper
callback(_args)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 256, in _on_headers
headers=headers, remote_ip=remote_ip)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 391, in init
arguments = parse_qs_bytes(self.query)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/escape.py", line 151, in parse_qs_bytes
encoding='latin1', errors='strict')
TypeError: parse_qs() got an unexpected keyword argument 'encoding'
ERROR:root:Exception in callback <zmq.eventloop.stack_context._StackContextWrapper object at 0x1022a5cb0>
Traceback (most recent call last):
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/zmq/eventloop/ioloop.py", line 440, in _run_callback
callback()
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/iostream.py", line 311, in wrapper
callback(_args)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 256, in _on_headers
headers=headers, remote_ip=remote_ip)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 391, in init
arguments = parse_qs_bytes(self.query)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/escape.py", line 151, in parse_qs_bytes
encoding='latin1', errors='strict')
TypeError: parse_qs() got an unexpected keyword argument 'encoding'
ERROR:root:Uncaught exception, closing connection.
Traceback (most recent call last):
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/iostream.py", line 311, in wrapper
callback(_args)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 256, in _on_headers
headers=headers, remote_ip=remote_ip)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 391, in init
arguments = parse_qs_bytes(self.query)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/escape.py", line 151, in parse_qs_bytes
encoding='latin1', errors='strict')
TypeError: parse_qs() got an unexpected keyword argument 'encoding'
ERROR:root:Exception in callback <zmq.eventloop.stack_context._StackContextWrapper object at 0x1022a5e10>
Traceback (most recent call last):
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/zmq/eventloop/ioloop.py", line 440, in _run_callback
callback()
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/iostream.py", line 311, in wrapper
callback(_args)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 256, in _on_headers
headers=headers, remote_ip=remote_ip)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 391, in init
arguments = parse_qs_bytes(self.query)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/escape.py", line 151, in parse_qs_bytes
encoding='latin1', errors='strict')
TypeError: parse_qs() got an unexpected keyword argument 'encoding'
ERROR:root:Uncaught exception, closing connection.
Traceback (most recent call last):
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/iostream.py", line 311, in wrapper
callback(_args)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 256, in _on_headers
headers=headers, remote_ip=remote_ip)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 391, in init
arguments = parse_qs_bytes(self.query)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/escape.py", line 151, in parse_qs_bytes
encoding='latin1', errors='strict')
TypeError: parse_qs() got an unexpected keyword argument 'encoding'
ERROR:root:Exception in callback <zmq.eventloop.stack_context._StackContextWrapper object at 0x1022a5f70>
Traceback (most recent call last):
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/zmq/eventloop/ioloop.py", line 440, in _run_callback
callback()
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/iostream.py", line 311, in wrapper
callback(_args)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 256, in _on_headers
headers=headers, remote_ip=remote_ip)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/httpserver.py", line 391, in init
arguments = parse_qs_bytes(self.query)
File "/Users/sholden/.virtualenvs/py3/lib/python3.1/site-packages/tornado/escape.py", line 151, in parse_qs_bytes
encoding='latin1', errors='strict')
TypeError: parse_qs() got an unexpected keyword argument 'encoding'
The text was updated successfully, but these errors were encountered: