[issue23300] httplib is using a method that doesn't exist

2015-01-24 Thread Benjamin Peterson

Benjamin Peterson added the comment:

On Sat, Jan 24, 2015, at 16:00, Senthil Kumaran wrote:
 
 Senthil Kumaran added the comment:
 
 Fixed in 2.7. Other versions do not have this bug.

Thank you! Would porting the tests be useful, though?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23300
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23300] httplib is using a method that doesn't exist

2015-01-24 Thread Senthil Kumaran

Senthil Kumaran added the comment:

 Would porting the tests be useful, though?

Yes, it will be useful to port the tests to 3.4 and default branch.
I will do that.

--
status: closed - open

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23300
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23300] httplib is using a method that doesn't exist

2015-01-24 Thread Berker Peksag

Berker Peksag added the comment:

+self.assertDictEqual(self.conn._tunnel_headers, tunnel_headers)

You could just use assertEqual. Quoting from docs:

The list of type-specific methods automatically used by assertEqual() are 
summarized in the following table. Note that it’s usually not necessary to 
invoke these methods directly.

https://docs.python.org/3/library/unittest.html#unittest.TestCase.addTypeEqualityFunc

+self.assertTrue(b'CONNECT destination.com' in self.conn.sock.data)
+self.assertTrue(b'Host: destination.com' in self.conn.sock.data)

You could use assertIn instead.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23300
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23300] httplib is using a method that doesn't exist

2015-01-24 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Committed the test changes in  fcab9c106f2f (3.4) and  a858cde113f2 (3.5)

--
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23300
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23300] httplib is using a method that doesn't exist

2015-01-24 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Thanks for the review comments. Updated the patch with the suggested changes.

--
Added file: http://bugs.python.org/file37844/23300-3.3-v2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23300
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23300] httplib is using a method that doesn't exist

2015-01-24 Thread Berker Peksag

Berker Peksag added the comment:

LGTM.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23300
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23300] httplib is using a method that doesn't exist

2015-01-24 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Actually, the same tests cannot be ported to 3.4 or default. httplib.HTTP class 
has been merged to HTTPConnection in 3.x and we don't allow a host, and port in 
connect().

There is good test coverage for verifying host, port in test_hort_port test in 
3.x

However, I saw that TunnelTests could see some refactor and a test addition to 
cover the _tunnel_host, _tunnel_port attributes (which are set using 
_get_hostport method). 

Attaching a change to client.test_httplib which refactors TunnelTest and adds a 
new test called test_set_tunnel_host_port_headers. Please review if this change 
is Okay. I can push this in 3.4 and default branches.

Thanks!

--
Added file: http://bugs.python.org/file37842/23300-3.3.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23300
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23300] httplib is using a method that doesn't exist

2015-01-24 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Fixed in 2.7. Other versions do not have this bug.

--
resolution:  - fixed
stage: commit review - resolved
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23300
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23300] httplib is using a method that doesn't exist

2015-01-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c2bba3c9424b by Senthil Kumaran in branch '2.7':
Fix Issue23300 : httplib.HTTP classe's connect method should use _get_hostport
https://hg.python.org/cpython/rev/c2bba3c9424b

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23300
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23300] httplib is using a method that doesn't exist

2015-01-23 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Addressed Berker's review comments.
1) Made the TestServer a Mixin. (Thanks, that's the correct to do).
2) Changed Post to Port.
3) I went with still using a testdomain and port in the constructor. My idea of 
the test is to demonstrate that the connect(host,port) is used when given 
rather than HTTP(host,port).

--
Added file: http://bugs.python.org/file37828/23000-v2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23300
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23300] httplib is using a method that doesn't exist

2015-01-23 Thread Berker Peksag

Berker Peksag added the comment:

LGTM.

--
stage: patch review - commit review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23300
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23300] httplib is using a method that doesn't exist

2015-01-23 Thread Berker Peksag

Berker Peksag added the comment:

+class TestServer(TestCase):

This can be a mixin.

+def testHTTPWithConnectHostPost(self):

Post - Port?

+self.conn = httplib.HTTP(host=constructor_host, port=constructor_port)

or to make the test simpler,

self.conn = httplib.HTTP()

--
nosy: +berker.peksag

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23300
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23300] httplib is using a method that doesn't exist

2015-01-23 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Here is the patch to fix this. I have added a test case covering this change. 
Please review this and if it is good to go, I will commit it. Thank you.

--
keywords: +patch
stage: needs patch - patch review
Added file: http://bugs.python.org/file37827/23000.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23300
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23300] httplib is using a method that doesn't exist

2015-01-23 Thread Demian Brecht

Demian Brecht added the comment:

Other than Berker's comments, LGTM.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23300
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23300] httplib is using a method that doesn't exist

2015-01-22 Thread Demian Brecht

Demian Brecht added the comment:

@Senthil: If you're fixing this today, can you also correct the typo here: 
https://hg.python.org/cpython/rev/568041fd8090/#l1.27 (s/HTML/HTTP)? Just 
caught my eye going through the review that Mark linked.

--
nosy: +demian.brecht

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23300
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23300] httplib is using a method that doesn't exist

2015-01-22 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Demian, sure, will do.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23300
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23300] httplib is using a method that doesn't exist

2015-01-22 Thread Nikolaus Rath

Nikolaus Rath added the comment:

Serhiy, did you add me to Cc just for information, or is there anything I 
should be doing (having written the patch that introduced this bug)?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23300
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23300] httplib is using a method that doesn't exist

2015-01-22 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Nikolaus, nothing might be required from your end. Just a good protocol to keep 
the interested parties in CC.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23300
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23300] httplib is using a method that doesn't exist

2015-01-22 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
nosy: +nikratio, serhiy.storchaka
stage:  - needs patch
title: An improper change in httplib.py - httplib is using a method that 
doesn't exist
type: enhancement - behavior

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23300
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23300] httplib is using a method that doesn't exist

2015-01-22 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Ouch. Will fix this today. Strange, I think, no coverage exists for that and it 
has escaped our testing.

--
assignee:  - orsenthil

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23300
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com