2
0
mirror of https://github.com/jupyter/notebook.git synced 2024-12-21 04:10:17 +08:00

Merge pull request from krassowski/patch-2

Normalise `os_path`
This commit is contained in:
Eric Charles 2022-09-25 03:55:11 +02:00 committed by GitHub
commit 4fe291e0ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -253,7 +253,7 @@ def to_os_path(path, root=''):
parts = path.strip('/').split('/')
parts = [p for p in parts if p != ''] # remove duplicate splits
path = os.path.join(root, *parts)
return path
return os.path.normpath(path)
def to_api_path(os_path, root=''):
"""Convert a filesystem path to an API path