RFE: function to dump cookie

Bug #240685 reported by Stephan Rügamer
2
Affects Status Importance Assigned to Milestone
python-launchpad-bugs
Fix Released
Medium
Unassigned

Bug Description

Dear Colleagues,

please add some functionality to store the cookie received when useing Bug.authentication dict.

Thx :)

\sh

PS: Filed On behalf of Markus :)

Markus Korn (thekorn)
Changed in python-launchpad-bugs:
importance: Undecided → Medium
milestone: none → intrepid
status: New → Confirmed
Revision history for this message
Markus Korn (thekorn) wrote :

This patch against .main rev 99 adds a save_cookie-method to the HTTPConnection object:

Example usage:

In [1]: from launchpadbugs.connector import ConnectBug

In [2]: Bug = ConnectBug()

In [3]: Bug.connection.save_cookie("boo")

In [4]: !cat boo
    # Netscape HTTP Cookie File
    # http://www.netscape.com/newsref/std/cookie_spec.html
    # This is a generated file! Do not edit.

In [5]: Bug.authentication = {"email": "myemail", "password": "mypassword"}

In [6]: Bug.connection.save_cookie("boo")

In [7]: !cat boo
    # Netscape HTTP Cookie File
    # http://www.netscape.com/newsref/std/cookie_spec.html
    # This is a generated file! Do not edit.

.launchpad.net TRUE / TRUE 123456789 edge somerandomstring
.launchpad.net TRUE / TRUE 123456789 lp somerandomstring

the created file is in the mozilla format used with FF2 since python does not support the new format directly.

Please test and review this patch.

Markus

Revision history for this message
Stephan Rügamer (sruegamer) wrote :

Hi Markus,

worked perfectly :)

Revision history for this message
Markus Korn (thekorn) wrote :

------------------------------------------------------------
revno: 100
committer: Markus Korn <email address hidden>
branch nick: main
timestamp: Tue 2008-06-17 19:21:46 +0200
message:
  launchpadbugs/http_connection.py: added HTTPConnection.save_cookie()
  to dump LP-authentication-cookie to a file (LP: #240685)
------------------------------------------------------------

Changed in python-launchpad-bugs:
status: Confirmed → Fix Committed
Revision history for this message
Stephan Rügamer (sruegamer) wrote :

Done

Changed in python-launchpad-bugs:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.