~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/ftp/__init__.py

  • Committer: Jelmer Vernooij
  • Date: 2012-04-02 01:44:26 UTC
  • mfrom: (6518 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6519.
  • Revision ID: jelmer@samba.org-20120402014426-0o5qtysohyl006b2
merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
248
248
            mutter("FTP has not: %s: %s", abspath, e)
249
249
            return False
250
250
 
251
 
    def get(self, relpath, decode=DEPRECATED_PARAMETER, retries=0):
 
251
    def get(self, relpath, retries=0):
252
252
        """Get the file at the given relative path.
253
253
 
254
254
        :param relpath: The relative path to the file
258
258
        We're meant to return a file-like object which bzr will
259
259
        then read from. For now we do this via the magic of StringIO
260
260
        """
261
 
        if deprecated_passed(decode):
262
 
            warn(deprecated_in((2,3,0)) %
263
 
                 '"decode" parameter to FtpTransport.get()',
264
 
                 DeprecationWarning, stacklevel=2)
265
261
        try:
266
262
            mutter("FTP get: %s", self._remote_path(relpath))
267
263
            f = self._get_FTP()
279
275
            else:
280
276
                warning("FTP temporary error: %s. Retrying.", str(e))
281
277
                self._reconnect()
282
 
                return self.get(relpath, decode, retries+1)
 
278
                return self.get(relpath, retries+1)
283
279
        except EOFError, e:
284
280
            if retries > _number_of_retries:
285
281
                raise errors.TransportError("FTP control connection closed during GET %s."
289
285
                warning("FTP control connection closed. Trying to reopen.")
290
286
                time.sleep(_sleep_between_retries)
291
287
                self._reconnect()
292
 
                return self.get(relpath, decode, retries+1)
 
288
                return self.get(relpath, retries+1)
293
289
 
294
290
    def put_file(self, relpath, fp, mode=None, retries=0):
295
291
        """Copy the file-like or string object into the location.