diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2010-03-01 20:18:01 +0100 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2010-03-01 20:18:01 +0100 |
commit | 4f28fd90241dced95cb4d53cef6b4166e1af22f7 (patch) | |
tree | 7741d6811c7ae70d46783827d2eb4ee8df029ec7 | |
parent | 2d7a215c5661ab74e6f52a1ecac71a1f802063f9 (diff) |
Make sure paste text is unicode when generating cache.
-rw-r--r-- | pastepy.py | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -123,7 +123,7 @@ class Paste(object): except: # No cache found, generate it. paste = session.query(db.Paste).filter_by(hash = hash).one() try: - lexername, text = get_formatted(paste.syntax, paste.text) + lexername, text = get_formatted(paste.syntax, paste.text if type(str) == unicode else paste.text.decode('utf8')) except: return self.message('Could not find the lexer "%s".' % paste.syntax, 'Error') cache = db.Cache(hash, lexername, text) |