Custom Query (120 matches)


Show under each result:

Results (31 - 33 of 120)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
Ticket Resolution Summary Owner Reporter
#98 fixed Migrate current unit tests to use the `mock` and `py.test` packages schwa schwa

The design of the current ftputil test suite is from the beginnings of ftputil in the early 2000s.


The used approach for mocking ftplib.FTP can, if not being careful, create dependencies between tests, so the mocking approach should be changed anyway. Since nowadays the mock package is pretty good I think I should experiment with using it instead of using the current approach. I've used the mock package in another project with good results. That said, it's possible to write mocking setups that are difficult to understand. In some cases it may be easier to use conventional mocking.


py.test is a very flexible testing library that also makes tests more compact. I've known the library for a long time, but haven't used it yet because I assumed the won compactness wouldn't justify the rework. Now, since the tests should be revised anyway, I'd like to try using py.test.

#97 duplicate Can't connect FTPHost with ftputil 3.2, Python 3.3.0 (win32) schwa ftputiluser

I just installed your lib and tried to run your sample code:

with ftputil.FTPHost(FtpCred['host'],FtpCred['userid'],FtpCred['password']) as ftpHost:

Got the following error:

Traceback (most recent call last):
  File "C:\Program Files\Python33\lib\site-packages\ftputil\", line 129, in _make_session
    return factory(*args, **kwargs)
  File "C:\Program Files\Python33\lib\", line 114, in __init__
  File "C:\Program Files\Python33\lib\", line 148, in connect
  File "C:\Program Files\Python33\lib\", line 406, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
socket.gaierror: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 420, in run_nodebug
  File "C:\Users\npochez\Documents\GitHub\RunKS-1\", line 21, in <module>
    with ftputil.FTPHost(FtpCred['host'],FtpCred['userid'],FtpCred['password']) as ftpHost:
  File "C:\Program Files\Python33\lib\site-packages\ftputil\", line 69, in __init__
    self._session = self._make_session()
  File "C:\Program Files\Python33\lib\site-packages\ftputil\", line 129, in _make_session
    return factory(*args, **kwargs)
  File "C:\Program Files\Python33\lib\site-packages\ftputil\", line 146, in __exit__
    raise FTPOSError(*exc_value.args, original_exception=exc_value)
ftputil.error.FTPOSError: [Errno 11001] getaddrinfo failed
Debugging info: ftputil 3.2, Python 3.3.0 (win32)
#96 fixed Explain why we get "latin1-encoded unicode strings" for paths schwa schwa

刘昶 wrote to the ftputil mailing list with the following observation:

test Enviroment:
Server: File Zilla Server 0.9.50 
Client OS: Win7

import ftputil
# Download some files from the login directory.
with ftputil.FTPHost("localhost", user='honglei',passwd='111111' ) as ftp_host:
    names = ftp_host.listdir(ftp_host.curdir)

I find that:
   name[-1] == u'\xe8\xbf\x99\xe6\x98\xaf\xe4\xb8\xad\xe6\x96\x87.txt', 
it is a 'utf-8' encoded filename, rather than an unicode string.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
Note: See TracQuery for help on using queries.