Skip to content

Commit

Permalink
Updated comment around .startswith('//')` check
Browse files Browse the repository at this point in the history
Signed-off-by: Doug Halley <[email protected]>
  • Loading branch information
douglascomet committed Feb 15, 2024
1 parent 76ede60 commit 1ad7b70
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/py-opentimelineio/opentimelineio/url_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1ad7b70

Please sign in to comment.