summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ftplib.py
Commit message (Collapse)AuthorAgeFilesLines
* gh-72719: Remove asyncore and asynchat modules (#96580)Nikita Sobolev2022-11-081-4/+2
| | | | | Remove modules asyncore and asynchat, which were deprecated by PEP 594. Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-94172: Remove keyfile, certfile and check_hostname parameters (#94173)Victor Stinner2022-11-031-3/+3
| | | | | | | | | | | | Remove the keyfile, certfile and check_hostname parameters, deprecated since Python 3.6, in modules: ftplib, http.client, imaplib, poplib and smtplib. Use the context parameter (ssl_context in imaplib) instead. Parameters following the removed parameters become keyword-only parameters. ftplib: Remove the FTP_TLS.ssl_version class attribute: use the context parameter instead.
* gh-92169: Use warnings_helper.import_deprecated() to import deprecated ↵Hugo van Kemenade2022-05-031-5/+4
| | | | modules uniformly in tests (GH-92170)
* bpo-40280: Skip socket, fork, subprocess tests on Emscripten (GH-31986)Christian Heimes2022-03-221-0/+1
| | | | | | | | | | | - Add requires_fork and requires_subprocess to more tests - Skip extension import tests if dlopen is not available - Don't assume that _testcapi is a shared extension - Skip a lot of socket tests that don't work on Emscripten - Skip mmap tests, mmap emulation is incomplete - venv does not work yet - Cannot get libc from executable The "entire" test suite is now passing on Emscripten with EMSDK from git head (91 suites are skipped).
* bpo-44359: Fix test_ftplib unhandled thread exceptions (GH-31069)Victor Stinner2022-02-021-4/+11
| | | | test_ftplib now silently ignores socket errors to prevent logging unhandled threading exceptions.
* Revert "bpo-28533: Remove asyncore, asynchat, smtpd modules (GH-29521)" ↵Victor Stinner2021-12-071-3/+7
| | | | | (GH-29951) This reverts commit 9bf2cbc4c498812e14f20d86acb61c53928a5a57.
* bpo-28533: Remove asyncore, asynchat, smtpd modules (GH-29521)Victor Stinner2021-11-151-7/+3
| | | | | | | | | | | | | | | | Remove the asyncore and asynchat modules, deprecated in Python 3.6: use the asyncio module instead. Remove the smtpd module, deprecated in Python 3.6: the aiosmtpd module can be used instead, it is based on asyncio. * Remove asyncore, asynchat and smtpd documentation * Remove test_asyncore, test_asynchat and test_smtpd * Rename Lib/asynchat.py to Lib/test/support/_asynchat.py * Rename Lib/asyncore.py to Lib/test/support/_asyncore.py * Rename Lib/smtpd.py to Lib/test/support/_smtpd.py * Remove DeprecationWarning from private _asyncore, _asynchat and _smtpd modules * _smtpd: remove deprecated properties
* bpo-45229: Remove test_main in many tests (GH-28405)Serhiy Storchaka2021-09-191-11/+4
| | | | | | | | | Instead of explicitly enumerate test classes for run_unittest() use the unittest ability to discover tests. This also makes these tests discoverable and runnable with unittest. load_tests() can be used for dynamic generating tests and adding doctests. setUpModule(), tearDownModule() and addModuleCleanup() can be used for running code before and after all module tests.
* bpo-44498: suppress DeprecationWarnings for asynchat, asyncore and smtpd in ↵Irit Katriel2021-06-241-2/+7
| | | | tests (GH-26905)
* bpo-43880: Show DeprecationWarnings for deprecated ssl module features ↵Christian Heimes2021-04-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-25455) * ssl.OP_NO_SSLv2 * ssl.OP_NO_SSLv3 * ssl.OP_NO_TLSv1 * ssl.OP_NO_TLSv1_1 * ssl.OP_NO_TLSv1_2 * ssl.OP_NO_TLSv1_3 * ssl.PROTOCOL_SSLv2 * ssl.PROTOCOL_SSLv3 * ssl.PROTOCOL_SSLv23 (alias for PROTOCOL_TLS) * ssl.PROTOCOL_TLS * ssl.PROTOCOL_TLSv1 * ssl.PROTOCOL_TLSv1_1 * ssl.PROTOCOL_TLSv1_2 * ssl.TLSVersion.SSLv3 * ssl.TLSVersion.TLSv1 * ssl.TLSVersion.TLSv1_1 * ssl.wrap_socket() * ssl.RAND_pseudo_bytes() * ssl.RAND_egd() (already removed since it's not supported by OpenSSL 1.1.1) * ssl.SSLContext() without a protocol argument * ssl.match_hostname() * hashlib.pbkdf2_hmac() (pure Python implementation, fast OpenSSL function will stay) Signed-off-by: Christian Heimes <christian@python.org>
* bpo-43285 Make ftplib not trust the PASV response. (GH-24838)Gregory P. Smith2021-03-151-1/+26
| | | | | | | | | | | | | | | bpo-43285: Make ftplib not trust the PASV response. The IPv4 address value returned from the server in response to the PASV command should not be trusted. This prevents a malicious FTP server from using the response to probe IPv4 address and port combinations on the client network. Instead of using the returned address, we use the IP address we're already connected to. This is the strategy other ftp clients adopted, and matches the only strategy available for the modern IPv6 EPSV command where the server response must return a port number and nothing else. For the rare user who _wants_ this ugly behavior, set a `trust_server_pasv_ipv4_address` attribute on your `ftplib.FTP` instance to True.
* bpo-42413: socket.timeout is now an alias of TimeoutError (GH-23413)Christian Heimes2020-11-201-1/+1
| | | Signed-off-by: Christian Heimes <christian@python.org>
* bpo-41521: Rename blacklist parameter to not_exported (GH-21824)Victor Stinner2020-08-171-4/+5
| | | | Rename "blacklist" parameter of test.support.check__all__() to "not_exported".
* bpo-40275: Use new test.support helper submodules in tests (GH-21448)Hai Shi2020-08-031-1/+2
|
* bpo-40275: Adding threading_helper submodule in test.support (GH-20263)Hai Shi2020-05-271-2/+3
|
* bpo-40275: Avoid importing socket in test.support (GH-19603)Serhiy Storchaka2020-04-251-5/+6
| | | | | | * Move socket related functions from test.support to socket_helper. * Import socket, nntplib and urllib.error lazily in transient_internet(). * Remove importing multiprocess.
* bpo-39380: Change ftplib encoding from latin-1 to utf-8 (GH-18048)Sebastian Pedersen2020-04-131-32/+62
| | | | | Add the encoding in ftplib.FTP and ftplib.FTP_TLS to the constructor as keyword-only and change the default from "latin-1" to "utf-8" to follow RFC 2640.
* bpo-39259: ftplib.FTP/FTP_TLS now reject timeout = 0 (GH-17959)Dong-hee Na2020-01-131-0/+4
|
* bpo-38614: Use test.support.LOOPBACK_TIMEOUT constant (GH-17554)Victor Stinner2019-12-101-1/+1
| | | | | Replace hardcoded timeout constants in tests with LOOPBACK_TIMEOUT of test.support, so it's easier to ajdust this timeout for all tests at once.
* Remove binding of captured exceptions when not used to reduce the chances of ↵Pablo Galindo2019-11-191-1/+1
| | | | | | | creating cycles (GH-17246) Capturing exceptions into names can lead to reference cycles though the __traceback__ attribute of the exceptions in some obscure cases that have been reported previously and fixed individually. As these variables are not used anyway, we can remove the binding to reduce the chances of creating reference cycles. See for example GH-13135
* bpo-35934: Add socket.create_server() utility function (GH-11784)Giampaolo Rodola2019-04-081-6/+3
|
* bpo-34391: Fix ftplib test for TLS 1.3 (GH-8787)Christian Heimes2018-08-161-0/+5
| | | | | | | | | | | | Read from data socket to avoid "[SSL] shutdown while in init" exception during shutdown of the dummy server. Signed-off-by: Christian Heimes <christian@python.org> <!-- issue-number: [bpo-34391](https://www.bugs.python.org/issue34391) --> https://bugs.python.org/issue34391 <!-- /issue-number -->
* bpo-33618: Enable TLS 1.3 in tests (GH-7079)Christian Heimes2018-05-231-7/+3
| | | | | | | | | | | | TLS 1.3 behaves slightly different than TLS 1.2. Session tickets and TLS client cert auth are now handled after the initialy handshake. Tests now either send/recv data to trigger session and client certs. Or tests ignore ConnectionResetError / BrokenPipeError on the server side to handle clients that force-close the socket fd. To test TLS 1.3, OpenSSL 1.1.1-pre7-dev (git master + OpenSSL PR https://github.com/openssl/openssl/pull/6340) is required. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-32947: OpenSSL 1.1.1-pre1 / TLS 1.3 fixes (#5663)Christian Heimes2018-02-271-0/+6
| | | | | | | | | | | | | | | | | | * bpo-32947: OpenSSL 1.1.1-pre1 / TLS 1.3 fixes Misc fixes and workarounds for compatibility with OpenSSL 1.1.1-pre1 and TLS 1.3 support. With OpenSSL 1.1.1, Python negotiates TLS 1.3 by default. Some test cases only apply to TLS 1.2. Other tests currently fail because the threaded or async test servers stop after failure. I'm going to address these issues when OpenSSL 1.1.1 reaches beta. OpenSSL 1.1.1 has added a new option OP_ENABLE_MIDDLEBOX_COMPAT for TLS 1.3. The feature is enabled by default for maximum compatibility with broken middle boxes. Users should be able to disable the hack and CPython's test suite needs it to verify default options. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-32706: Skip test_ftplib.test_check_hostname() (#5422)Victor Stinner2018-01-291-0/+1
| | | | | | This test is unstable and currently prevents to make any new change since the test always fails on Travis CI. Skip the test to get more time to fix it.
* bpo-31399: Let OpenSSL verify hostname and IP address (#3462)Christian Heimes2018-01-271-0/+3
| | | | | | | | | | | | | | | bpo-31399: Let OpenSSL verify hostname and IP The ssl module now uses OpenSSL's X509_VERIFY_PARAM_set1_host() and X509_VERIFY_PARAM_set1_ip() API to verify hostname and IP addresses. * Remove match_hostname calls * Check for libssl with set1_host, libssl must provide X509_VERIFY_PARAM_set1_host() * Add documentation for OpenSSL 1.0.2 requirement * Don't support OpenSSL special mode with a leading dot, e.g. ".example.org" matches "www.example.org". It's not standard conform. * Add hostname_checks_common_name Signed-off-by: Christian Heimes <christian@python.org>
* bpo-31346: Use PROTOCOL_TLS_CLIENT/SERVER (#3058)Christian Heimes2017-09-151-12/+6
| | | | | | Replaces PROTOCOL_TLSv* and PROTOCOL_SSLv23 with PROTOCOL_TLS_CLIENT and PROTOCOL_TLS_SERVER. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-31234: Fix dangling thread in test_ftplib (#3544)Victor Stinner2017-09-131-0/+2
| | | Clear also self.server_thread attribute in TestTimeouts.tearDown().
* bpo-31234: Fix dangling thread in test_ftp/poplib (#3540)Victor Stinner2017-09-131-0/+6
| | | | Explicitly clear the server attribute in test_ftplib and test_poplib to prevent dangling thread.
* bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou2017-09-071-1/+1
| | | | | | * Remove Setup.config * Always define WITH_THREAD for compatibility.
* bpo-30119: fix ftplib.FTP.putline() to throw an error for a illegal command ↵Dong-hee Na2017-07-221-1/+5
| | | | (#1214)
* bpo-30818: test_ftplib calls asyncore.close_all() (#2514)Victor Stinner2017-06-301-0/+3
| | | | | | | | | | Always clear asyncore socket map using asyncore.close_all(ignore_all=True) in tearDown() method. This change should fix this warning: Warning -- asyncore.socket_map was modified by test_ftplib Before: {} After: {4: <test.test_ftplib.DummyTLS_FTPServer 127.0.0.1:0 at 0x805feccf0>}
* Issue #28022: Deprecate ssl-related arguments in favor of SSLContext.Christian Heimes2016-09-101-4/+6
| | | | | | | The deprecation include manual creation of SSLSocket and certfile/keyfile (or similar) in ftplib, httplib, imaplib, smtplib, poplib and urllib. ssl.wrap_socket() is not marked as deprecated yet.
* Issue #23883: Add missing APIs to __all__; patch by Jacek KołodziejMartin Panter2015-11-141-1/+10
|
* merge 3.4 (#22935)Benjamin Peterson2014-12-061-1/+1
|\
| * allow ssl module to compile if openssl doesn't support SSL 3 (closes #22935)Benjamin Peterson2014-12-061-1/+1
| | | | | | | | Patch by Kurt Roeckx.
* | merge 3.4 (#22921)Benjamin Peterson2014-11-231-4/+0
|\ \ | |/
| * don't require OpenSSL SNI to pass hostname to ssl functions (#22921)Benjamin Peterson2014-11-231-4/+0
| | | | | | | | Patch by Donald Stufft.
* | Issue #6623: Remove deprecated Netrc class in the ftplib module.Berker Peksag2014-11-011-17/+6
| | | | | | | | Patch by Matt Chaput.
* | Issue #21566: Make use of socket.listen() default backlog.Charles-François Natali2014-07-231-3/+3
|/
* Issue #20555: Use specific asserts in urllib, httplib, ftplib, cgi, wsgiref ↵Serhiy Storchaka2014-02-081-3/+3
|\ | | | | | | tests.
| * Issue #20555: Use specific asserts in urllib, httplib, ftplib, cgi, wsgiref ↵Serhiy Storchaka2014-02-081-3/+3
| | | | | | | | tests.
| * Issue #18702: All skipped tests now reported as skipped.Serhiy Storchaka2013-11-031-7/+7
| |
* | fixed test_ftplibChristian Heimes2013-12-151-1/+1
| |
* | test_ftplib: skip check_hostname test when SNI is not availableChristian Heimes2013-12-151-0/+4
| |
* | Issue #19781: ftplib now supports SSLContext.check_hostname and server nameChristian Heimes2013-12-021-1/+32
| | | | | | | | indication for TLS/SSL connections.
* | Issue #18702: All skipped tests now reported as skipped.Serhiy Storchaka2013-11-031-7/+7
| |
* | Issue #16038: CVE-2013-1752: ftplib: Limit amount of data read bySerhiy Storchaka2013-10-201-1/+21
|\ \ | |/ | | | | | | limiting the call to readline(). Original patch by Michał Jastrzębski and Giampaolo Rodola.
| * Issue #16038: CVE-2013-1752: ftplib: Limit amount of data read bySerhiy Storchaka2013-10-201-1/+21
| | | | | | | | | | limiting the call to readline(). Original patch by Michał Jastrzębski and Giampaolo Rodola.
* | merge 3.3 (#19118)Benjamin Peterson2013-09-291-4/+0
|\ \ | |/