sparklemotion/mechanize — pull request #293 by mmorearty (2013-02-18 02:17:38+00:00)
Title: Add header line when writing to cookies.txt

When Python is reading a Netscape-format cookies.txt file, it seems to require an initial line that looks like this:

# Netscape HTTP Cookie File

Mechanize is not writing out a line like that, so Python scripts are unable to read cookie files that were created by Mechanize. This patch adds that line.

See [this tiny project](https://github.com/mmorearty/mechanize-cookieproblem) for a testable demo.

By the way: I noticed that in #257, the cookie-handling part of Mechanize is in the process of being split off into a separate gem. So I'll submit another similar pull request on the http-cookie project.