Changeset 2047:0a801e8f639c


Ignore:
Timestamp:
Feb 1, 2021, 5:57:29 PM (10 months ago)
Author:
Stefan Schwarzer <sschwarzer@…>
Branch:
default
Message:
Describe new behavior for missing encoding

Raise `NoEncodingError` instead of falling back to latin-1.

ticket: 143
File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/ftputil.txt

    r2044 r2047  
    9696        InternalError(FTPError)
    9797            InaccessibleLoginDirError(InternalError)
     98            NoEncodingError(InternalError)
    9899            ParserError(InternalError)
    99100            RootDirError(InternalError)
     
    218219  upon login is not accessible, i. e. a ``chdir`` call with the
    219220  directory as argument would fail.
     221
     222- ``NoEncodingError``
     223
     224  is raised if an FTP session instance doesn't have an ``encoding``
     225  attribute (see also `session factories`_).
    220226
    221227- ``ParserError``
     
    500506ftputil tries to get the encoding for the FTP server from the
    501507``encoding`` attribute of the session instance (say, an instance of
    502 ``ftplib.FTP``). If no ``encoding`` attribute is present, the behavior
    503 is undefined.
     508``ftplib.FTP``). If no ``encoding`` attribute is present, a
     509``NoEncodingError`` is raised.
    504510
    505511All encoding/decoding steps must use the same encoding, the encoding
     
    523529- If possible, use only ASCII characters in paths.
    524530- If possible, pass paths to ftputil as ``str``, not ``bytes``.
    525 - If you use a custom session factory and ``bytes`` paths, the session
    526   instances created by the factory must have an ``encoding`` attribute
    527   with the name of the path encoding to use. If your session instances
    528   don't have an ``encoding`` attribute, ftputil behavior is undefined.
     531- If you use a custom session factory, the session instances created
     532  by the factory must have an ``encoding`` attribute with the name of
     533  the path encoding to use. If your session instances don't have an
     534  ``encoding`` attribute, ftputil raises a ``NoEncodingError`` when
     535  the session is created.
    529536
    530537
Note: See TracChangeset for help on using the changeset viewer.