Skip to content

Commit a68eb56

Browse files
authored
handle missing path max (#270)
1 parent dcf54ce commit a68eb56

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

CHANGELOG.md

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

8+
## [2.4.4] - 2019-02-23
9+
10+
### Fixed
11+
12+
- OSFS fail in nfs mounts
13+
814
## [2.4.3] - 2019-02-23
915

1016
### 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.4.3"
3+
__version__ = "2.4.4"

fs/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1484,7 +1484,7 @@ def validatepath(self, path):
14841484
pass
14851485
else:
14861486
if len(sys_path) > max_sys_path_length:
1487-
_msg = "path too long " "(max {max_chars} characters in sys path)"
1487+
_msg = "path too long (max {max_chars} characters in sys path)"
14881488
msg = _msg.format(max_chars=max_sys_path_length)
14891489
raise errors.InvalidPath(path, msg=msg)
14901490
path = abspath(normpath(path))

fs/osfs.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,13 @@ def __init__(
151151
_meta["invalid_path_chars"] = "\0"
152152

153153
if "PC_PATH_MAX" in os.pathconf_names:
154-
_meta["max_sys_path_length"] = os.pathconf(
155-
fsencode(_root_path), os.pathconf_names["PC_PATH_MAX"]
156-
)
154+
try:
155+
_meta["max_sys_path_length"] = os.pathconf(
156+
fsencode(_root_path), os.pathconf_names["PC_PATH_MAX"]
157+
)
158+
except OSError: # pragma: no cover
159+
# The above fails with nfs mounts on OSX. Go figure.
160+
pass
157161

158162
def __repr__(self):
159163
# type: () -> str

0 commit comments

Comments
 (0)