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

nbconvert --to notebook --output out.ipynb filename incorrect #1970

Closed
ksunden opened this issue Apr 3, 2023 · 3 comments · Fixed by #1974
Closed

nbconvert --to notebook --output out.ipynb filename incorrect #1970

ksunden opened this issue Apr 3, 2023 · 3 comments · Fixed by #1974

Comments

@ksunden
Copy link

ksunden commented Apr 3, 2023

Outputs to a file called "out.nbconvert.ipynb" instead of "out.ipynb" as expected.

The expected behavior was the case prior to v7.3, likely related to #1967, though not super obvious how this behavior emerges, looking at the diff as an outsider to this codebase.
My guess is that it is related to stripping the extension off there.

A similar change does not seem to happen for other conversions, e.g. md or pdf

Steps to reproduce:

Any ipynb will do, I just made a new, empty, ipynb file and called it "test.ipynb"

$ ls
test.ipynb
$ jupyter nbconvert --to notebook --output out.ipynb test.ipynb 
[NbConvertApp] Converting notebook test.ipynb to notebook
[NbConvertApp] Writing 617 bytes to out.nbconvert.ipynb

This is currently breaking matplotlib's tests, which rely on the expected output path being valid.

ocefpaf added a commit to ocefpaf/erddapy that referenced this issue Apr 4, 2023
QuLogic added a commit to QuLogic/matplotlib that referenced this issue Apr 4, 2023
Shaikh-Ubaid added a commit to Shaikh-Ubaid/lfortran that referenced this issue Apr 5, 2023
haojunsong-08 pushed a commit to haojunsong-08/matplotlib that referenced this issue Apr 5, 2023
@ksunden
Copy link
Author

ksunden commented Apr 10, 2023

Gentle ping since our (for me, matplotlib, but others who have linked PRs here as well) current workaround is to avoid the versions with the change, and the new release today means we have to update that.

If this is intended behavior that will be kept going forward, knowing that would be appreciated so we can implement a more complete workaround.

ksunden added a commit to ksunden/matplotlib that referenced this issue Apr 10, 2023
ksunden added a commit to ksunden/matplotlib that referenced this issue Apr 11, 2023
@Shaikh-Ubaid
Copy link

I agree with @ksunden. We would appreciate it and be grateful if the team could share if saving to out.nbconvert.ipynb instead of out.ipynb is an intended behaviour. Thank you.

@tuncbkose
Copy link
Contributor

tuncbkose commented Apr 12, 2023

This looks like unintended behavior to me, since the PR that made the change didn't test notebook files. I made a PR to restore old behavior, hopefully a maintainer can take a look at it soon.

Higgs32584 pushed a commit to Higgs32584/matplotlib that referenced this issue Apr 17, 2023
Higgs32584 pushed a commit to Higgs32584/matplotlib that referenced this issue Apr 17, 2023
vepadulano added a commit to vepadulano/roottest that referenced this issue May 18, 2023
Recent failures of roottest-python-JupyROOT-importROOT_notebook
(specifically on Fedora 37) would report the message

```
[NbConvertApp] Converting notebook importROOT.ipynb to notebook
[NbConvertApp] Writing 988 bytes to importROOT_out.nbconvert.ipynb
...
    File "/tmp/workspace/src/roottest/python/JupyROOT/nbdiff.py", line 68, in getFilteredLines
      filteredLines = list(filter(customLineJunkFilter, open(fileName).readlines()))
                                                        ^^^^^^^^^^^^^^
  FileNotFoundError: [Errno 2] No such file or directory: 'importROOT_out.ipynb'
```

This is due to a bug in nbconvert version 7.3, as described in
jupyter/nbconvert#1970. Other versions of the
package do not suffer from the bug, so we update the requirements.txt
file accordingly.
vepadulano added a commit to root-project/roottest that referenced this issue Jul 19, 2023
Recent failures of roottest-python-JupyROOT-importROOT_notebook
(specifically on Fedora 37) would report the message

```
[NbConvertApp] Converting notebook importROOT.ipynb to notebook
[NbConvertApp] Writing 988 bytes to importROOT_out.nbconvert.ipynb
...
    File "/tmp/workspace/src/roottest/python/JupyROOT/nbdiff.py", line 68, in getFilteredLines
      filteredLines = list(filter(customLineJunkFilter, open(fileName).readlines()))
                                                        ^^^^^^^^^^^^^^
  FileNotFoundError: [Errno 2] No such file or directory: 'importROOT_out.ipynb'
```

This is due to a bug in nbconvert version 7.3, as described in
jupyter/nbconvert#1970. Other versions of the
package do not suffer from the bug, so we update the requirements.txt
file accordingly.
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