~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

Merge bzr.dev into cleanup resolving conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
191
191
            or 'file/directory not found' in s # filezilla server
192
192
            # Microsoft FTP-Service RNFR reply if file not found
193
193
            or (s.startswith('550 ') and 'unable to rename to' in extra)
 
194
            # if containing directory doesn't exist, suggested by
 
195
            # <https://bugs.edge.launchpad.net/bzr/+bug/224373>
 
196
            or (s.startswith('550 ') and "can't find folder" in s)
194
197
            ):
195
198
            raise errors.NoSuchFile(path, extra=extra)
196
199
        elif ('file exists' in s):
314
317
                    return len(bytes)
315
318
                else:
316
319
                    return fp.counted_bytes
317
 
            except (ftplib.error_temp,EOFError), e:
318
 
                warning("Failure during ftp PUT. Deleting temporary file.")
 
320
            except (ftplib.error_temp, EOFError), e:
 
321
                warning("Failure during ftp PUT of %s: %s. Deleting temporary file."
 
322
                    % (tmp_abspath, e, ))
319
323
                try:
320
324
                    f.delete(tmp_abspath)
321
325
                except:
328
332
                                       unknown_exc=errors.NoSuchFile)
329
333
        except ftplib.error_temp, e:
330
334
            if retries > _number_of_retries:
331
 
                raise errors.TransportError("FTP temporary error during PUT %s. Aborting."
332
 
                                     % self.abspath(relpath), orig_error=e)
 
335
                raise errors.TransportError(
 
336
                    "FTP temporary error during PUT %s: %s. Aborting."
 
337
                    % (self.abspath(relpath), e), orig_error=e)
333
338
            else:
334
339
                warning("FTP temporary error: %s. Retrying.", str(e))
335
340
                self._reconnect()
350
355
        try:
351
356
            mutter("FTP mkd: %s", abspath)
352
357
            f = self._get_FTP()
353
 
            f.mkd(abspath)
 
358
            try:
 
359
                f.mkd(abspath)
 
360
            except ftplib.error_reply, e:
 
361
                # <https://bugs.launchpad.net/bzr/+bug/224373> Microsoft FTP
 
362
                # server returns "250 Directory created." which is kind of
 
363
                # reasonable, 250 meaning "requested file action OK", but not what
 
364
                # Python's ftplib expects.
 
365
                if e[0][:3] == '250':
 
366
                    pass
 
367
                else:
 
368
                    raise
354
369
            self._setmode(relpath, mode)
355
370
        except ftplib.error_perm, e:
356
371
            self._translate_ftp_error(e, abspath,