-
Notifications
You must be signed in to change notification settings - Fork 41
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
cannot parse ls ./
#13
Comments
Confirmed. That's a tough case, though, because formally speaking the jupyter syntax for these is |
We could use IPython's own logic to catch these cases: In [10]: import IPython.core.magics.osm as osm
In [12]: list(osm.OSMagics.magics['line'].keys())
Out[12]:
['alias',
'unalias',
'rehashx',
'pwd',
'cd',
'env',
'set_env',
'pushd',
'popd',
'dirs',
'dhist',
'sc',
'sx',
'system',
'bookmark',
'pycat'] These are all defined magic aliases from the Operating System Magics class. |
Note that |
nb_black 1.0.6
listing a path ending with
/
results in an errorls ./
ERROR:root:Cannot parse: 1:4: ls ./
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/lab_black.py", line 210, in format_cell
formatted_code = _format_code(cell)
File "/usr/local/lib/python3.6/dist-packages/lab_black.py", line 29, in _format_code
return format_str(src_contents=code, mode=FileMode())
File "/usr/local/lib/python3.6/dist-packages/black.py", line 669, in format_str
src_node = lib2to3_parse(src_contents.lstrip(), mode.target_versions)
File "/usr/local/lib/python3.6/dist-packages/black.py", line 758, in lib2to3_parse
raise exc from None
black.InvalidInput: Cannot parse: 1:4: ls ./
And listing a path without
/
-ls /something/else
formats the path, which shouldn't be the case.The text was updated successfully, but these errors were encountered: