Skip to content

Commit

Permalink
handle missing path max (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan authored Feb 23, 2019
1 parent dcf54ce commit a68eb56
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [2.4.4] - 2019-02-23

### Fixed

- OSFS fail in nfs mounts

## [2.4.3] - 2019-02-23

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion fs/_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Version, used in module and setup.py.
"""
__version__ = "2.4.3"
__version__ = "2.4.4"
2 changes: 1 addition & 1 deletion fs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1484,7 +1484,7 @@ def validatepath(self, path):
pass
else:
if len(sys_path) > max_sys_path_length:
_msg = "path too long " "(max {max_chars} characters in sys path)"
_msg = "path too long (max {max_chars} characters in sys path)"
msg = _msg.format(max_chars=max_sys_path_length)
raise errors.InvalidPath(path, msg=msg)
path = abspath(normpath(path))
Expand Down
10 changes: 7 additions & 3 deletions fs/osfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,13 @@ def __init__(
_meta["invalid_path_chars"] = "\0"

if "PC_PATH_MAX" in os.pathconf_names:
_meta["max_sys_path_length"] = os.pathconf(
fsencode(_root_path), os.pathconf_names["PC_PATH_MAX"]
)
try:
_meta["max_sys_path_length"] = os.pathconf(
fsencode(_root_path), os.pathconf_names["PC_PATH_MAX"]
)
except OSError: # pragma: no cover
# The above fails with nfs mounts on OSX. Go figure.
pass

def __repr__(self):
# type: () -> str
Expand Down

0 comments on commit a68eb56

Please sign in to comment.