浏览代码

Handle errors from UnicodeDamnit.

tags/v0.2
Ben Kurtovic 12 年前
父节点
当前提交
901192ec18
共有 1 个文件被更改,包括 2 次插入 和 1 次删除
  1. +2
    -1
      earwigbot/wiki/copyvios/parsers.py

+ 2
- 1
earwigbot/wiki/copyvios/parsers.py 查看文件

@@ -223,7 +223,8 @@ class _PlainTextParser(_BaseTextParser):

def parse(self):
"""Unicode-ify and strip whitespace from the plain text document."""
return bs4.UnicodeDammit(self.text).unicode_markup.strip()
converted = bs4.UnicodeDammit(self.text).unicode_markup
return converted.strip() if converted else ""


_CONTENT_TYPES = {


正在加载...
取消
保存