diff options
Diffstat (limited to 'filters')
-rwxr-xr-x | filters/email-gravatar.py | 3 | ||||
-rwxr-xr-x | filters/syntax-highlighting.py | 5 |
2 files changed, 1 insertions, 7 deletions
diff --git a/filters/email-gravatar.py b/filters/email-gravatar.py index d70440e..8b98471 100755 --- a/filters/email-gravatar.py +++ b/filters/email-gravatar.py @@ -30,9 +30,6 @@ if email[-1] == '>': page = sys.argv[2] -sys.stdin = codecs.getreader("utf-8")(sys.stdin.detach()) -sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach()) - md5 = hashlib.md5(email.encode()).hexdigest() text = sys.stdin.read().strip() diff --git a/filters/syntax-highlighting.py b/filters/syntax-highlighting.py index 5888b50..936fdb7 100755 --- a/filters/syntax-highlighting.py +++ b/filters/syntax-highlighting.py @@ -29,9 +29,6 @@ from pygments.lexers import guess_lexer from pygments.lexers import guess_lexer_for_filename from pygments.formatters import HtmlFormatter - -sys.stdin = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8', errors='replace') -sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8', errors='replace') data = sys.stdin.read() filename = sys.argv[1] formatter = HtmlFormatter(style='pastie') @@ -52,4 +49,4 @@ except TypeError: sys.stdout.write('<style>') sys.stdout.write(formatter.get_style_defs('.highlight')) sys.stdout.write('</style>') -sys.stdout.write(highlight(data, lexer, formatter, outfile=None)) +highlight(data, lexer, formatter, outfile=sys.stdout) |