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

Nbdime error on Windows with nbstripout #115

Closed
fcollonval opened this issue Jan 25, 2020 · 2 comments · Fixed by #116
Closed

Nbdime error on Windows with nbstripout #115

fcollonval opened this issue Jan 25, 2020 · 2 comments · Fixed by #116

Comments

@fcollonval
Copy link
Contributor

Hey,

We got an issue reported in jupyterlab/jupyterlab-git#471 (comment) when using nbstripout and nbdime on Windows.

I was able to reproduce that issue on the following system:

  • Windows 10 x64
  • Relevant packages
# Name                    Version                   Build  Channel
jupyterlab-git            0.9.0                     dev_0    <develop>
nbdime                    1.1.0                    pypi_0    pypi
nbformat                  4.4.0                      py_1    conda-forge
nbstripout                0.3.7                      py_0    conda-forge
notebook                  6.0.1                    py37_0    conda-forge
python                    3.7.6                h5b45d93_1    conda-forge

Digging into that issue, nbdime finds out the filter applied on the notebook by querying the git config command. Then it applies the obtained command on the file before processing with the diff operation.

On Windows, git uses a unix shell. But nbdime with that logic uses the native shell of the OS. And in the particular case of nbstripout, it is failing.

  • Call from nbdime
subprocess.CalledProcessError: Command ''C:/Users/freud/Anaconda3/envs/jlab/python.exe' -m nbstripout' returned non-zero exit status 1.
  • Call executed directly in Windows shell:
(jlab) ...\jupyterlab-git\examples>'C:/Users/freud/Anaconda3/envs/jlab/python.exe' -m nbstripout < demo.ipynb
''C:' is not recognized as valid command

The error raises due to the use of single quote in

filepath = "'{}' -m nbstripout".format(sys.executable.replace('\\', '/'))

Using double quote " removes the error.

fcollonval added a commit to fcollonval/nbstripout that referenced this issue Jan 25, 2020
@jamesjnadeau
Copy link

@kynan Any chance of this getting merged in the near future?

@kynan kynan closed this as completed in #116 May 9, 2020
kynan pushed a commit that referenced this issue May 9, 2020
@kynan
Copy link
Owner

kynan commented May 9, 2020

Sorry for the slow response. This will go out in 0.3.8

@kynan kynan added this to the 0.3.8 milestone May 9, 2020
ooiM added a commit to ooiM/nbstripout that referenced this issue Jun 2, 2020
@kynan kynan modified the milestones: 0.3.8, 0.3.10 Apr 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants