Skip to content

Commit 2d3d347

Browse files
committed
Apply changes per review comments
1 parent 1295d38 commit 2d3d347

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

notebook/services/contents/filemanager.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -600,12 +600,13 @@ def _validate_path(path):
600600
# be created and confusion will reign! (See https://github.com/jupyter/notebook/issues/5190)
601601
# Go ahead and add other invalid (and non-path-separator) characters here as well so there's
602602
# consistent behavior - although all others will result in '[Errno 22]Invalid Argument' errors.
603-
invalid_chars = (':', '>', '<', '*', '?', '|', '"')
603+
invalid_chars = '?:><*"|'
604604
else:
605605
# On non-windows systems, allow the underlying file creation to perform enforcement when appropriate
606-
invalid_chars = ()
606+
invalid_chars = ''
607607

608608
for char in invalid_chars:
609609
if char in path:
610-
raise web.HTTPError(400, u"Path '{}' contains invalid characters {} relative to its platform. "
611-
u"Please edit the path and re-submit the request.".format(path, invalid_chars))
610+
raise web.HTTPError(400, "Path '{}' contains characters that are invalid for the filesystem. "
611+
"Path names on this filesystem cannot contain any of the following "
612+
"characters: {}".format(path, invalid_chars))

0 commit comments

Comments
 (0)