Changeset 537:468cd27a4377


Ignore:
Timestamp:
Oct 13, 2006, 1:02:25 AM (13 years ago)
Author:
Stefan Schwarzer <sschwarzer@…>
Branch:
add_stat_caching
Convert:
svn:778c30c8-61e0-0310-89d4-fe2f97a467b2/branches/add_stat_caching@560
Message:
Merged revisions from 546 to 559 from trunk into branch add_stat_caching.
Files:
1 added
10 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    r499 r537  
    3838STYLESHEET_PATH=/usr/share/doc/docutils-0.3.7/html/tools/stylesheets/default.css
    3939WWW_DIR=${HOME}/www
     40SED=sed -i'' -r -e
    4041
    4142.PHONY: dist extdist test docs clean register patch
     
    5859patch:
    5960        @echo "Patching files"
    60         sed -i'' -r -e "s/^__version__ = '.*'/__version__ = \'`cat VERSION`\'/" ftputil_version.py
    61         sed -i'' -r -e "s/^:Version:   .*/:Version:   `cat VERSION`/" ftputil.txt
    62         sed -i'' -r -e "s/^:Date:      .*/:Date:      `date +"%Y-%m-%d"`/" ftputil.txt
     61        ${SED} "s/^__version__ = '.*'/__version__ = \'`cat VERSION`\'/" \
     62                ftputil_version.py
     63        ${SED} "s/^:Version:   .*/:Version:   `cat VERSION`/" ftputil.txt
     64        ${SED} "s/^:Date:      .*/:Date:      `date +"%Y-%m-%d"`/" ftputil.txt
    6365        #TODO add rules for Russian translation
     66        ${SED} "s/^Version: .*/Version: `cat VERSION`/" PKG-INFO
     67        ${SED} "s/(\/wiki\/Download\/ftputil-).*(\.tar\.gz)/\1`cat VERSION`\2/" \
     68                PKG-INFO
    6469
    6570docs: ${DOC_FILES} README.txt ftputil.txt ftputil_ru_utf8.txt
  • VERSION

    r510 r530  
    1 2.1
     12.1.1
  • _test_real_ftp.py

    r509 r527  
    6868
    6969    def make_file(self, path):
    70         file = self.host.file(path, 'wb')
    71         file.close()
     70        file_ = self.host.file(path, 'wb')
     71        file_.close()
     72
     73    def test_open_for_reading(self):
     74        # test for issue #17, http://ftputil.sschwarzer.net/trac/ticket/17
     75        file1 = self.host.file("debian-keyring.tar.gz", 'rb')
     76        file1.close()
     77        # make sure that there are no problems if the connection is reused
     78        file2 = self.host.file("debian-keyring.tar.gz", 'rb')
     79        file2.close()
     80        self.failUnless(file1._session is file2._session)
    7281
    7382    def test_time_shift(self):
  • announcements.txt

    r516 r537  
    1 ftputil 2.1 is now available from
     1ftputil 2.1.1 is now available from
    22http://ftputil.sschwarzer.net/download .
    33
     4This release fixes a bug which happened when a client opened
     5a large file on the server as a file-like object and read
     6only a part of it. For details, see
     7http://ftputil.sschwarzer.net/trac/ticket/17 .
     8
     9Stefan
     10
     11----------------------------------------------------------------------
    412Changes since version 2.0
    513-------------------------
  • ftp_file.py

    r509 r537  
    226226            self._fo.close()
    227227            ftp_error._try_with_ioerror(self._conn.close)
    228             ftp_error._try_with_ioerror(self._session.voidresp)
     228            try:
     229                ftp_error._try_with_ioerror(self._session.voidresp)
     230            except ftp_error.FTPIOError, exception:
     231                # ignore some errors, see ticket #17 at
     232                #  http://ftputil.sschwarzer.net/trac/ticket/17
     233                error_code = str(exception).split()[0]
     234                if error_code not in ("426", "450"):
     235                    raise
    229236            self.closed = True
    230237
  • ftp_stat.py

    r501 r526  
    445445                # we had this path already
    446446                raise ftp_error.PermanentError(
    447                       "recursive link structure detected for path '%s'" %
     447                      "recursive link structure detected for remote path '%s'" %
    448448                      original_path)
    449449            # remember the path we have encountered
  • ftputil.py

    r509 r537  
    241241            # similarly to a failed `file` in a local filesystem, we
    242242            #  raise an `IOError`, not an `OSError`
    243             raise ftp_error.FTPIOError("directory '%s' is not accessible" %
    244                                       effective_dir)
     243            raise ftp_error.FTPIOError("remote directory '%s' doesn't exist "
     244                  "or has insufficient access rights" % effective_dir)
    245245        host._file._open(effective_file, mode)
    246246        return host._file
     
    404404        source_mode, target_mode = self.__get_modes(mode)
    405405        source = source_open(source, source_mode)
    406         target = target_open(target, target_mode)
    407         self.copyfileobj(source, target)
    408         source.close()
    409         target.close()
     406        try:
     407            target = target_open(target, target_mode)
     408            try:
     409                self.copyfileobj(source, target)
     410            finally:
     411                target.close()
     412        finally:
     413            source.close()
    410414
    411415    def upload(self, source, target, mode=''):
     
    551555        else:
    552556            raise ftp_error.PermanentError("remove/unlink can only delete "
    553                                                        "files and links, not directories")
     557                                           "files and links, not directories")
    554558
    555559    def unlink(self, path):
  • ftputil.txt

    r520 r530  
    22=============================================
    33
    4 :Version:   2.1
    5 :Date:      2006-03-30
     4:Version:   2.1.1
     5:Date:      2006-08-19
    66:Summary:   high-level FTP client library for Python
    77:Keywords:  FTP, ``ftplib`` substitute, virtual filesystem, pure Python
  • ftputil_version.py

    r510 r530  
    3030# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    3131
    32 # $Id: $
     32# $Id$
    3333
    3434import sys
    3535
    3636# ftputil version number
    37 __version__ = '2.1'
     37__version__ = '2.1.1'
    3838
    3939_ftputil_version = __version__
  • upload_download_test.py

    r508 r530  
    3232# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    3333
    34 # $Id: $
     34# $Id$
    3535
    3636# Test script for ticket #13 (reported by Pete Schott)
Note: See TracChangeset for help on using the changeset viewer.