~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/sftp.py

  • Committer: Tarmac
  • Author(s): Vincent Ladeuil, Patch Queue Manager, Jelmer Vernooij
  • Date: 2017-01-17 16:20:41 UTC
  • mfrom: (6619.1.2 trunk)
  • Revision ID: tarmac-20170117162041-oo62uk1qsmgc9j31
Merge 2.7 into trunk including fixes for bugs #1622039, #1644003, #1579093 and #1645017. [r=vila]

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2011, 2016 Canonical Ltd
 
1
# Copyright (C) 2005-2011, 2016, 2017 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
410
410
        try:
411
411
            path = self._remote_path(relpath)
412
412
            f = self._get_sftp().file(path, mode='rb')
 
413
            size = f.stat().st_size
413
414
            if self._do_prefetch and (getattr(f, 'prefetch', None) is not None):
414
 
                f.prefetch()
 
415
                f.prefetch(size)
415
416
            return f
416
417
        except (IOError, paramiko.SSHException), e:
417
418
            self._translate_io_exception(e, path, ': error retrieving',