[Mailman-Developers] Parsing templates with '%' in them?

Bob Tanner tanner at real-time.com
Sun Nov 27 04:50:51 CET 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I wanted to change the article.html template and do some CSS in it, but I
found mailman -silently- failed to parse the template files.

I've submitted the attached patch to at least log the fact the template
parsing failed.

- ----------------------- snip --------------------------------
- --- HyperArch.py        2003-12-26 14:41:30.000000000 -0600
+++ HyperArch.py-bob    2005-11-23 03:19:13.000000000 -0600
@@ -217,8 +217,9 @@
                                     Utils.GetCharSet(lang),
                                     'replace')
                 text = sdict.interpolate(utemplate)
- -        except (TypeError, ValueError):
+        except (TypeError, ValueError), e:
             # The template is really screwed up
+            syslog('error', 'The template is really screwed up: %s\n', e)
             pass
     # Make sure the text is in the given character set, or html-ify any
     # bogus
     # characters.
- ----------------------- snip --------------------------------

Next, I could not seem to isolate the "bug", but my CSS had the following
entries:

        div#main {
        margin-right: 20%;
        }
        div#menu {
        width: 15%;
        float: right;
        }

The html template parser was failing on the 20% and the 15%, looking like it
was keying off the '%' for key=value in the SafeDict class and failing.

I "solved" the problem by making the CSS an external html reference, but I
thought I'd post this info to the developer list as a FYI.


- -- 
Bob Tanner <tanner at real-time.com>          | Phone : (952)943-8700
http://www.real-time.com, Minnesota, Linux | Fax   : (952)943-8500
Key fingerprint = AB15 0BDF BCDE 4369 5B42  1973 7CF1 A709 2CC1 B288
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFDiS0bfPGnCSzBsogRAjO2AJ94i5AM4VyQbMGTppwwILeygUALSwCdHpkj
mw8ylEsCQxXZzqKfSAFbxiw=
=rTtc
-----END PGP SIGNATURE-----



More information about the Mailman-Developers mailing list