Function
mechanize._lwpcookiejar.lwp_cookie_str

Signature

lwp_cookie_str(cookie)

Documentation String

Return string representation of Cookie in an the LWP cookie file format.

Actually, the format is extended a bit
see module docstring.