Skip to content

Commit

Permalink
Do not use Path.resolve to determine posix root
Browse files Browse the repository at this point in the history
If we know it's posix we know that the answer is /
  • Loading branch information
timj committed Mar 26, 2021
1 parent a73f724 commit 2da0671
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions python/lsst/daf/butler/core/_butlerUri/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,13 @@
# Determine if the path separator for the OS looks like POSIX
IS_POSIX = os.sep == posixpath.sep

# Root path for this operating system
OS_ROOT_PATH = Path().resolve().root
# Root path for this operating system. This can use getcwd which
# can fail in some situations so in the default case assume that
# posix means posix and only determine explicitly in the non-posix case.
if IS_POSIX:
OS_ROOT_PATH = posixpath.sep
else:
OS_ROOT_PATH = Path().resolve().root

log = logging.getLogger(__name__)

Expand Down

0 comments on commit 2da0671

Please sign in to comment.