Skip to content
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

Error when opening a notebook with spaces #86

Open
sulan opened this issue May 26, 2023 · 2 comments · May be fixed by #120
Open

Error when opening a notebook with spaces #86

sulan opened this issue May 26, 2023 · 2 comments · May be fixed by #120
Labels
bug Something isn't working

Comments

@sulan
Copy link

sulan commented May 26, 2023

Hi,

When opening a notebook with spaces in the filename, I get the following error:

"file with spaces.ipynb" 60L, 1359B written
Error detected while processing function jukit#convert#notebook_convert[5]..<SNR>123_convert_to_script[12]..provider#python3#Call:
line   18:
Error invoking 'python_execute' on channel 5 (python3-script-host):
Traceback (most recent call last):
  File "<string>", line 6, in <module>
  File "/home/sulan/.local/share/nvim/site/pack/packer/start/vim-jukit/helpers/ipynb_convert/convert.py", line 123, in convert
    language, nb = get_nb_and_language(nb, lang)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sulan/.local/share/nvim/site/pack/packer/start/vim-jukit/helpers/ipynb_convert/util.py", line 11, in get_nb_and_language
    assert nb["nbformat"] > 3, (
           ~~^^^^^^^^^^^^
KeyError: 'nbformat'

It seems to come from nvim reporting the filename with \s in it, after which the python code (in load_json in utils.py) tries to load the wrong filename, and returns an empty dict.

Versions

  • NVIM v0.9.0
  • Python 3.11.3
  • Linux 6.3.3-arch1-1
@datacubeR
Copy link

I can confirm this weird behavior, even though I think it is never a great practice to have space in file names, this issue raises if the space is in any part of the path, even in previous folders that are not part of the relative path.... Fixed it eliminating spaces...

@sahinakkaya
Copy link

#94 is also same issue. Keeping it open to prevent possible duplicate issues in the future.

@tomiock tomiock linked a pull request Oct 19, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants