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

Critical Error when converting python notebooks that contain - in the name #103

Closed
mertzjames opened this issue Sep 14, 2015 · 5 comments · Fixed by jupyter/jupyter_core#54
Milestone

Comments

@mertzjames
Copy link

When trying to convert a notebook that has - in the name, I get the following error:

[NbConvertApp] CRITICAL | Bad config encountered during initialization:
[NbConvertApp] CRITICAL | Invalid argument: '-'

This was done using the following command:

jupyter nbconvert "0 - <notebook name>.ipynb" --to slides --post serve
@mertzjames mertzjames changed the title OSError when converting python notebooks that contain - in the name Critical Error when converting python notebooks that contain - in the name Sep 14, 2015
@Carreau
Copy link
Member

Carreau commented Sep 14, 2015

Zsh? tscsh ? Works locally in bash and fish, can you try single quotes ?

@mertzjames
Copy link
Author

I'm using the Windows Command Prompt. Single quotes don't resolve the issue.

@Carreau
Copy link
Member

Carreau commented Sep 15, 2015

Windows Command Prompt

Gnnn that will be painful to track. It might be a more global jupyter/traitlets issue.
Will try to find who could have a windows machine to debug...

@Carreau
Copy link
Member

Carreau commented Sep 16, 2015

From gitter:

@sccolbert said:
It looks like it may be something with how the jupyter script is passing along args. I get the same error as the issue if I use jupyter nbconvert, but if I invoke the module directly, I get this: https://gist.github.com/sccolbert/4105b6e24e0ca42cf2cd
I went down the path of invoking directly, just so I could debug the thing, since jupyter starts a new background shell
(the error in the gist is appropriate, since my version of the nb file is an empty { })
but running the jupyter command directly does error: https://gist.github.com/sccolbert/82f6f4e629768dea1ef1
The problem is what the jupyter command is passing to os.execvp: https://github.com/jupyter/jupyter_core/blob/master/jupyter_core/command.py#L132
printing that on the command of interest, we get:
jupyter-nbconvert ['nbconvert', '0 - name.ipynb', '--to', 'slides', '--post', 'serve']
notice that the second arg is no longer quoted
Q.E.D.
Not sure what the best solution is, short of traversing the args and re-quoting the ones with spaces before exec'ing the subprocess

@minrk
Copy link
Member

minrk commented Sep 16, 2015

This is fixed by jupyter/jupyter_core#54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants