Skip to content

Commit e07d82a

Browse files
committed
validate path in FTPFS.geturl
1 parent a850810 commit e07d82a

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
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.5.6] - Unreleased
9+
10+
### Added
11+
12+
- Implemented geturl in FTPFS zmej-serow
13+
814
## [2.4.5] - 2019-05-05
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.5"
3+
__version__ = "2.4.6a0"

fs/ftpfs.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -453,13 +453,14 @@ def ftp(self):
453453
"""~ftplib.FTP: the underlying FTP client.
454454
"""
455455
return self._get_ftp()
456-
456+
457457
def geturl(self, path, purpose="download"):
458458
# type: (str, str) -> Text
459459
"""Get FTP url for resource."""
460+
_path = self.validatepath(path)
460461
if purpose != "download":
461-
raise errors.NoURL(path, purpose, "No such purpose")
462-
return "{}/{}".format(self.ftp_url, path)
462+
raise errors.NoURL(_path, purpose)
463+
return "{}{}".format(self.ftp_url, _path)
463464

464465
def _get_ftp(self):
465466
# type: () -> FTP

0 commit comments

Comments
 (0)