From bc72f7b6cc4aac8c8a13495b43d022d1508a4541 Mon Sep 17 00:00:00 2001 From: Adam Sampson Date: Thu, 9 Apr 2009 11:15:57 +0000 Subject: [PATCH] Decode the config file, and escape "define_"d strings. --- NEWS | 4 ++++ rawdoglib/rawdog.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 855ae85..396f60e 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,10 @@ twenty or so of my feeds (reported by Joseph Reagle). Make the code that cleans up feedparser's return value more thorough -- in particular, turn subclasses of "unicode" into real unicode objects. +Decode the config file from the system encoding, and escape "define_"d +strings when they're written to the output file (reported by Cristian +Rigamonti). + - rawdog 2.12 Make rawdog work with Python 2.6 (reported by Roy Lanek). diff --git a/rawdoglib/rawdog.py b/rawdoglib/rawdog.py index eef5707..749af97 100644 --- a/rawdoglib/rawdog.py +++ b/rawdoglib/rawdog.py @@ -709,7 +709,7 @@ class Config: try: f = open(filename, "r") for line in f.xreadlines(): - stripped = line.strip() + stripped = line.decode(get_system_encoding()).strip() if stripped == "" or stripped[0] == "#": continue if line[0] in string.whitespace: @@ -1307,7 +1307,7 @@ __description__ itembits = {} for name, value in feed.args.items(): if name.startswith("define_"): - itembits[name[7:]] = value + itembits[name[7:]] = sanitise_html(value, "", True, config) title = detail_to_html(entry_info.get("title_detail"), True, config) -- 2.35.1