diff --git a/petastorm/fs_utils.py b/petastorm/fs_utils.py index 913eb48b..f02684e4 100644 --- a/petastorm/fs_utils.py +++ b/petastorm/fs_utils.py @@ -16,6 +16,7 @@ import pyarrow import six from six.moves.urllib.parse import urlparse +import platform from petastorm.gcsfs_helpers.gcsfs_wrapper import GCSFSWrapper from petastorm.hdfs.namenode import HdfsNamenodeResolver, HdfsConnector @@ -33,6 +34,9 @@ def get_dataset_path(parsed_url): # s3/gs/gcs filesystem expects paths of the form `bucket/path` return parsed_url.netloc + parsed_url.path + if parsed_url.scheme.lower() in ['file'] and "Windows" in platform.system(): + return parsed_url.path[1:] + return parsed_url.path