From 1ad7b7088b074a3cb41c148008fdb1d22418ac98 Mon Sep 17 00:00:00 2001 From: Doug Halley Date: Thu, 15 Feb 2024 13:08:04 -0500 Subject: [PATCH] Updated comment around `.startswith('//')`` check Signed-off-by: Doug Halley --- src/py-opentimelineio/opentimelineio/url_utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/py-opentimelineio/opentimelineio/url_utils.py b/src/py-opentimelineio/opentimelineio/url_utils.py index 73b3236f3..a1c0f4990 100644 --- a/src/py-opentimelineio/opentimelineio/url_utils.py +++ b/src/py-opentimelineio/opentimelineio/url_utils.py @@ -82,8 +82,9 @@ def filepath_from_url(urlstr): # Paths of type: "file://host/share/path/to/file.ext" provide "host" as netloc filepath = PurePath('//', parsed_result.netloc + decoded_parsed_path) - # When running `as_posix` the resulting path will have only 1 leading `/`, - # so we insert another `/` at the front of the string path and return it. + # Executing `as_posix` on Windows seems to generate a path with only + # 1 leading `/`, so we insert another `/` at the front of the string path + # to match Linux and Windows UNC conventions and return it. conformed_filepath = filepath.as_posix() if not conformed_filepath.startswith('//'): conformed_filepath = '/' + conformed_filepath