msg86199 - (view) |
Author: Tarek Ziadé (tarek) * |
Date: 2009-04-20 16:01 |
wsgiref.headers.Headers will let you manage a collection of HTTP
response headers, but the constructor forces you to provide a list:
>>> from wsgiref.headers import Headers
>>> headers = Headers([])
>>> headers.add_header('Content-Type', 'text/plain')
A logical change would be to allowed creating an empty Headers instance:
>>> from wsgiref.headers import Headers
>>> headers = Headers()
>>> headers.add_header('Content-Type', 'text/plain')
|
msg89458 - (view) |
Author: Pablo Torres Navarrete (ptn) |
Date: 2009-06-17 15:00 |
Patch attached. While I was at it, I also removed stupid whitespace and
generally made the module more PEP8-compliant.
|
msg89459 - (view) |
Author: Tarek Ziadé (tarek) * |
Date: 2009-06-17 15:03 |
I have added another issue for PEP 8 compliancy at #5801
|
msg89484 - (view) |
Author: Pablo Torres Navarrete (ptn) |
Date: 2009-06-17 21:22 |
Added a pointer from #5801 to here.
|
msg121680 - (view) |
Author: SilentGhost (SilentGhost) * |
Date: 2010-11-20 16:42 |
Correct and update patch + update test case
|
msg121681 - (view) |
Author: SilentGhost (SilentGhost) * |
Date: 2010-11-20 16:43 |
here is the updated test case
|
msg121690 - (view) |
Author: Ramiro Batista da Luz (ramiroluz) |
Date: 2010-11-20 17:29 |
I applied the patches for wsgiref.headers and test_headers.py, ran the test with runtests.sh test_headers.py and it passed.
I also tried the code in the description:
>>> from wsgiref.headers import Headers
>>> headers = Headers()
>>> headers.add_header('Content-Type', 'text/plain')
>>>
|
msg121829 - (view) |
Author: Éric Araujo (eric.araujo) * |
Date: 2010-11-21 01:40 |
FTR, note that “svn diff file1 file2...” will give you one file for many edits. It’s easier to review and apply.
Regarding the change, I don’t know if wsgiref 3.2 has to be compatible with Python 2.1, which would exclude using the ternary operation.
The change from type to isinstance will probably be rejected, since WSGI does not accept subclasses for the things it defines.
|
msg121958 - (view) |
Author: PJ Eby (pje) * |
Date: 2010-11-21 18:38 |
Yes, please consider the type->isinstance part of the change rejected. I just got done reverting a bunch of those in 3.2. Where WSGI specifies types, it means "type() is", not "isinstance".
(The 3.x version of wsgiref does not need to be executable on 2.x versions, but this doesn't mean the protocol itself can be altered in backwards-incompatible ways, just the implementation.)
|
msg121959 - (view) |
Author: SilentGhost (SilentGhost) * |
Date: 2010-11-21 18:42 |
Do I have to resubmit the patch or can you use the existing one?
|
msg122276 - (view) |
Author: SilentGhost (SilentGhost) * |
Date: 2010-11-24 13:37 |
Re-submitting the patch for Lib/wsgiref/headers.py w/o the isinstance change
|
msg122318 - (view) |
Author: SilentGhost (SilentGhost) * |
Date: 2010-11-24 22:51 |
Here is the correction for the docs. I would love to see this making it into 3.2 release.
|
msg122323 - (view) |
Author: Ramiro Batista da Luz (ramiroluz) |
Date: 2010-11-25 01:32 |
I reviewed the patch.
- I applied all the patchs(3 files).
- Ran make and make html in the Doc directory.
- Ran the test_wsgiref.py
- Ran the python interpreter and typed the suggested code:
>>> from wsgiref.headers import Headers
>>> headers = Headers([])
>>> headers.add_header('Content-Type', 'text/plain')
>>> headers = Headers()
>>> headers.add_header('Content-Type', 'text/plain')
>>>
- Read the documentation in a web browser.
All in the revision 86742.
|
msg122352 - (view) |
Author: Éric Araujo (eric.araujo) * |
Date: 2010-11-25 11:30 |
LGTM.
|
msg130169 - (view) |
Author: SilentGhost (SilentGhost) * |
Date: 2011-03-06 13:37 |
Here's the single-file patch against the revision.
|
msg130181 - (view) |
Author: PJ Eby (pje) * |
Date: 2011-03-06 17:58 |
Looks good to me.
|
msg130752 - (view) |
Author: SilentGhost (SilentGhost) * |
Date: 2011-03-13 17:53 |
> Looks good to me.
Would you mind committing it then?
|
msg131578 - (view) |
Author: Éric Araujo (eric.araujo) * |
Date: 2011-03-21 00:15 |
I think the doc should say something like “default value is an empty list”, for maximum clarity.
|
msg221243 - (view) |
Author: Mark Lawrence (BreamoreBoy) * |
Date: 2014-06-22 10:11 |
This shouldn't be languishing, work has been committed against revision 86742 and there's another patch that apparently just needs a little tweak.
|
msg221247 - (view) |
Author: Berker Peksag (berker.peksag) * |
Date: 2014-06-22 11:07 |
The patch is not committed yet.
$ ./python
Python 3.5.0a0 (default:979aaa08c067+, Jun 19 2014, 13:01:36)
[GCC 4.6.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from wsgiref.headers import Headers
>>> h = Headers()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: __init__() missing 1 required positional argument: 'headers'
Here's an updated patch that addresses Éric's review (and without cosmetic changes to make review easier).
|
msg221248 - (view) |
Author: Mark Lawrence (BreamoreBoy) * |
Date: 2014-06-22 11:43 |
Just for the record clicking on "revision 86742" gives "Specified revision r86742 not found".
|
msg221650 - (view) |
Author: Berker Peksag (berker.peksag) * |
Date: 2014-06-26 21:28 |
Here's a new patch with a whatsnew entry. David, could you review the patch?
|
msg222020 - (view) |
Author: Berker Peksag (berker.peksag) * |
Date: 2014-07-01 09:13 |
Patch updated. If there's no objections, I'll commit this patch in the next couple of days.
|
msg222033 - (view) |
Author: R. David Murray (r.david.murray) * |
Date: 2014-07-01 14:18 |
Since we don't need to avoid new language features, using the ternary would be better than using the or. This is exactly the sort of situation the ternary was introduced for: making sure the input really is None before applying the default.
Otherwise the patch looks good.
|
msg222069 - (view) |
Author: Roundup Robot (python-dev) |
Date: 2014-07-02 05:37 |
New changeset a91f0d4a2381 by Berker Peksag in branch 'default':
Issue #5800: headers parameter of wsgiref.headers.Headers is now optional.
http://hg.python.org/cpython/rev/a91f0d4a2381
|
msg222070 - (view) |
Author: Berker Peksag (berker.peksag) * |
Date: 2014-07-02 05:38 |
Thanks for the patch and review.
|
|
Date |
User |
Action |
Args |
2022-04-11 14:56:48 | admin | set | github: 50050 |
2014-07-02 05:38:54 | berker.peksag | set | status: open -> closed resolution: fixed messages:
+ msg222070
stage: commit review -> resolved |
2014-07-02 05:37:28 | python-dev | set | nosy:
+ python-dev messages:
+ msg222069
|
2014-07-01 14:18:22 | r.david.murray | set | messages:
+ msg222033 |
2014-07-01 09:13:13 | berker.peksag | set | files:
+ issue5800_v3.diff assignee: pje -> berker.peksag messages:
+ msg222020
stage: patch review -> commit review |
2014-06-26 21:28:14 | berker.peksag | set | files:
+ issue5800_v2.diff nosy:
+ r.david.murray messages:
+ msg221650
|
2014-06-22 11:43:19 | BreamoreBoy | set | messages:
+ msg221248 |
2014-06-22 11:07:02 | berker.peksag | set | status: languishing -> open files:
+ issue5800.diff versions:
+ Python 3.5, - Python 3.3 nosy:
+ berker.peksag
messages:
+ msg221247
|
2014-06-22 10:11:57 | BreamoreBoy | set | nosy:
+ BreamoreBoy messages:
+ msg221243
|
2011-03-21 00:15:52 | eric.araujo | set | nosy:
pje, tarek, eric.araujo, ptn, SilentGhost, ramiroluz messages:
+ msg131578 versions:
+ Python 3.3, - Python 3.2 |
2011-03-13 17:53:45 | SilentGhost | set | nosy:
pje, tarek, eric.araujo, ptn, SilentGhost, ramiroluz messages:
+ msg130752 |
2011-03-06 17:58:41 | pje | set | nosy:
pje, tarek, eric.araujo, ptn, SilentGhost, ramiroluz messages:
+ msg130181 |
2011-03-06 13:37:41 | SilentGhost | set | files:
- wsgiref.rst.diff nosy:
pje, tarek, eric.araujo, ptn, SilentGhost, ramiroluz |
2011-03-06 13:37:28 | SilentGhost | set | files:
- headers.py.diff nosy:
pje, tarek, eric.araujo, ptn, SilentGhost, ramiroluz |
2011-03-06 13:37:21 | SilentGhost | set | files:
- test_wsgiref.py.diff nosy:
pje, tarek, eric.araujo, ptn, SilentGhost, ramiroluz |
2011-03-06 13:37:06 | SilentGhost | set | files:
+ issue5800.diff nosy:
pje, tarek, eric.araujo, ptn, SilentGhost, ramiroluz messages:
+ msg130169
|
2011-01-15 15:22:59 | SilentGhost | set | status: open -> languishing nosy:
pje, tarek, eric.araujo, ptn, SilentGhost, ramiroluz |
2010-11-25 11:30:26 | eric.araujo | set | assignee: pje messages:
+ msg122352 |
2010-11-25 01:32:58 | ramiroluz | set | messages:
+ msg122323 |
2010-11-24 22:51:52 | SilentGhost | set | files:
+ wsgiref.rst.diff
messages:
+ msg122318 |
2010-11-24 13:47:07 | djc | set | keywords:
+ needs review |
2010-11-24 13:37:35 | SilentGhost | set | files:
+ headers.py.diff keywords:
+ patch messages:
+ msg122276
|
2010-11-24 13:36:56 | SilentGhost | set | files:
- headers.py.diff |
2010-11-21 18:42:56 | SilentGhost | set | messages:
+ msg121959 |
2010-11-21 18:38:51 | pje | set | messages:
+ msg121958 |
2010-11-21 01:40:30 | eric.araujo | set | nosy:
+ eric.araujo messages:
+ msg121829
|
2010-11-20 17:29:00 | ramiroluz | set | nosy:
+ ramiroluz messages:
+ msg121690
|
2010-11-20 17:13:24 | r.david.murray | set | keywords:
- patch stage: test needed -> patch review versions:
- Python 2.7 |
2010-11-20 16:43:05 | SilentGhost | set | files:
+ test_wsgiref.py.diff
messages:
+ msg121681 |
2010-11-20 16:42:34 | SilentGhost | set | files:
+ headers.py.diff
nosy:
+ SilentGhost messages:
+ msg121680
keywords:
+ patch |
2009-06-17 21:22:49 | ptn | set | messages:
+ msg89484 |
2009-06-17 15:03:35 | tarek | set | messages:
+ msg89459 versions:
+ Python 3.2, - Python 3.1 |
2009-06-17 15:00:00 | ptn | set | files:
+ patch nosy:
+ ptn messages:
+ msg89458
|
2009-04-22 05:06:35 | ajaksu2 | set | keywords:
+ easy stage: test needed |
2009-04-20 16:01:04 | tarek | create | |