Skip to content

Commit bb19924

Browse files
authored
Win path (#202)
* fix for Windows paths * version bump
1 parent b2c0d96 commit bb19924

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## [2.0.27] - Unreleased
8+
9+
### Fixed for Winows paths #152
10+
711
## [2.0.26] - 2018-07-26
812

913
### Fixed

fs/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Version, used in module and setup.py.
22
"""
3-
__version__ = "2.0.26"
3+
__version__ = "2.0.27a0"

fs/osfs.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,9 @@ def __init__(
106106
if isinstance(root_path, bytes):
107107
root_path = fsdecode(root_path)
108108
self.root_path = root_path
109-
_root_path = fsdecode(fspath(root_path))
110-
_root_path = os.path.expanduser(os.path.expandvars(root_path))
109+
_drive, _root_path = os.path.splitdrive(fsdecode(fspath(root_path)))
110+
_root_path = _drive + (_root_path or '/') if _drive else _root_path
111+
_root_path = os.path.expanduser(os.path.expandvars(_root_path))
111112
_root_path = os.path.normpath(os.path.abspath(_root_path))
112113
self._root_path = _root_path
113114

0 commit comments

Comments
 (0)