Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d92af0f

Browse files
committed
Merge 3.4.0a3 release changes.
2 parents e9cbd18 + 5d23e6d commit d92af0f

26 files changed

Lines changed: 84 additions & 986 deletions

Doc/library/ssl.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,8 @@ SSL sockets also have the following additional methods and attributes:
659659
.. method:: SSLSocket.getpeercert(binary_form=False)
660660

661661
If there is no certificate for the peer on the other end of the connection,
662-
returns ``None``.
662+
return ``None``. If the SSL handshake hasn't been done yet, raise
663+
:exc:`ValueError`.
663664

664665
If the ``binary_form`` parameter is :const:`False`, and a certificate was
665666
received from the peer, this method returns a :class:`dict` instance. If the
@@ -716,6 +717,9 @@ SSL sockets also have the following additional methods and attributes:
716717
The returned dictionary includes additional items such as ``issuer``
717718
and ``notBefore``.
718719

720+
.. versionchanged:: 3.4
721+
:exc:`ValueError` is raised when the handshake isn't done.
722+
719723
.. method:: SSLSocket.cipher()
720724

721725
Returns a three-value tuple containing the name of the cipher being used, the

Lib/distutils/command/build_ext.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,10 @@ def finalize_options(self):
242242
# building python standard extensions
243243
self.library_dirs.append('.')
244244

245-
# for extensions under Linux or Solaris with a shared Python library,
245+
# For building extensions with a shared Python library,
246246
# Python's library directory must be appended to library_dirs
247-
sysconfig.get_config_var('Py_ENABLE_SHARED')
248-
if (sys.platform.startswith(('linux', 'gnu', 'sunos'))
249-
and sysconfig.get_config_var('Py_ENABLE_SHARED')):
247+
# See Issues: #1600860, #4366
248+
if (sysconfig.get_config_var('Py_ENABLE_SHARED')):
250249
if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")):
251250
# building third party extensions
252251
self.library_dirs.append(sysconfig.get_config_var('LIBDIR'))

Lib/distutils/tests/test_cmd.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@ def test_ensure_string_list(self):
3434
self.assertRaises(DistutilsOptionError,
3535
cmd.ensure_string_list, 'not_string_list2')
3636

37+
cmd.option1 = 'ok,dok'
38+
cmd.ensure_string_list('option1')
39+
self.assertEqual(cmd.option1, ['ok', 'dok'])
40+
41+
cmd.option2 = ['xxx', 'www']
42+
cmd.ensure_string_list('option2')
43+
44+
cmd.option3 = ['ok', 2]
45+
self.assertRaises(DistutilsOptionError, cmd.ensure_string_list,
46+
'option3')
47+
48+
3749
def test_make_file(self):
3850

3951
cmd = self.cmd
@@ -77,19 +89,6 @@ def test_ensure_string(self):
7789
cmd.option3 = 1
7890
self.assertRaises(DistutilsOptionError, cmd.ensure_string, 'option3')
7991

80-
def test_ensure_string_list(self):
81-
cmd = self.cmd
82-
cmd.option1 = 'ok,dok'
83-
cmd.ensure_string_list('option1')
84-
self.assertEqual(cmd.option1, ['ok', 'dok'])
85-
86-
cmd.option2 = ['xxx', 'www']
87-
cmd.ensure_string_list('option2')
88-
89-
cmd.option3 = ['ok', 2]
90-
self.assertRaises(DistutilsOptionError, cmd.ensure_string_list,
91-
'option3')
92-
9392
def test_ensure_filename(self):
9493
cmd = self.cmd
9594
cmd.option1 = __file__

Lib/site.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -405,12 +405,19 @@ def register_readline():
405405
# want to ignore the exception.
406406
pass
407407

408-
history = os.path.join(os.path.expanduser('~'), '.python_history')
409-
try:
410-
readline.read_history_file(history)
411-
except IOError:
412-
pass
413-
atexit.register(readline.write_history_file, history)
408+
if readline.get_history_item(1) is None:
409+
# If no history was loaded, default to .python_history.
410+
# The guard is necessary to avoid doubling history size at
411+
# each interpreter exit when readline was already configured
412+
# through a PYTHONSTARTUP hook, see:
413+
# http://bugs.python.org/issue5845#msg198636
414+
history = os.path.join(os.path.expanduser('~'),
415+
'.python_history')
416+
try:
417+
readline.read_history_file(history)
418+
except IOError:
419+
pass
420+
atexit.register(readline.write_history_file, history)
414421

415422
sys.__interactivehook__ = register_readline
416423

Lib/test/_test_multiprocessing.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3038,15 +3038,15 @@ def test_pool_initializer(self):
30383038
# Verifies os.close(sys.stdin.fileno) vs. sys.stdin.close() behavior
30393039
#
30403040

3041-
def _ThisSubProcess(q):
3041+
def _this_sub_process(q):
30423042
try:
30433043
item = q.get(block=False)
30443044
except pyqueue.Empty:
30453045
pass
30463046

3047-
def _TestProcess(q):
3047+
def _test_process(q):
30483048
queue = multiprocessing.Queue()
3049-
subProc = multiprocessing.Process(target=_ThisSubProcess, args=(queue,))
3049+
subProc = multiprocessing.Process(target=_this_sub_process, args=(queue,))
30503050
subProc.daemon = True
30513051
subProc.start()
30523052
subProc.join()
@@ -3085,7 +3085,7 @@ class TestStdinBadfiledescriptor(unittest.TestCase):
30853085

30863086
def test_queue_in_process(self):
30873087
queue = multiprocessing.Queue()
3088-
proc = multiprocessing.Process(target=_TestProcess, args=(queue,))
3088+
proc = multiprocessing.Process(target=_test_process, args=(queue,))
30893089
proc.start()
30903090
proc.join()
30913091

Lib/test/test_complex.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ def test_truediv(self):
101101
# FIXME: The following currently crashes on Alpha
102102
# self.assertRaises(OverflowError, pow, 1e200+1j, 1e200+1j)
103103

104-
def test_truediv(self):
105104
self.assertAlmostEqual(complex.__truediv__(2+0j, 1+1j), 1-1j)
106105
self.assertRaises(ZeroDivisionError, complex.__truediv__, 1+1j, 0+0j)
107106

Lib/test/test_dis.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ def func(count):
247247
expected = _BIG_LINENO_FORMAT % (i + 2)
248248
self.do_disassembly_test(func(i), expected)
249249

250-
def test_big_linenos(self):
251250
from test import dis_module
252251
self.do_disassembly_test(dis_module, dis_module_expected_results)
253252

@@ -273,9 +272,6 @@ def test_dis_none(self):
273272
pass
274273
self.assertRaises(RuntimeError, dis.dis, None)
275274

276-
def test_dis_object(self):
277-
self.assertRaises(TypeError, dis.dis, object())
278-
279275
def test_dis_traceback(self):
280276
try:
281277
del sys.last_traceback

Lib/test/test_ftplib.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -534,10 +534,6 @@ def test_cwd(self):
534534
dir = self.client.cwd('/foo')
535535
self.assertEqual(dir, '250 cwd ok')
536536

537-
def test_mkd(self):
538-
dir = self.client.mkd('/foo')
539-
self.assertEqual(dir, '/foo')
540-
541537
def test_pwd(self):
542538
dir = self.client.pwd()
543539
self.assertEqual(dir, 'pwd ok')

Lib/test/test_import.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -252,17 +252,6 @@ def test_file_to_source(self):
252252
if TESTFN in sys.modules:
253253
del sys.modules[TESTFN]
254254

255-
def test_import_name_binding(self):
256-
# import x.y.z binds x in the current namespace.
257-
import test as x
258-
import test.support
259-
self.assertIs(x, test, x.__name__)
260-
self.assertTrue(hasattr(test.support, "__file__"))
261-
262-
# import x.y.z as w binds z as w.
263-
import test.support as y
264-
self.assertIs(y, test.support, y.__name__)
265-
266255
def test_import_by_filename(self):
267256
path = os.path.abspath(TESTFN)
268257
encoding = sys.getfilesystemencoding()

Lib/test/test_regrtest.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -167,19 +167,13 @@ def test_testdir(self):
167167
self.assertEqual(ns.testdir, os.path.join(support.SAVEDCWD, 'foo'))
168168
self.checkError(['--testdir'], 'expected one argument')
169169

170-
def test_findleaks(self):
171-
for opt in '-l', '--findleaks':
172-
with self.subTest(opt=opt):
173-
ns = regrtest._parse_args([opt])
174-
self.assertTrue(ns.findleaks)
175-
176-
def test_findleaks(self):
170+
def test_runleaks(self):
177171
for opt in '-L', '--runleaks':
178172
with self.subTest(opt=opt):
179173
ns = regrtest._parse_args([opt])
180174
self.assertTrue(ns.runleaks)
181175

182-
def test_findleaks(self):
176+
def test_huntrleaks(self):
183177
for opt in '-R', '--huntrleaks':
184178
with self.subTest(opt=opt):
185179
ns = regrtest._parse_args([opt, ':'])
@@ -207,7 +201,7 @@ def test_multiprocess(self):
207201
self.checkError([opt, '2', '-l'], "don't go together")
208202
self.checkError([opt, '2', '-M', '4G'], "don't go together")
209203

210-
def test_findleaks(self):
204+
def test_coverage(self):
211205
for opt in '-T', '--coverage':
212206
with self.subTest(opt=opt):
213207
ns = regrtest._parse_args([opt])

0 commit comments

Comments
 (0)