This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Bug in http.client
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: orsenthil Nosy List: Claudiu.Popa, eric.araujo, orsenthil, python-dev, santoso.wijaya
Priority: normal Keywords: easy, patch

Created on 2011-08-01 13:19 by Claudiu.Popa, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue12676_py33.patch santoso.wijaya, 2011-08-01 18:08 review
Messages (5)
msg141504 - (view) Author: PCManticore (Claudiu.Popa) * (Python triager) Date: 2011-08-01 13:19
There appears to be used a variable that is not defined in HTTPConnection.send method. The approximate line is 781. How to reproduce: 
import http.client
import urllib.parse
c = urllib.parse.urlencode({"user":"claudiu", "password":"1"})
c = http.client.HTTPConnection("192.168.71.38")
c.request("POST", "test", c) # silly, I now.

There should be raised a TypeError here, but instead the error is:
  File "C:\Python32\lib\http\client.py", line 781, in send
    or an iterable, got %r " % type(it))
NameError: global name 'it' is not defined
msg141506 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-08-01 13:25
It looks like “it” should be “data”.
msg141552 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-08-02 10:33
New changeset 1013c9fbd83c by Senthil Kumaran in branch '3.2':
Fix closes Issue12676 - Invalid identifier used in TypeError message in http.client.
http://hg.python.org/cpython/rev/1013c9fbd83c
msg141553 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-08-02 10:35
New changeset c099ba0a278e by Senthil Kumaran in branch 'default':
Fix closes Issue12676 - Invalid identifier used in TypeError message in http.client.
http://hg.python.org/cpython/rev/c099ba0a278e
msg141554 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2011-08-02 10:37
Thanks for the bug report, Popa Claudiu and Patch Santoso Wijaya. 
Ouch, pretty ugly bug - shows the code lacked test coverage.
History
Date User Action Args
2022-04-11 14:57:20adminsetgithub: 56885
2011-08-02 10:37:48orsenthilsetmessages: + msg141554
2011-08-02 10:35:07python-devsetmessages: + msg141553
2011-08-02 10:33:56python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg141552

resolution: fixed
stage: needs patch -> resolved
2011-08-01 18:08:18santoso.wijayasetfiles: + issue12676_py33.patch
keywords: + patch
2011-08-01 17:05:08santoso.wijayasetnosy: + santoso.wijaya
2011-08-01 16:50:48santoso.wijayasettype: behavior
2011-08-01 13:25:06eric.araujosetassignee: orsenthil
versions: + Python 2.7, Python 3.3
keywords: + easy
nosy: + eric.araujo, orsenthil

messages: + msg141506
stage: needs patch
2011-08-01 13:19:33Claudiu.Popacreate