Skip to content

RTC extension results in incorrect paths Validate notebook button #1836

Open
@ykazakov

Description

@ykazakov

It seems like some notebook paths in nbgrader UI are determined from the page address, which does not work with the jupyter-collaboration extension.
For example, by pressing the "Validate" button at the top of the notebook for an assignment gives me the error:

Traceback (most recent call last):
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/nbgrader/lib/python3.11/site-packages/nbgrader/server_extensions/validate_assignment/handlers.py", line 46, in validate_notebook
    result = validator.validate(fullpath)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/nbgrader/lib/python3.11/site-packages/nbgrader/validator.py", line 298, in validate
    with utils.chdir(dirname):
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/nbgrader/lib/python3.11/contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "/opt/homebrew/Caskroom/mambaforge/base/envs/nbgrader/lib/python3.11/site-packages/nbgrader/utils.py", line 385, in chdir
    os.chdir(dirname)
FileNotFoundError: [Errno 2] No such file or directory: '/Users/user/nbgrader/RTC:my-course/source/ps1'

The RTC: part in the page address is inserted by the jupyter-collaboration plugin.

Operating system

macOS 13.5.2

nbgrader --version

Python version 3.11.5 | packaged by conda-forge | (main, Aug 27 2023, 03:33:12) [Clang 15.0.7 ]
nbgrader version 0.9.1

jupyter notebook --version

Python version 3.11.5 | packaged by conda-forge | (main, Aug 27 2023, 03:33:12) [Clang 15.0.7 ]
nbgrader version 0.9.1

Steps to reproduce the behavior

  1. Run:
mamba create --name nbgrader
mamba activate nbgrader
mamba install -c conda-forge nbgrader jupyter-collaboration
nbgrader quickstart my-course
jupyter lab
  1. Open the notebook in my-course/source/ps1/problem1.ipynb
  2. Press the Validate button

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions