Skip to content

Commit dd35162

Browse files
committed
merge heads in 3.2
2 parents 029273f + 843fae9 commit dd35162

File tree

9 files changed

+50
-6
lines changed

9 files changed

+50
-6
lines changed

Doc/library/http.client.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ The module provides the following classes:
5151
.. versionchanged:: 3.2
5252
*source_address* was added.
5353

54-
.. versionchanged:: 3.2
54+
.. deprecated:: 3.2
5555
The *strict* parameter is deprecated. HTTP 0.9-style "Simple Responses"
5656
are not supported anymore.
5757

@@ -89,7 +89,7 @@ The module provides the following classes:
8989
This class now supports HTTPS virtual hosts if possible (that is,
9090
if :data:`ssl.HAS_SNI` is true).
9191

92-
.. versionchanged:: 3.2
92+
.. deprecated:: 3.2
9393
The *strict* parameter is deprecated. HTTP 0.9-style "Simple Responses"
9494
are not supported anymore.
9595

@@ -99,7 +99,7 @@ The module provides the following classes:
9999
Class whose instances are returned upon successful connection. Not
100100
instantiated directly by user.
101101

102-
.. versionchanged:: 3.2
102+
.. deprecated:: 3.2
103103
The *strict* parameter is deprecated. HTTP 0.9-style "Simple Responses"
104104
are not supported anymore.
105105

Lib/imaplib.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
__version__ = "2.58"
2424

2525
import binascii, errno, random, re, socket, subprocess, sys, time, calendar
26+
from io import DEFAULT_BUFFER_SIZE
2627

2728
try:
2829
import ssl
@@ -1237,6 +1238,7 @@ def open(self, host = None, port = None):
12371238
self.sock = None
12381239
self.file = None
12391240
self.process = subprocess.Popen(self.command,
1241+
bufsize=DEFAULT_BUFFER_SIZE,
12401242
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
12411243
shell=True, close_fds=True)
12421244
self.writefile = self.process.stdin

Lib/pydoc.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,10 @@ def stripid(text):
137137
return _re_stripid.sub(r'\1', text)
138138

139139
def _is_some_method(obj):
140-
return inspect.ismethod(obj) or inspect.ismethoddescriptor(obj)
140+
return (inspect.isfunction(obj) or
141+
inspect.ismethod(obj) or
142+
inspect.isbuiltin(obj) or
143+
inspect.ismethoddescriptor(obj))
141144

142145
def allmethods(cl):
143146
methods = {}

Lib/test/test_pydoc.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,30 @@ def test_synopsis(self):
389389
synopsis = pydoc.synopsis(TESTFN, {})
390390
self.assertEqual(synopsis, 'line 1: h\xe9')
391391

392+
def test_allmethods(self):
393+
# issue 17476: allmethods was no longer returning unbound methods.
394+
# This test is a bit fragile in the face of changes to object and type,
395+
# but I can't think of a better way to do it without duplicating the
396+
# logic of the function under test.
397+
398+
class TestClass(object):
399+
def method_returning_true(self):
400+
return True
401+
402+
# What we expect to get back: everything on object...
403+
expected = dict(vars(object))
404+
# ...plus our unbound method...
405+
expected['method_returning_true'] = TestClass.method_returning_true
406+
# ...but not the non-methods on object.
407+
del expected['__doc__']
408+
del expected['__class__']
409+
# inspect resolves descriptors on type into methods, but vars doesn't,
410+
# so we need to update __subclasshook__.
411+
expected['__subclasshook__'] = TestClass.__subclasshook__
412+
413+
methods = pydoc.allmethods(TestClass)
414+
self.assertDictEqual(methods, expected)
415+
392416

393417
class PydocImportTest(unittest.TestCase):
394418

Lib/test/test_urllib2.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ def test_parse_http_list(self):
4747
for string, list in tests:
4848
self.assertEqual(urllib.request.parse_http_list(string), list)
4949

50+
def test_URLError_reasonstr(self):
51+
err = urllib.error.URLError('reason')
52+
self.assertIn(err.reason, str(err))
5053

5154
def test_request_headers_dict():
5255
"""

Lib/tkinter/test/test_ttk/test_widgets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ def test_heading(self):
947947
anchor=1)
948948

949949
# XXX skipping for now; should be fixed to work with newer ttk
950-
@unittest.skip
950+
@unittest.skip("skipping pending resolution of Issue #10734")
951951
def test_heading_callback(self):
952952
def simulate_heading_click(x, y):
953953
support.simulate_mouse_click(self.tv, x, y)

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,6 +1098,7 @@ Richard Townsend
10981098
Nathan Trapuzzano
10991099
Laurence Tratt
11001100
John Tromp
1101+
Diane Trout
11011102
Jason Trowbridge
11021103
Brent Tubbs
11031104
Anthony Tuininga

Misc/NEWS

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,15 @@ Core and Builtins
233233
Library
234234
-------
235235

236+
- Issue #8862: Fixed curses cleanup when getkey is interrputed by a signal.
237+
238+
- Issue #17443: impalib.IMAP4_stream was using the default unbuffered IO
239+
in subprocess, but the imap code assumes buffered IO. In Python2 this
240+
worked by accident. IMAP4_stream now explicitly uses buffered IO.
241+
242+
- Issue #17476: Fixed regression relative to Python2 in undocumented pydoc
243+
'allmethods'; it was missing unbound methods on the class.
244+
236245
- Issue #16389: Fixed a performance regression relative to Python 3.1 in the
237246
caching of compiled regular expressions.
238247

Modules/_cursesmodule.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,9 @@ PyCursesWindow_GetKey(PyCursesWindowObject *self, PyObject *args)
895895
}
896896
if (rtn == ERR) {
897897
/* getch() returns ERR in nodelay mode */
898-
PyErr_SetString(PyCursesError, "no input");
898+
PyErr_CheckSignals();
899+
if (!PyErr_Occurred())
900+
PyErr_SetString(PyCursesError, "no input");
899901
return NULL;
900902
} else if (rtn<=255) {
901903
return Py_BuildValue("C", rtn);

0 commit comments

Comments
 (0)