Ignore:
Timestamp:
Dec 26, 2018, 8:00:40 PM (6 months ago)
Author:
Stefan Schwarzer <sschwarzer@…>
Branch:
default
Message:
Remove positional argument specifiers for `format`

In strings for `format` calls, remove the digits for positional
arguments. For example, "{0}, {1}" becomes "{}, {}".
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ftputil/file.py

    r1721 r1723  
    5454            raise ftputil.error.FTPIOError("append mode not supported")
    5555        if mode not in ("r", "rb", "rt", "w", "wb", "wt"):
    56             raise ftputil.error.FTPIOError("invalid mode '{0}'".format(mode))
     56            raise ftputil.error.FTPIOError("invalid mode '{}'".format(mode))
    5757        if "b" in mode and "t" in mode:
    5858            # Raise a `ValueError` like Python would.
     
    6767        # Always use binary mode (see comments above).
    6868        transfer_type = "I"
    69         command = "TYPE {0}".format(transfer_type)
     69        command = "TYPE {}".format(transfer_type)
    7070        with ftputil.error.ftplib_error_to_ftp_io_error:
    7171            self._session.voidcmd(command)
    7272        # Make transfer command.
    7373        command_type = "RETR" if is_read_mode else "STOR"
    74         command = "{0} {1}".format(command_type, path)
     74        command = "{} {}".format(command_type, path)
    7575        # Force to binary regardless of transfer type (see above).
    7676        makefile_mode = mode
     
    141141            return getattr(self._fobj, attr_name)
    142142        raise AttributeError(
    143                 "'FTPFile' object has no attribute '{0}'".format(attr_name))
     143                "'FTPFile' object has no attribute '{}'".format(attr_name))
    144144
    145145    # TODO: Implement `__dir__`? (See
Note: See TracChangeset for help on using the changeset viewer.