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

Fix: correct notebook2html path operation for Windows. #239

Merged
merged 1 commit into from
Sep 8, 2020

Conversation

rickatx
Copy link

@rickatx rickatx commented Sep 7, 2020

With the default project structure, the glob() in notebook2html() can easilly find a copy of a .ipynb file in .ipynb_checkpoints. In this case, running nbdev_build_docs will fail, assuming the .ipynb imports the project (the relative path is not correct from this dir.) The current code to skip hidden path components searches for '/.', whereas str(f) will return the Windows backslash path, so the search will fail. f.as_posix() returns a '/' delimited path on all platforms.

I verified failure of nbdev_build_docs before the fix, and success after installing the fix.

With the default project structure, the glob() in notebook2html() can easilly find a copy of a .ipynb file in .ipynb_checkpoints. In this case, running nbdev_build_docs will fail, assuming the .ipynb imports the project (the relative path is not correct from this dir.) The current code to skip hidden path components searches for '/.', whereas str(f) will return the Windows backslash path, so the search will fail. f.as_posix() returns a '/' delimited path on all platforms.

I verified failure of nbdev_build_docs before the fix, and success after installing the fix.
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

Review Jupyter notebook visual diffs & provide feedback on notebooks.


Powered by ReviewNB

@jph00 jph00 added the bug Something isn't working label Sep 8, 2020
@jph00 jph00 merged commit f4014a0 into AnswerDotAI:master Sep 8, 2020
@jph00
Copy link
Contributor

jph00 commented Sep 8, 2020

Many thanks.

@rickatx rickatx deleted the pathfix branch September 9, 2020 02:31
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 this pull request may close these issues.

2 participants