Hello folks, About a week ago I was trying to do a tiny web project in Python. I wanted to send a request to some website, get a cookie, and then send that cookie on the next request. I could not believe how convoluted that task has turned out to be. Check out my StackOverflow question: http://stackoverflow.com/questions/6878418/putting-a-cookie-in-a-cookiejar Unless I'm missing something, this looks insane to me. Why is so much code needed to do such a simple task? Why can't this be done with 3-4 lines of Python? Ram.
I understand your frustration, but this isn't the right place to get help. Python-Ideas is for ideas intended to improve Python. Stack Overflow was a good idea, there are also other mailing lists like Python-Help. Also, there is an IRC channel, #python , on the Freenode network (irc.freenode.org). I hope you can get an answer in one of these places! Devin Jeanpierre On Wed, Aug 3, 2011 at 10:09 AM, Ram Rachum <ram@rachum.com> wrote:
Hello folks, About a week ago I was trying to do a tiny web project in Python. I wanted to send a request to some website, get a cookie, and then send that cookie on the next request. I could not believe how convoluted that task has turned out to be. Check out my StackOverflow question: http://stackoverflow.com/questions/6878418/putting-a-cookie-in-a-cookiejar Unless I'm missing something, this looks insane to me. Why is so much code needed to do such a simple task? Why can't this be done with 3-4 lines of Python?
Ram. _______________________________________________ Python-ideas mailing list Python-ideas@python.org http://mail.python.org/mailman/listinfo/python-ideas
Devin, I'm not after help; I already had enough help doing the convoluted things I need to do in order to handle cookies in Python. I am talking on python-ideas because I think that it's a problem that handling cookies is so technical in Python and I think that Python should provide simple cookie-handling modules. On Wed, Aug 3, 2011 at 10:30 AM, Devin Jeanpierre <jeanpierreda@gmail.com>wrote:
I understand your frustration, but this isn't the right place to get help. Python-Ideas is for ideas intended to improve Python. Stack Overflow was a good idea, there are also other mailing lists like Python-Help. Also, there is an IRC channel, #python , on the Freenode network (irc.freenode.org). I hope you can get an answer in one of these places!
Devin Jeanpierre
Hello folks, About a week ago I was trying to do a tiny web project in Python. I wanted to send a request to some website, get a cookie, and then send
On Wed, Aug 3, 2011 at 10:09 AM, Ram Rachum <ram@rachum.com> wrote: that
cookie on the next request. I could not believe how convoluted that task has turned out to be. Check out my StackOverflow question:
http://stackoverflow.com/questions/6878418/putting-a-cookie-in-a-cookiejar
Unless I'm missing something, this looks insane to me. Why is so much code needed to do such a simple task? Why can't this be done with 3-4 lines of Python?
Ram. _______________________________________________ Python-ideas mailing list Python-ideas@python.org http://mail.python.org/mailman/listinfo/python-ideas
IMO, a lot of the stdlib Web modules are sadly out-of-date. A promising project, httplib2, is working on some of these issues, and I see that your note about cookies is one of their enhancement proposals, http://code.google.com/p/httplib2/issues/detail?id=11. Unfortunately, no one seems to be working on it. You might want to chime in and either add support there, or at least mention your issue there. Bill
On Wed, 3 Aug 2011 13:45:29 PDT Bill Janssen <janssen@parc.com> wrote:
IMO, a lot of the stdlib Web modules are sadly out-of-date.
A promising project, httplib2, is working on some of these issues, and I see that your note about cookies is one of their enhancement proposals, http://code.google.com/p/httplib2/issues/detail?id=11. Unfortunately, no one seems to be working on it. You might want to chime in and either add support there, or at least mention your issue there.
Well, why not suggest that these improvements be contributed to the stdlib instead? That would make them accessible more immediately than through a third-party lib. Regards Antoine.
Antoine Pitrou <solipsis@pitrou.net> writes:
Bill Janssen <janssen@parc.com> wrote:
A promising project, httplib2, is working on some of these issues, […]
Well, why not suggest that these improvements be contributed to the stdlib instead?
What do you mean by “instead”? A common path for inclusion in the standard library is to first prove the code is viable as a third-party implementation. Are you suggesting that should be circumvented in this case? Why? -- \ “A thing moderately good is not so good as it ought to be. | `\ Moderation in temper is always a virtue; but moderation in | _o__) principle is always a vice.” —Thomas Paine | Ben Finney
On Thu, 04 Aug 2011 09:44:29 +1000 Ben Finney <ben+python@benfinney.id.au> wrote:
Antoine Pitrou <solipsis@pitrou.net> writes:
Bill Janssen <janssen@parc.com> wrote:
A promising project, httplib2, is working on some of these issues, […]
Well, why not suggest that these improvements be contributed to the stdlib instead?
What do you mean by “instead”? A common path for inclusion in the standard library is to first prove the code is viable as a third-party implementation.
There's some confusion here. If you look at the NEWS file there are many features added without going through such a "common path" first. The "publish it outside first" rule applies mostly to whole modules, or controversial additions. Not to incremental improvements. Regards Antoine.
Ram Rachum wrote:
I am talking on python-ideas because I think that it's a problem that handling cookies is so technical in Python and I think that Python should provide simple cookie-handling modules.
Do you have any suggestions as to what these cookie handling facilities might look like? Perhaps you could give us an example of the 3-4 lines you would like to have been able to write for this task. -- Greg
On Thu, Aug 4, 2011 at 7:21 AM, Greg Ewing <greg.ewing@canterbury.ac.nz> wrote:
Ram Rachum wrote:
I am talking on python-ideas because I think that it's a problem that handling cookies is so technical in Python and I think that Python should provide simple cookie-handling modules.
Do you have any suggestions as to what these cookie handling facilities might look like?
Perhaps you could give us an example of the 3-4 lines you would like to have been able to write for this task.
Intentionally ignoring the current API, so as to avoid getting bogged down in details... from httpclient import fetcher client=fetcher() # support for cookies should be the default response1=client.fetch(url1) response2=client.fetch(url2) -jJ
On Thu, Aug 04, 2011 at 09:18:46AM -0400, Jim Jewett wrote:
Intentionally ignoring the current API, so as to avoid getting bogged down in details...
from httpclient import fetcher client=fetcher() # support for cookies should be the default response1=client.fetch(url1) response2=client.fetch(url2)
That's a good feature request for the current module too. It would be good idea to explore the positives and negatives of this before deciding upon. One thing to keep in mind is that http and url handling modules in stdlib are libraries, which provide a lot of facilities with reasonable defaults. -- Senthil
Ram Rachum wrote:
Hello folks,
About a week ago I was trying to do a tiny web project in Python.
I wanted to send a request to some website, get a cookie, and then send that cookie on the next request.
I could not believe how convoluted that task has turned out to be.
Check out my StackOverflow question: http://stackoverflow.com/questions/6878418/putting-a-cookie-in-a-cookiejar
Unless I'm missing something, this looks insane to me. Why is so much code needed to do such a simple task? Why can't this be done with 3-4 lines of Python?
Do you have an actual idea to propose, or are you just looking for sympathy? -- Steven
participants (9)
-
Antoine Pitrou
-
Ben Finney
-
Bill Janssen
-
Devin Jeanpierre
-
Greg Ewing
-
Jim Jewett
-
Ram Rachum
-
Senthil Kumaran
-
Steven D'Aprano