Commit Graph

154 Commits

Author SHA1 Message Date
Victor Stinner ef0e72b31d
gh-94172: Remove keyfile, certfile and check_hostname parameters (#94173)
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.
2022-11-03 18:32:25 +01:00
Jürgen Gmach 2138b2edaf
bpo-44045: fix spelling of uppercase vs upper-case (GH-25985)
And also of lowercase vs lower-case.

The `-` notation should only be used for adjectives.
2021-05-28 17:54:25 -03:00
Sanyam Khurana 8a3d2af997
bpo-26543: Fix IMAP4.noop when debug mode is enabled (GH-15206) 2020-06-02 03:17:45 +02:00
Dong-hee Na c5c42815ec
bpo-40375: Implement imaplib.IMAP4.unselect (GH-19712) 2020-04-27 23:52:55 +09:00
Dong-hee Na 13a7ee8d62 bpo-38615: Add timeout parameter for IMAP4 and IMAP4_SSL constructor (GH-17203)
imaplib.IMAP4 and imaplib.IMAP4_SSL now have an 
optional *timeout* parameter for their constructors.
Also, the imaplib.IMAP4.open() method now has an optional *timeout* parameter
with this change. The overridden methods of imaplib.IMAP4_SSL and
imaplib.IMAP4_stream were applied to this change.
2020-01-07 18:28:10 +01:00
Min ho Kim c4cacc8c5e Fix typos in comments, docs and test names (#15018)
* Fix typos in comments, docs and test names

* Update test_pyparse.py

account for change in string length

* Apply suggestion: splitable -> splittable

Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu>

* Apply suggestion: splitable -> splittable

Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu>

* Apply suggestion: Dealloccte -> Deallocate

Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu>

* Update posixmodule checksum.

* Reverse idlelib changes.
2019-07-30 18:16:13 -04:00
Steve Dower 44f91c388a
bpo-37390: Add audit event table to documentations (GH-14406)
Also updates some (unreleased) event names to be consistent with the others.
2019-06-27 10:47:59 -07:00
Steve Dower 60419a7e96
bpo-37363: Add audit events for a range of modules (GH-14301) 2019-06-24 08:42:54 -07:00
Victor Stinner 74125a60b7
bpo-36348: IMAP4.logout() doesn't ignore exc (GH-12411)
The imap.IMAP4.logout() method no longer ignores silently arbitrary
exceptions.

Changes:

* The IMAP4.logout() method now expects a "BYE" untagged response,
  rather than relying on _check_bye() which raises a self.abort()
  exception.
* IMAP4.__exit__() now does nothing if the client already logged out.
* Add more debug info if test_logout() tests fail.
2019-04-15 18:23:20 +02:00
Pablo Aguiar 4b5e62dbb2 bpo-35128: Fix spacing issues in warning.warn() messages. (GH-10268) 2018-11-01 12:33:35 +02:00
Berker Peksag e4dcbbd7f4
bpo-18540: Fix EAI_NONAME in imaplib.IMAP4*() (GH-8634) 2018-08-07 05:12:18 +03:00
Matěj Cepl caa331d492 bpo-33336, imaplib: Legalize MOVE command (GH-6569)
imaplib now allows MOVE command in IMAP4.uid() (RFC 6851:
IMAP MOVE Extension) and potentially as a name of supported
method of IMAP4 object.
2018-07-23 13:28:54 +02:00
Serhiy Storchaka a4a3020abc
bpo-32157: Removed explicit quotes around %r and {!r}. (#4582) 2017-11-28 22:54:42 +02:00
Victor Stinner 83a2c28798 bpo-30329: Catch Windows error 10022 on shutdown() (#1538)
Catch the Windows socket WSAEINVAL error (code 10022) in imaplib and
poplib on shutdown(SHUT_RDWR): An invalid operation was attempted

This error occurs sometimes on SSL connections.
2017-05-15 17:33:45 +02:00
R David Murray a7613aa06c Merge: #25591: improve imap tests. 2016-12-24 21:34:05 -05:00
R David Murray b079c07f7d #25591: improve imap tests.
Patch by Maciej Szulik.
2016-12-24 21:32:26 -05:00
Christian Heimes d04863771b Issue #28022: Deprecate ssl-related arguments in favor of SSLContext.
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.
2016-09-10 23:23:33 +02:00
R David Murray 44b548dda8 #27364: fix "incorrect" uses of escape character in the stdlib.
And most of the tools.

Patch by Emanual Barry, reviewed by me, Serhiy Storchaka, and
Martin Panter.
2016-09-08 13:59:53 -04:00
R David Murray 317f64f048 #21815: violate IMAP RFC to be compatible with, e.g., gmail
and others, including imaplib's own behavior.  I'm applying this only to 3.6
because there's a potential backward compatibility concern: if there are
servers that include ] characters in the 'text' portion of their imap
responses, this code change could introduce a new bug.

Patch by Lita Cho, reviewed by Jessica McKellar, Berker Peksag, Maciej Szulik,
silentghost, and me (I fleshed out the comments with the additional
info/concerns.)
2016-01-02 17:18:34 -05:00
Robert Collins 78378e8939 Issue #23779: imaplib raises TypeError if authenticator tries to abort.
Patch from Craig Holmquist.
2015-07-31 09:01:38 +12:00
Robert Collins 5ccc18f298 Issue #23779: imaplib raises TypeError if authenticator tries to abort.
Patch from Craig Holmquist.
2015-07-31 08:59:02 +12:00
R David Murray a6429db4b8 #21800: Add RFC 6855 support to imaplib.
Original patch by Milan Oberkirch, updated by myself and
Maciej Szulik.
2015-05-10 19:17:23 -04:00
R David Murray 94a6448956 Merge: #23647: Increase imaplib's MAXLINE to accommodate modern mailbox sizes. 2015-03-22 16:18:59 -04:00
R David Murray 936da2a796 #23647: Increase imaplib's MAXLINE to accommodate modern mailbox sizes. 2015-03-22 16:17:46 -04:00
Benjamin Peterson 7243b574e5 don't require OpenSSL SNI to pass hostname to ssl functions (#22921)
Patch by Donald Stufft.
2014-11-23 17:04:34 -06:00
Benjamin Peterson f9284ae8ed merge 3.4 (#22921) 2014-11-23 17:06:39 -06:00
Serhiy Storchaka 38684c3663 imaplib.IMAP4 now supports the context manager protocol.
Original patch by Tarek Ziadé.
2014-09-09 19:07:49 +03:00
R David Murray 95ff7239bd #20013: don't raise socket error when selected mailbox deleted.
I'm checking this in without a test because not much of this code
is tested and I don't have time to work up the necessary extensions
to the existing test framework.

The patch itself was tested by the person who reported the bug.
2014-02-07 13:44:57 -05:00
Christian Heimes 48aae57996 Issue #19782: imaplib now supports SSLContext.check_hostname and server name
indication for TLS/SSL connections.
2013-12-02 20:01:29 +01:00
Christian Heimes 67986f9431 Issue #19735: Implement private function ssl._create_stdlib_context() to
create SSLContext objects in Python's stdlib module. It provides a single
configuration point and makes use of SSLContext.load_default_certs().
2013-11-23 22:43:47 +01:00
Christian Heimes 634919a9fa Issue #17276: MD5 as default digestmod for HMAC is deprecated. The HMAC
module supports digestmod names, e.g. hmac.HMAC('sha1').
2013-11-20 17:23:06 +01:00
Georg Brandl b89b5df9c9 merge with 3.3 2013-10-27 07:46:09 +01:00
Georg Brandl ca580f4ec1 Issue #16039: CVE-2013-1752: Change use of readline in imaplib module to limit
line length.  Patch by Emil Lind.
2013-10-27 06:52:14 +01:00
Brett Cannon cd171c8e92 Issue #18200: Back out usage of ModuleNotFoundError (8d28d44f3a9a) 2013-07-04 17:43:24 -04:00
R David Murray 3bca8ac3d0 Improve imap error message in unusual failure mode.
We ran into this during the sprits at PyCon and this patch has been
sitting on my disk ever since.  This just adds some information to the
error message that we found useful during debugging.  There's no good
way to add a test, since the message only got generated via code
that we had modified for debugging purposes.
2013-06-28 14:52:57 -04:00
Brett Cannon 0a140668fa Issue #18200: Update the stdlib (except tests) to use
ModuleNotFoundError.
2013-06-13 20:57:26 -04:00
R David Murray 660e89b163 Merge: #17443: Fix buffering in IMAP4_stream.
In Python2 Popen uses *FILE objects, which wind up buffering even though
subprocess defaults to no buffering.  In Python3, subprocess streams really
are unbuffered by default, but the imaplib code assumes read is buffered.  This
patch uses the default buffer size from the io module to get buffered streams
from Popen.

Much debugging work and patch by Diane Trout.

The imap protocol is too complicated to write a test for this simple
change with our current level of test infrastructure.
2013-03-19 13:56:54 -04:00
R David Murray 7889944b83 Merge: #17443: Fix buffering in IMAP4_stream.
In Python2 Popen uses *FILE objects, which wind up buffering even though
subprocess defaults to no buffering.  In Python3, subprocess streams really
are unbuffered by default, but the imaplib code assumes read is buffered.  This
patch uses the default buffer size from the io module to get buffered streams
from Popen.

Much debugging work and patch by Diane Trout.

The imap protocol is too complicated to write a test for this simple
change with our current level of test infrastructure.
2013-03-19 13:56:01 -04:00
R David Murray fcb6d6a3b3 #17443: Fix buffering in IMAP4_stream.
In Python2 Popen uses *FILE objects, which wind up buffering even though
subprocess defaults to no buffering.  In Python3, subprocess streams really
are unbuffered by default, but the imaplib code assumes read is buffered.  This
patch uses the default buffer size from the io module to get buffered streams
from Popen.

Much debugging work and patch by Diane Trout.

The imap protocol is too complicated to write a test for this simple
change with our current level of test infrastructure.
2013-03-19 13:52:33 -04:00
R David Murray 8aa164b395 Merge: #13700: Make imap.authenticate with authobject work.
This fixes a bytes/string confusion in the API which prevented
custom authobjects from working at all.

Original patch by Erno Tukia.
2013-02-19 12:20:32 -05:00
R David Murray 6cd6f01556 Merge: #13700: Make imap.authenticate with authobject work.
This fixes a bytes/string confusion in the API which prevented
custom authobjects from working at all.

Original patch by Erno Tukia.
2013-02-19 12:19:13 -05:00
R David Murray 774a39f26e #13700: Make imap.authenticate with authobject work.
This fixes a bytes/string confusion in the API which prevented
custom authobjects from working at all.

Original patch by Erno Tukia.
2013-02-19 12:17:31 -05:00
Andrew Svetlov 0832af6628 Issue #16717: get rid of socket.error, replace with OSError 2012-12-18 23:10:48 +02:00
Andrew Svetlov 5b89840d9c Issue #16714: use 'raise' exceptions, don't 'throw'.
Patch by Serhiy Storchaka.
2012-12-18 21:26:36 +02:00
Alexander Belopolsky 8141cc7f88 Issues #11024: Fixes and additional tests for Time2Internaldate. 2012-06-22 21:03:39 -04:00
Alexander Belopolsky 5a38f80f9c Issue #10941: Fix imaplib.Internaldate2tuple to produce correct result near
the DST transition.  Patch by Joe Peterson.
2012-04-29 16:12:27 -04:00
Alexander Belopolsky 2420d83158 Issue #10941: Fix imaplib.Internaldate2tuple to produce correct result near
the DST transition.  Patch by Joe Peterson.
2012-04-29 15:56:49 -04:00
Florent Xicluna e41f0de84d Merge 3.2, fix typos. 2011-11-11 19:39:25 +01:00
Florent Xicluna 992d9e081f Fix few typos. 2011-11-11 19:35:42 +01:00
Charles-François Natali 1f4560c872 Issue #1441530: In imaplib, read the data in one chunk to speed up large
reads and simplify code.
2011-05-24 23:47:49 +02:00