This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Test test_imaplib fail in test_imap4_host_default_value
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.7
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Petr Stupka, miss-islington, vstinner
Priority: normal Keywords: patch

Created on 2018-12-15 00:20 by Petr Stupka, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 11823 merged mcepl, 2019-02-12 00:35
PR 11829 merged miss-islington, 2019-02-12 18:30
Messages (4)
msg331881 - (view) Author: Petr Stupka (Petr Stupka) Date: 2018-12-15 00:20
OS: CentOS Linux release 7.6.1810 (Core)

FAIL: test_imap4_host_default_value (test.test_imaplib.TestImaplib)
Traceback (most recent call last):
  File "/home/stupka/build/Python-3.7.1/Lib/test/", line 83, in test_imap4_host_default_value
AssertionError: OSError not raised

/home/stupka/build/Python-3.7.1/Lib/ ResourceWarning: unclosed <socket.socket fd=3, family=AddressFamily.AF_INET6, type=SocketKind.SOCK_STREAM, proto=6, laddr=('::1', 59922, 0, 0), 
raddr=('::1', 143, 0, 0)>
  self._sock = None


This test fails when there is (in my case) dovecot running and listening
on ::1, port 143 - expected exception is not raised.
With dovecot stopped and nothing listening on port 143 the test passes.

It should probably check if there is something listening on ::1:143 and if so then the test can be skipped?
msg335342 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-02-12 18:30
New changeset 3dc67d0316740e78e7cd014343f34d85908219b7 by Victor Stinner (Matěj Cepl) in branch 'master':
bpo-35505: Skip test_imap4_host_default_value if localhost listens on IMAP port (GH-11823)
msg335345 - (view) Author: miss-islington (miss-islington) Date: 2019-02-12 18:54
New changeset 009220eae2e6b456707c1c89ef3f344b682e89d5 by Miss Islington (bot) in branch '3.7':
bpo-35505: Skip test_imap4_host_default_value if localhost listens on IMAP port (GH-11823)
msg335369 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-02-12 20:57
Thanks Matěj Cepl for the fix and thanks Petr Stupka for the bug report ;-)
Date User Action Args
2022-04-11 14:59:09adminsetgithub: 79686
2019-02-12 20:57:12vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg335369

stage: patch review -> resolved
2019-02-12 18:54:35miss-islingtonsetnosy: + miss-islington
messages: + msg335345
2019-02-12 18:30:40miss-islingtonsetpull_requests: + pull_request11860
2019-02-12 18:30:23vstinnersetnosy: + vstinner
messages: + msg335342
2019-02-12 00:35:27mceplsetkeywords: + patch
stage: patch review
pull_requests: + pull_request11853
2018-12-15 00:20:22Petr Stupkacreate