merge
diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py
index f5c10c8..3b41a21 100644
--- a/Lib/asyncio/tasks.py
+++ b/Lib/asyncio/tasks.py
@@ -208,9 +208,11 @@
if iscoroutine(coro):
filename = coro.gi_code.co_filename
if coro.gi_frame is not None:
- text += ' at %s:%s' % (filename, coro.gi_frame.f_lineno)
+ lineno = coro.gi_frame.f_lineno
+ text += ' at %s:%s' % (filename, lineno)
else:
- text += ' done at %s' % filename
+ lineno = coro.gi_code.co_firstlineno
+ text += ' done at %s:%s' % (filename, lineno)
res = res[:i] + '(<{}>)'.format(text) + res[i:]
return res
diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py
index d770a91..3037f60 100644
--- a/Lib/test/test_asyncio/test_tasks.py
+++ b/Lib/test/test_asyncio/test_tasks.py
@@ -148,12 +148,14 @@
self.assertRaises(asyncio.CancelledError,
self.loop.run_until_complete, t)
self.assertEqual(repr(t),
- 'Task(<notmuch done at %s>)<CANCELLED>' % filename)
+ 'Task(<notmuch done at %s:%s>)<CANCELLED>'
+ % (filename, lineno))
t = asyncio.Task(notmuch(), loop=self.loop)
self.loop.run_until_complete(t)
self.assertEqual(repr(t),
- "Task(<notmuch done at %s>)<result='abc'>" % filename)
+ "Task(<notmuch done at %s:%s>)<result='abc'>"
+ % (filename, lineno))
def test_task_repr_custom(self):
@asyncio.coroutine
diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py
index 493fade..15dec1c 100644
--- a/Lib/test/test_httpservers.py
+++ b/Lib/test/test_httpservers.py
@@ -125,7 +125,7 @@
def test_request_line_trimming(self):
self.con._http_vsn_str = 'HTTP/1.1\n'
- self.con.putrequest('GET', '/')
+ self.con.putrequest('XYZBOGUS', '/')
self.con.endheaders()
res = self.con.getresponse()
self.assertEqual(res.status, 501)
@@ -152,8 +152,9 @@
self.assertEqual(res.status, 501)
def test_version_none(self):
+ # Test that a valid method is rejected when not HTTP/1.x
self.con._http_vsn_str = ''
- self.con.putrequest('PUT', '/')
+ self.con.putrequest('CUSTOM', '/')
self.con.endheaders()
res = self.con.getresponse()
self.assertEqual(res.status, 400)
diff --git a/Misc/ACKS b/Misc/ACKS
index 908f47b..fa6b1f6 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -29,6 +29,7 @@
Jyrki Alakuijala
Steve Alexander
Fred Allen
+Jeff Allen
Ray Allen
Billy G. Allie
Kevin Altis
diff --git a/Misc/NEWS b/Misc/NEWS
index 52c1e0e..8598c3f 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -133,6 +133,10 @@
Tests
-----
+- Issue #20155: Changed HTTP method names in failing tests in test_httpservers
+ so that packet filtering software (specifically Windows Base Filtering Engine)
+ does not interfere with the transaction semantics expected by the tests.
+
- Issue #19493: Refactored the ctypes test package to skip tests explicitly
rather than silently.