Ignore:
Timestamp:
Nov 1, 2015, 9:58:58 PM (4 years ago)
Author:
Stefan Schwarzer <sschwarzer@…>
Branch:
default
amend_source:
394a2ca76938f4aa60087aad847233879fac6b22
Message:
Adapt session factories for use with Python 2

The background is explained in the commit message for changeset
5a4abb73e8a1 and in ticket #100.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ftputil/host.py

    r1565 r1601  
    2121import ftputil.file_transfer
    2222import ftputil.path
     23import ftputil.session_adapter
    2324import ftputil.stat
    2425import ftputil.tool
     
    126127        # `FTPHost` object's child sessions.
    127128        factory = kwargs.pop("session_factory", ftplib.FTP)
     129        # Adapt session factories so that they accept unicode strings
     130        # with non-ASCII characters (as long as the string contains
     131        # only code points <= 255). See the docstring in
     132        # `session_adapter` for details.
     133        factory = ftputil.session_adapter.adapted_session_factory(factory)
    128134        with ftputil.error.ftplib_error_to_ftp_os_error:
    129135            return factory(*args, **kwargs)
Note: See TracChangeset for help on using the changeset viewer.