%jigsaw magic broken: missing 2 required positional arguments: 'width' and 'height' for self.kernel.Display(IFrame(iframe))
cathalmccabe opened this issue · comments
Cathal McCabe commented
I see the following error when running the example in BinderHub, and also on a local platform.
import metakernel
metakernel.register_ipython_magics()
%jigsaw Python --workspace mynewProgram
Error in calling magic 'jigsaw' on line:
URL can't contain control characters. '/jigsaw/Python --workspace mynewProgram.html' (found at least ' ')
args: ['Python']
kwargs: {'workspace': 'mynewProgram'}
Traceback (most recent call last):
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/metakernel/magic.py", line 96, in call_magic
func(*args, **kwargs)
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/metakernel/magics/jigsaw_magic.py", line 189, in line_jigsaw
self.kernel.Display(IFrame(iframe))
**TypeError: __init__() missing 2 required positional arguments: 'width' and 'height'**
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/metakernel/magic.py", line 98, in call_magic
func(old_args)
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/metakernel/magics/jigsaw_magic.py", line 43, in line_jigsaw
html_text = download("https://calysto.github.io/jigsaw/" + language + ".html")
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/metakernel/magics/jigsaw_magic.py", line 18, in download
g = urlopen(url)
File "/srv/conda/envs/notebook/lib/python3.7/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/srv/conda/envs/notebook/lib/python3.7/urllib/request.py", line 525, in open
response = self._open(req, data)
File "/srv/conda/envs/notebook/lib/python3.7/urllib/request.py", line 543, in _open
'_open', req)
File "/srv/conda/envs/notebook/lib/python3.7/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/srv/conda/envs/notebook/lib/python3.7/urllib/request.py", line 1393, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/srv/conda/envs/notebook/lib/python3.7/urllib/request.py", line 1350, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
File "/srv/conda/envs/notebook/lib/python3.7/http/client.py", line 1262, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/srv/conda/envs/notebook/lib/python3.7/http/client.py", line 1273, in _send_request
self.putrequest(method, url, **skips)
File "/srv/conda/envs/notebook/lib/python3.7/http/client.py", line 1116, in putrequest
self._validate_path(url)
File "/srv/conda/envs/notebook/lib/python3.7/http/client.py", line 1207, in _validate_path
raise InvalidURL(f"URL can't contain control characters. {url!r} "
http.client.InvalidURL: URL can't contain control characters. '/jigsaw/Python --workspace mynewProgram.html' (found at least ' ')
Douglas Blank commented
Thanks for reporting! If you can provide a fix, that would be ideal.