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

RTC extension results in incorrect paths Validate notebook button #1836

Open
ykazakov opened this issue Sep 22, 2023 · 1 comment
Open

RTC extension results in incorrect paths Validate notebook button #1836

ykazakov opened this issue Sep 22, 2023 · 1 comment

Comments

@ykazakov
Copy link
Contributor

ykazakov commented Sep 22, 2023

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
@milandeepbassi
Copy link

Finding issues with using NBGrader plus Assignment Fetching relating to this.

Can see when accessing the Assignments tab the following URL:

/user/fWVysmUvHuc3NEZ0r/lab/tree/RTC%3A

Once clicking on the assignment it loads with:

/user/fWVysmUvHuc3NEZ0r/lab/tree/g__18309/Challenge.ipynb

Opening the Notebook from the File Tree results in:

/user/fWVysmUvHuc3NEZ0r/lab/tree/RTC%3Ag__18309/Challenge.ipynb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants