Authenticated feeds can't be cached in Windows
Baz
brian.ewins at gmail.com
Sun Feb 24 10:27:06 EST 2008
On Sat, Feb 23, 2008 at 8:40 PM, David Bowen <David at myforest.com> wrote:
> Hi there,
>
> I'm new to planet as a creator, but I've been happily reading many
> planet-sourced pages for years.
>
> Apologies if this has been raised before, I couldn't find a reference in
> http://lists.planetplanet.org/archives/devel.mbox/devel.mbox
>
> I'm trying to incroporate a feed which requires authentication. Yes, HTTP
> Basic Authentication suffices for me in this case. I can see the discussion
> from October 11th 2004 chatting about this, but nothing concrete.
There was a similar problem in the past, see
http://lists.planetplanet.org/archives/devel/2006-January/000655.html
the regexps have changed a bit since then but the problem with them is
still the same: rather than only allowing a safe character set, they
attempt to exclude specific unsafe characters. There can also a
problem on windows with large path lengths generated in the caches. I
can understand wanting the filename to be readable, but using the hex
of a hash of the URL is probably a better choice here.
>
> So I've got my feed working OK:
>
> [http://user:password@server]
>
> but when the cache kicks in the colon in the URL causes it to fail with
> this message:
> Traceback (most recent call last):
> File "../planet.py", line 167, in ?
> main()
> File "../planet.py", line 160, in main
> my_planet.run(planet_name, planet_link, template_files, offline)
> File "C:\Projects\planet\planet\__init__.py", line 240, in run
> channel = Channel(self, feed_url)
> File "C:\Projects\planet\planet\__init__.py", line 507, in __init__
> cache_file = dbhash.open(cache_filename, "c", 0666)
> File "C:\Python23\lib\dbhash.py", line 16, in open
> return bsddb.hashopen(file, flag, mode)
> File "C:\Python23\lib\bsddb\__init__.py", line 192, in hashopen
> d.open(file, db.DB_HASH, flags, mode)
> bsddb._db.DBNoSuchFileError: (2, 'No such file or directory --
> cache\\user:password at server: No such file or directory')
>
> (I've cleaned up those URLs to protect the innocent)
>
> The problem appears to be in the cache file creation, so I edited cache.py
> as follows:
>
> re_slash = re.compile(r'[?/]+')
>
> became:
>
> re_slash = re.compile(r'[?/:]+')
>
> So that's basically a hack to add colon to the regex.
>
> I thought you might want to know in case it's affecting other Windows
> users.
>
> BTW the username and the server path both contain the "@" symbol too in my
> case so it's actually a little more complex than I'm showing here.
>
> David Bowen
> --
> devel mailing list
> devel at lists.planetplanet.org
> http://lists.planetplanet.org/mailman/listinfo/devel
>
>
More information about the devel
mailing list