mafalb/python-ftputil

Failed to check file timestamp during a leap year

Opened this issue · 0 comments

Got below error while using isfile function of remote ftp box.
ftp_connect.path.isfile('Remotefile')
File "/tmp/ftpclass-1.py", line 30, in
fetch()
File "/tmp/ftpclass-1.py", line 25, in fetch
source = ftp_connect.path.isfile('Remote-file.txt')
File "/app/Python-2.7.5/lib/python2.7/site-packages/ftputil/path.py", line 138, in isfile
path, _exception_for_missing_path=False)
File "/app/Python-2.7.5/lib/python2.7/site-packages/ftputil/host.py", line 846, in stat
return self._stat._stat(path, _exception_for_missing_path)
File "/app/Python-2.7.5/lib/python2.7/site-packages/ftputil/stat.py", line 735, in _stat
_exception_for_missing_path)
File "/app/Python-2.7.5/lib/python2.7/site-packages/ftputil/stat.py", line 699, in __call_with_parser_retry
return method(_args, *_kwargs)
File "/app/Python-2.7.5/lib/python2.7/site-packages/ftputil/stat.py", line 656, in _real_stat
lstat_result = self._real_lstat(path, _exception_for_missing_path)
File "/app/Python-2.7.5/lib/python2.7/site-packages/ftputil/stat.py", line 615, in _real_lstat
for stat_result in self._stat_results_from_dir(dirname):
File "/app/Python-2.7.5/lib/python2.7/site-packages/ftputil/stat.py", line 546, in _stat_results_from_dir
self.host.time_shift())
File "/app/Python-2.7.5/lib/python2.7/site-packages/ftputil/stat.py", line 478, in parse_line
st_mtime = self.parse_ms_time(date, time
, time_shift)
File "/app/Python-2.7.5/lib/python2.7/site-packages/ftputil/stat.py", line 316, in parse_ms_time
for part in date.split("-")]
File "/app/Python-2.7.5/lib/python2.7/site-packages/ftputil/stat.py", line 171, in _as_int
int_string))
ftputil.error.ParserError: non-integer year/month/day value u'drwxr'

Same code works when date on remote is not 29-Feb-2016 which is a leap year.
Python 2.7.5 and ftputil (3.2)

PFA snip of code.
ftpclass-1