Uzbl

Tasklist

FS#61 - cookie.py no longer works

Attached to Project: Uzbl
Opened by patrick brisbin (brisbin33) - 2009-07-02 02:16:20 PM
Last edited by Dieter Plaetinck (Dieter_be) - 2009-07-07 07:52:55 PM
Task Type Bug Report
Category uzbl-core
Status Closed
Assigned To No-one
Operating System All
Severity High
Priority Normal
Reported Version Development
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

at some point in the last two weeks, cookies.py stopped working for me (and others).

it's failing as if $XDG_DATA_HOME is not set correctly, i don't know python all that well, but the code looks good to me:
63 if __name__ == '__main__':
64 if 'XDG_DATA_HOME' in os.environ.keys() and os.environ['XDG_DATA_HOME']:
65 jar = cookielib.MozillaCookieJar(\
66 os.path.join(os.environ['XDG_DATA_HOME'],'/uzbl/cookies.txt'))
67 else:
68 jar = cookielib.MozillaCookieJar(\
69 os.path.join(os.environ['HOME'],'.local/share/uzbl/cookies.txt'))

however, here's the output of uzbl -v on failure:
Traceback (most recent call last):
File "/home/patrick/.local/share/uzbl/scripts/cookies.py", line 86, in <module>
jar.save(ignore_discard=True) # save session cookies too
File "/usr/lib/python2.6/_MozillaCookieJar.py", line 118, in save
f = open(filename, "w")
IOError: [Errno 2] No such file or directory: '/uzbl/cookies.txt'
This task depends upon

Closed by  Dieter Plaetinck (Dieter_be)
2009-07-07 07:52:55 PM
Reason for closing:  Fixed
Comment by lazzareth (lazzareth) - 2009-07-02 02:58:23 PM
Line 66: os.path.join(os.environ['XDG_DATA_HOME'],'/uzbl/cookies.txt'))

Should be

Line 66: os.path.join(os.environ['XDG_DATA_HOME'],'uzbl/cookies.txt'))

This happens because if you ever get a 'root-path' as the second argument to os.path.join it doesn't join the two paths it just returns the latter.

There has been bug-fixes made in several forks but the fix hasn't been merged into the main master or experimental trees.

I will pester Dieterbe to pull it into his experimental asap.
Comment by patrick brisbin (brisbin33) - 2009-07-02 03:15:49 PM
thank you lazzareth, makes me happy to get my cookies working again.

Loading...