Fix curl missing --create-dirs for helper files in subdirectories#161
Merged
Conversation
Three notebooks fetch a helper .py file via curl into a subdirectory that doesn't exist yet on a fresh Colab runtime: 001075/001075_paper_figure_1d.ipynb -> utils_001075/ 000458/.../001_summarize_contents.ipynb -> helpers/ 000402/.../microns_nwb_coreg_notebook.ipynb -> ng_visualization/ `curl -o subdir/file.py URL` without --create-dirs fails silently when `subdir/` doesn't exist — and with -s (silent) you don't even see the error. The install cell appears to succeed, then the next cell hits 'ModuleNotFoundError: No module named helpers' (or similar). Adding --create-dirs makes curl mkdir -p the parent first. User report from a Colab run of 001_summarize_contents.ipynb: ModuleNotFoundError: No module named 'helpers' Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Contributor
|
Preview for this PR has been removed (PR closed). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
User report from a Colab run of
001_summarize_contents.ipynb:Three notebooks fetch a helper file via
curlinto a subdirectory that doesn't exist yet on a fresh Colab runtime:001075/001075_paper_figure_1d.ipynbutils_001075/000458/.../001_summarize_contents.ipynbhelpers/000402/.../microns_nwb_coreg_notebook.ipynbng_visualization/curl -o subdir/file.py URLwithout--create-dirsfails silently whensubdir/doesn't exist — and with-s(silent) you don't even see the error. The install cell appears to succeed; then the next cell hits theModuleNotFoundError.Fix
One-flag change per curl: insert
--create-dirsright after!curl. That makes curl create the parent directory if it doesn't exist (equivalent to amkdir -pfirst).Curl commands writing to the current directory (e.g.
ScanUnit.pkl,ng_utils.py) are untouched — they don't need the flag.🤖 Generated with Claude Code