Ignore:
Timestamp:
Dec 25, 2018, 10:55:24 PM (2 years ago)
Author:
Stefan Schwarzer <sschwarzer@…>
Branch:
default
histedit_source:
160218f7e8d5388866cabb8ce12f3d2f32ec82ca,bd2e407ea486f11e94d86b0419db5e02843089e1
Message:
Set `use_list_a_option` to `False` by default

See ticket #110 for the reasoning.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/ftputil.txt

    r1698 r1711  
    458458Whether ftputil sees "hidden" files and directories (usually files or
    459459directories whose names start with a dot) depends on the FTP server
    460 configuration. By default, ftputil uses the ``-a`` option in the FTP
    461 ``LIST`` command to find hidden files. However, the server may ignore
    462 this.
    463 
    464 If using the ``-a`` option leads to problems, for example if an
    465 FTP server causes an exception, you may switch off the use of the
    466 option::
     460configuration. By default, ftputil does *not* use the ``-a`` option in
     461the FTP ``LIST`` command to find hidden files.
     462
     463To tell the server to list hidden directories and files, set
     464``FTPHost.use_list_a_option`` to ``True``::
    467465
    468466    ftp_host = ftputil.FTPHost(server, user, password, account,
    469467                               session_factory=ftplib.FTP)
    470     ftp_host.use_list_a_option = False
     468    ftp_host.use_list_a_option = True
     469
     470Caveats:
     471
     472- If the server doesn't understand the ``-a`` option at all, the
     473  server may interpret ``-a`` as the name of a file or directory,
     474  which can result in odd behavior. Therefore, use ``-a`` only if
     475  you're sure the server you're talking to supports it. Another
     476  approach is to have test code for ``-a`` support and fall back to
     477  not using the option.
     478
     479- Even if the server knows about the ``-a`` option, the server may
     480  be configured to ignore it.
    471481
    472482``FTPHost`` attributes and methods
Note: See TracChangeset for help on using the changeset viewer.