Plurrrr

Sun 09 Aug 2026

The Backslash Issue

In the early afternoon I fixed a bug in the create_page function of the Python version of tumblelog. If one used, for example, \1 in the blog title the program would stop with an PatternError exception stating "invalid group reference 1". The reason for this is that the sub method processes any backslash characters unless a function call is used. I explain this in more detail in Python re.sub gotcha.

Now, in the updated version, all substitutes are properly using a function call (lambda) instead of a string to prevent this issue from occuring. While it's unlikely someone uses, for example, \1 as an argument to --label-format and blowing up the archive, I decided to fix that substitution as well: better safe than sorry.

As usual the latest version is available on GitHub.

The Forwardslash Issue

Later, I also fixed a forwardslash issue: if one forgets a trailing forwardslash in the blog URL it's now autmatically added.

Some Other Fixes

Even later in the afternoon I learned that the Python module argpase supports positional arguments. So I removed the manual filename fetching. I also changed the parser call to parse_args instead of parse_known_args so tumblelog know warns if one has a typo in an option name.

I also made sure that an issue with the filename or the template filename printed a nice error message instead of a noisy stack trace.

Moreover, I now use a context object to pass around four common arguments. This reduces the number of parameters of several functions.

And just after I had pushed 6.5.3 to GitHub I discovered another issue: if you create a site without a blog, just pages, the archive is still partially generated. So I fixed this bug and pushed 6.5.4 to GitHub.