Stanisław Jankowski stach.jankow...@gmail.com added the comment:
@stachjankowski: How did you find this issue? Are you porting from 2.x to 3.x
or have new 3.x code that uses this function?
No, it's just random finding.
--
___
Python tracker
Petri Lehtinen pe...@digip.org added the comment:
No, it's just random finding.
This strengthens my impression that no-one is actually using the function.
Maybe we should just remove it from 3.3.
--
___
Python tracker rep...@bugs.python.org
Senthil Kumaran sent...@uthcode.com added the comment:
Let's make it useful, that's much better instead of removing it. I am
+1 with Ezio's suggestion on this to return a list of tuples with
matching headers.
--
title: http.client.HTTPMessage.getallmatchingheaders() always returns [] -
Petri Lehtinen pe...@digip.org added the comment:
Let's make it useful, that's much better instead of removing it. I am
+1 with Ezio's suggestion on this to return a list of tuples with
matching headers.
But there's already a function that does it:
Stanisław Jankowski stach.jankow...@gmail.com added the comment:
This issue has been reported previously, in issue5053. Unfortunately, I
overlooked. Sorry.
--
resolution: - duplicate
status: open - closed
___
Python tracker rep...@bugs.python.org
Changes by Petri Lehtinen pe...@digip.org:
--
superseder: - http.client.HTTPMessage.getallmatchingheaders() always returns
[]
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13425
___
Changes by Petri Lehtinen pe...@digip.org:
--
title: http.client.HTTPMessage.getallmatchingheaders() always returns -
http.client.HTTPMessage.getallmatchingheaders() always returns []
___
Python tracker rep...@bugs.python.org
Changes by Senthil Kumaran sent...@uthcode.com:
--
nosy: +orsenthil
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13425
___
___
Python-bugs-list
Petri Lehtinen pe...@digip.org added the comment:
getallmatchinheaders() is not documented, i.e. it's not part of the public API.
Furthermore, it's only used by http.server.CGIHTTPRequestHandler, and the
comment above it even says that it should be moved there.
There are three options now:
1)
Petri Lehtinen pe...@digip.org added the comment:
4) Deprecate the function to be removed in 3.4 or 3.5 and fix it to always
return [].
This way we won't break any 3.0-3.2 code that is using the function, but the
users of such code will start to get DeprecationWarnings in 3.3.
There's no
rohini rohinivin...@gmail.com added the comment:
Please review the attached patch. Like getheaders, getallmatchingheaders would
also return (header,value) tuples. It is not backward compatible with 2.7.
--
keywords: +patch
nosy: +rohini
Added file:
New submission from Stanisław Jankowski stach.jankow...@gmail.com:
http.client.HTTPMessage.getallmatchingheaders() always returns []
Python 3.2.2:
Calling the code below does not give the expected result.
sjankowski@sjankowski:~$ python3
Python 3.2.2rc1 (default, Aug 14 2011, 18:43:44)
[GCC
Ezio Melotti ezio.melo...@gmail.com added the comment:
The problem seems to be in Lib/http/client.py:227.
The code adds a ':' that is not found in the list of headers returned by
self.keys().
--
nosy: +ezio.melotti
___
Python tracker
Changes by Petri Lehtinen pe...@digip.org:
--
nosy: +petri.lehtinen
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13425
___
___
Python-bugs-list
Ezio Melotti ezio.melo...@gmail.com added the comment:
Actually the headers are already parsed, so the code should use self.items()
instead of self.keys(), check if the key (without ':') matches, and append the
key-value pair to the list.
Having a list of key-value pairs seems more useful than
15 matches
Mail list logo