nbgrader icon indicating copy to clipboard operation
nbgrader copied to clipboard

refactor: reduce reliance on regex in path handling

Open shreve opened this issue 7 months ago • 1 comments

This change tries to modernize the way we handle paths in nbgrader by using pathlib.Path and centralizing logic for searching and extracting information from paths into CourseDirectory.

By using Path(root).glob(pat) instead of glob.glob(root / pat), we can avoid some issues of needing to escape CourseDirectory.root because the glob will be scoped underneath a fixed path.

Introduces a new CourseDirectory.find_assignments method to help locate assignment directories across steps and students.

Fixes #1965

shreve avatar May 09 '25 17:05 shreve

Binder :point_left: Launch a Binder on branch shreve/nbgrader/safer-paths

github-actions[bot] avatar May 09 '25 17:05 github-actions[bot]