Compare commits

..

3 Commits

15 changed files with 41 additions and 14 deletions

View File

@ -4,7 +4,7 @@ Copyright
Python and this documentation is: Python and this documentation is:
Copyright © 2001-2020 Python Software Foundation. All rights reserved. Copyright © 2001-2021 Python Software Foundation. All rights reserved.
Copyright © 2000 BeOpen.com. All rights reserved. Copyright © 2000 BeOpen.com. All rights reserved.

View File

@ -100,7 +100,7 @@ PSF LICENSE AGREEMENT FOR PYTHON |release|
analyze, test, perform and/or display publicly, prepare derivative works, analyze, test, perform and/or display publicly, prepare derivative works,
distribute, and otherwise use Python |release| alone or in any derivative distribute, and otherwise use Python |release| alone or in any derivative
version, provided, however, that PSF's License Agreement and PSF's notice of version, provided, however, that PSF's License Agreement and PSF's notice of
copyright, i.e., "Copyright © 2001-2020 Python Software Foundation; All Rights copyright, i.e., "Copyright © 2001-2021 Python Software Foundation; All Rights
Reserved" are retained in Python |release| alone or in any derivative version Reserved" are retained in Python |release| alone or in any derivative version
prepared by Licensee. prepared by Licensee.

View File

@ -84,7 +84,7 @@ analyze, test, perform and/or display publicly, prepare derivative works,
distribute, and otherwise use Python alone or in any derivative version, distribute, and otherwise use Python alone or in any derivative version,
provided, however, that PSF's License Agreement and PSF's notice of copyright, provided, however, that PSF's License Agreement and PSF's notice of copyright,
i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Python Software Foundation; 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Python Software Foundation;
All Rights Reserved" are retained in Python alone or in any derivative version All Rights Reserved" are retained in Python alone or in any derivative version
prepared by Licensee. prepared by Licensee.

View File

@ -1082,6 +1082,7 @@ class LMTP(SMTP):
# Handle Unix-domain sockets. # Handle Unix-domain sockets.
try: try:
self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
if self.timeout is not socket._GLOBAL_DEFAULT_TIMEOUT:
self.sock.settimeout(self.timeout) self.sock.settimeout(self.timeout)
self.file = None self.file = None
self.sock.connect(host) self.sock.connect(host)

View File

@ -107,6 +107,9 @@ class MockSocket:
def close(self): def close(self):
pass pass
def connect(self, host):
pass
def socket(family=None, type=None, proto=None): def socket(family=None, type=None, proto=None):
return MockSocket(family) return MockSocket(family)
@ -152,8 +155,12 @@ error = socket_module.error
# Constants # Constants
_GLOBAL_DEFAULT_TIMEOUT = socket_module._GLOBAL_DEFAULT_TIMEOUT
AF_INET = socket_module.AF_INET AF_INET = socket_module.AF_INET
AF_INET6 = socket_module.AF_INET6 AF_INET6 = socket_module.AF_INET6
SOCK_STREAM = socket_module.SOCK_STREAM SOCK_STREAM = socket_module.SOCK_STREAM
SOL_SOCKET = None SOL_SOCKET = None
SO_REUSEADDR = None SO_REUSEADDR = None
if hasattr(socket_module, 'AF_UNIX'):
AF_UNIX = socket_module.AF_UNIX

View File

@ -82,7 +82,7 @@ class NetworkedNNTPTestsMixin:
desc = self.server.description(self.GROUP_NAME) desc = self.server.description(self.GROUP_NAME)
_check_desc(desc) _check_desc(desc)
# Another sanity check # Another sanity check
self.assertIn("Python", desc) self.assertIn(self.DESC, desc)
# With a pattern # With a pattern
desc = self.server.description(self.GROUP_PAT) desc = self.server.description(self.GROUP_PAT)
_check_desc(desc) _check_desc(desc)
@ -309,6 +309,7 @@ class NetworkedNNTPTests(NetworkedNNTPTestsMixin, unittest.TestCase):
NNTP_HOST = 'news.trigofacile.com' NNTP_HOST = 'news.trigofacile.com'
GROUP_NAME = 'fr.comp.lang.python' GROUP_NAME = 'fr.comp.lang.python'
GROUP_PAT = 'fr.comp.lang.*' GROUP_PAT = 'fr.comp.lang.*'
DESC = 'Python'
NNTP_CLASS = NNTP NNTP_CLASS = NNTP
@ -343,8 +344,11 @@ class NetworkedNNTP_SSLTests(NetworkedNNTPTests):
# 400 connections per day are accepted from each IP address." # 400 connections per day are accepted from each IP address."
NNTP_HOST = 'nntp.aioe.org' NNTP_HOST = 'nntp.aioe.org'
GROUP_NAME = 'comp.lang.python' # bpo-42794: aioe.test is one of the official groups on this server
GROUP_PAT = 'comp.lang.*' # used for testing: https://news.aioe.org/manual/aioe-hierarchy/
GROUP_NAME = 'aioe.test'
GROUP_PAT = 'aioe.*'
DESC = 'test'
NNTP_CLASS = getattr(nntplib, 'NNTP_SSL', None) NNTP_CLASS = getattr(nntplib, 'NNTP_SSL', None)

View File

@ -165,6 +165,17 @@ class LMTPGeneralTests(GeneralTests, unittest.TestCase):
client = smtplib.LMTP client = smtplib.LMTP
@unittest.skipUnless(hasattr(socket, 'AF_UNIX'), "test requires Unix domain socket")
def testUnixDomainSocketTimeoutDefault(self):
local_host = '/some/local/lmtp/delivery/program'
mock_socket.reply_with(b"220 Hello world")
try:
client = self.client(local_host, self.port)
finally:
mock_socket.setdefaulttimeout(None)
self.assertIsNone(client.sock.gettimeout())
client.close()
def testTimeoutZero(self): def testTimeoutZero(self):
super().testTimeoutZero() super().testTimeoutZero()
local_host = '/some/local/lmtp/delivery/program' local_host = '/some/local/lmtp/delivery/program'

View File

@ -36,7 +36,7 @@
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>IDLE</string> <string>IDLE</string>
<key>CFBundleGetInfoString</key> <key>CFBundleGetInfoString</key>
<string>%version%, © 2001-2020 Python Software Foundation</string> <string>%version%, © 2001-2021 Python Software Foundation</string>
<key>CFBundleIconFile</key> <key>CFBundleIconFile</key>
<string>IDLE.icns</string> <string>IDLE.icns</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>

View File

@ -40,7 +40,7 @@
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>Python Launcher</string> <string>Python Launcher</string>
<key>CFBundleGetInfoString</key> <key>CFBundleGetInfoString</key>
<string>%VERSION%, © 2001-2020 Python Software Foundation</string> <string>%VERSION%, © 2001-2021 Python Software Foundation</string>
<key>CFBundleIconFile</key> <key>CFBundleIconFile</key>
<string>PythonLauncher.icns</string> <string>PythonLauncher.icns</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>

View File

@ -37,7 +37,7 @@
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleLongVersionString</key> <key>CFBundleLongVersionString</key>
<string>%version%, (c) 2001-2020 Python Software Foundation.</string> <string>%version%, (c) 2001-2021 Python Software Foundation.</string>
<key>CFBundleName</key> <key>CFBundleName</key>
<string>Python</string> <string>Python</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>

View File

@ -0,0 +1,2 @@
Configure LMTP Unix-domain socket to use socket global default timeout when
a timeout is not explicitly provided.

View File

@ -0,0 +1,2 @@
Update test_nntplib to use offical group name of news.aioe.org for testing.
Patch by Dong-hee Na.

View File

@ -5,7 +5,7 @@
#include "winver.h" #include "winver.h"
#define PYTHON_COMPANY "Python Software Foundation" #define PYTHON_COMPANY "Python Software Foundation"
#define PYTHON_COPYRIGHT "Copyright \xA9 2001-2016 Python Software Foundation. Copyright \xA9 2000 BeOpen.com. Copyright \xA9 1995-2001 CNRI. Copyright \xA9 1991-1995 SMC." #define PYTHON_COPYRIGHT "Copyright \xA9 2001-2021 Python Software Foundation. Copyright \xA9 2000 BeOpen.com. Copyright \xA9 1995-2001 CNRI. Copyright \xA9 1991-1995 SMC."
#define MS_WINDOWS #define MS_WINDOWS
#include "modsupport.h" #include "modsupport.h"

View File

@ -4,7 +4,7 @@
static const char cprt[] = static const char cprt[] =
"\ "\
Copyright (c) 2001-2020 Python Software Foundation.\n\ Copyright (c) 2001-2021 Python Software Foundation.\n\
All Rights Reserved.\n\ All Rights Reserved.\n\
\n\ \n\
Copyright (c) 2000 BeOpen.com.\n\ Copyright (c) 2000 BeOpen.com.\n\

View File

@ -22,7 +22,7 @@ This is Python version 3.10.0 alpha 3
:target: https://python.zulipchat.com :target: https://python.zulipchat.com
Copyright (c) 2001-2020 Python Software Foundation. All rights reserved. Copyright (c) 2001-2021 Python Software Foundation. All rights reserved.
See the end of this file for further copyright and license information. See the end of this file for further copyright and license information.
@ -250,7 +250,7 @@ See :pep:`619` for Python 3.10 release details.
Copyright and License Information Copyright and License Information
--------------------------------- ---------------------------------
Copyright (c) 2001-2020 Python Software Foundation. All rights reserved. Copyright (c) 2001-2021 Python Software Foundation. All rights reserved.
Copyright (c) 2000 BeOpen.com. All rights reserved. Copyright (c) 2000 BeOpen.com. All rights reserved.