mafalb / python-ftputil Goto Github PK
View Code? Open in Web Editor NEWOnly a slightly modified version, see the README or http://ftputil.sschwarzer.net/trac
Home Page: http://github.com/mafalb/python-ftputil/wiki/python-ftputil
License: Other
Only a slightly modified version, see the README or http://ftputil.sschwarzer.net/trac
Home Page: http://github.com/mafalb/python-ftputil/wiki/python-ftputil
License: Other
Things to do for a new release: - do commits - update info on new version in `README.txt` - write announcement in announcements.txt - increase version number in `VERSION` (`ftputil_version.py` and `ftputil.txt` are handled by the `sed` invocation through `make patch`) - update Debian-related packaging files in debian/custom, including commits - `make patch` - do outstanding commits due to patching - `make dist` (now includes tests) - tag release (tags are formed like "release2_0_3b2") - add new version to Trac issue tracker - add new version to Download page on the website - mark corresponding milestone as completed - post announcement to ftputil mailing list Only for non-alpha/beta releases: - update documentation on the website - register new version with PyPI - send announcement to comp.lang.python.announce
When running :
ftp_host = ftputil.FTPHost(host, usr, psw)
recursive = ftp_host.walk(path, topdown=True, onerror=None)
for root, dirs, files in recursive:
do something...
ftputil returns the error above when running the iteration over the generator called 'recursive'. I am stuck with this issue.
Is this a bug?
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)
I have a FTP server that is 4 hours ahead of my client. I was hoping to get correct time by setting time_shift in the host object. After checking the code for function parse_unix_time, the time_shift is not applied to the time object created from ftp response lines. Since the response line returns the FTP server time, without applying the time_shift will end up giving wrong local time.
Suggest correction:
```
if ":" not in year_or_time:
# `year_or_time` is really a year
year, hour, minute = int(year_or_time), 0, 0
st_mtime = time.mktime( (year, month, day,
hour, minute, 0, 0, 0, -1) )
**st_mtime += time_shift**
# Precise up to a day
st_mtime_precision = 24 * 60 * 60
else:
# `year_or_time` is a time hh:mm
hour, minute = year_or_time.split(':')
year, hour, minute = None, int(hour), int(minute)
# Try the current year
year = time.localtime()[0]
st_mtime = time.mktime( (year, month, day,
hour, minute, 0, 0, 0, -1) )
**st_mtime += time_shift**
# Precise up to a minute
st_mtime_precision = 60
Is it possible to send commands to ftp server? I need to send "REST bytes_offsets" command to server, so that when I call ftputil.FTPHost's "download" method, it starts to download that files from bytes_offsets.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.