You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I set the root directory to /home/teacher/nbgrader/ (note the / at the end).
This setup resulted in the following problems:
I created an assignment (with the grader user) hw1, but did not add anything to it. Switched to "Manage Students", came back, the assignment was missing.
I added a notebook to the assignment, tried to generate it, and got the following error:
Traceback (most recent call last):
File "/opt/conda/lib/python3.6/site-packages/nbgrader/utils.py", line 371, in capture_log
app.start()
File "/opt/conda/lib/python3.6/site-packages/nbgrader/converters/assign.py", line 146, in start
super(Assign, self).start()
File "/opt/conda/lib/python3.6/site-packages/nbgrader/converters/base.py", line 72, in start
self.convert_notebooks()
File "/opt/conda/lib/python3.6/site-packages/nbgrader/converters/base.py", line 279, in convert_notebooks
raise NbGraderException(msg)
nbgrader.converters.base.NbGraderException: Could not match '/home/teacher/nbgrader/source/./hw1' with regexp '\/home\/teacher\/nbgrader\/\/source\/(?P<student_id>.*)\/(?P<assignment_id>.*)'
Steps to reproduce the behavior
Described above.
I think the problem stems from the fact that convert_notebooks() calls format_path() with escape=True, which does not use os.path.join() to join the directories. So if the root directory (set via c.CourseDirectory.root) ends with the path separator, it ends up twice in the regex.
Note that my installation uses version 0.5.4, but the code seems to be the same in 0.6.
The text was updated successfully, but these errors were encountered:
Confirmed. Probably the right thing here is to do some validation on root using os.path.abspath when root is set, thus ensuring that it doesn't have trailing slashes.
Operating system
Ubuntu 16.04
nbgrader --version
0.5.4
jupyterhub --version
(if used with JupyterHub)0.8.1
Expected behavior
To work as intended?
Actual behavior
I set the root directory to
/home/teacher/nbgrader/
(note the/
at the end).This setup resulted in the following problems:
hw1
, but did not add anything to it. Switched to "Manage Students", came back, the assignment was missing.Steps to reproduce the behavior
Described above.
I think the problem stems from the fact that
convert_notebooks()
callsformat_path()
withescape=True
, which does not useos.path.join()
to join the directories. So if the root directory (set viac.CourseDirectory.root
) ends with the path separator, it ends up twice in the regex.Note that my installation uses version 0.5.4, but the code seems to be the same in 0.6.
The text was updated successfully, but these errors were encountered: