Gregory Bodnar: Still just telling stories

Fri, 24 Mar 2006

Pyblosxom in subversion

The transition went faster than I expected, and the shift has already been made. However, Sourceforge only allows subversion accesses over a SSL connection and the version of svn compiled on sapheron.org doesn’t have ssl support built in. Blame my laziness when I built it ages ago. I’ll have to get that rebuilt before I can get access to the svn server.

[2006-03-24T05:13:00Z] | [/tech/pyblosxom] | #
[65 words]

Pyblosxom errors

Beginning with my little snafu last week involving an errant cvs update, I’ve noticed a few errors filling the log files. It doesn’t seem to happen every time a request is made, which is why I didn’t notice at first. However, there are several errors every day, so it’s far from isolated.


Traceback (most recent call last):
  File "/usr/home/greg/lib/cgi-bin/pyblosxom.cgi", line 82, in ?
    p.run()
  File "/usr/home/greg/pyblosxom/Pyblosxom/pyblosxom.py", line 166, in run
    blosxom_handler(self._request)
  File "/usr/home/greg/pyblosxom/Pyblosxom/pyblosxom.py", line 856, in blosxom_handler
    renderer.render()
  File "/usr/home/greg/pyblosxom/Pyblosxom/renderers/blosxom.py", line 320, in render
    self._processContent()
  File "/usr/home/greg/pyblosxom/Pyblosxom/renderers/blosxom.py", line 270, in _processContent
    output, current_date = self._processEntry(entry, current_date)
  File "/usr/home/greg/pyblosxom/Pyblosxom/renderers/blosxom.py", line 228, in _processEntry
    if entry["date"] and entry['date'] != current_date:
  File "/usr/home/greg/pyblosxom/Pyblosxom/entries/base.py", line 232, in __getitem__
    return self.getMetadata(key, default)
  File "/usr/home/greg/pyblosxom/Pyblosxom/entries/fileentry.py", line 108, in getMetadata
    self.__populateData()
  File "/usr/home/greg/pyblosxom/Pyblosxom/entries/fileentry.py", line 162, in __populateData
    entrydict = eparser(self._filename, self._request)
  File "/usr/home/greg/pyblosxom/Pyblosxom/pyblosxom.py", line 909, in blosxom_entry_parser
    entryData[meta[0].strip()] = meta[1].strip()
IndexError: list index out of range

I can see how some malformedness can cause a problem, however. Here is the offending block:


    # absorb meta data lines which begin with a #
    while lines and lines[0].startswith("#"):
        meta = lines.pop(0)
        meta = meta[1:].strip()     # remove the hash
        meta = meta.split(" ", 1)
        entryData[meta[0].strip()] = meta[1].strip()

At the beginning of a file entry, there is a section to provide metadata. Lines that begin with # will be marked as metadata containers, which get passed into the dictionary entryData. If a malformed line were passed in, such as:


#MalformedLine

it could not be used to form a key/value pair to insert into the dictionary, and the above error would be raised.

There was one recent change that came through this file:


1.75         (willhelm 11-Nov-05):     while lines and lines[0].startswith("#"):
1.74         (willhelm 11-Nov-05):         meta = lines.pop(0)
1.74         (willhelm 11-Nov-05):         meta = meta[1:].strip()     # remove the hash
1.89         (willhelm 28-Dec-05):         meta = meta.split(" ", 1)
1.76         (willhelm 12-Nov-05):         entryData[meta[0].strip()] = meta[1].strip()

I don’t want to just randomly screw with the checkout unless I have to, so my apologies if you get random errors. I will try to get this fixed up, but the first step is to clean up how my installation is organised. A recent posting to the pyblosxom-devel mailing list indicates that the repository is about be moved from cvs to svn. This move would be a push to get that management in place so that I can screw around without causing damage like this.

In the meantime, I guess I’ll just have to track down any files that might have offending metadata lines and fix them without redating the entries.

[2006-03-24T01:29:00Z] | [/tech/pyblosxom] | #
[440 words]

Rescued hostages

News is going around about the release of Harmeet Sooden and two other hostages. It’s great to hear that Harmeet is okay, and must be a relief to everyone who knows him. As someone with an honest intention to help a situation, to do something he believes in, it is horribly ironic that Harmeet was held hostage for 4 months.

The article mentions that Harmeet required medical attention after his rescue. I hope he recovers quickly and is able to hold onto his hope for a better world. It seems to be a relatively rare trait these days.

[2006-03-23T21:05:00Z] | [/meandering] | #
[99 words]