From 3a151e044659874913de8f665be9835a4fefa53f Mon Sep 17 00:00:00 2001 From: Quentin Duchemin Date: Mon, 4 May 2020 18:40:00 +0200 Subject: [PATCH] open screenshot in binary mode --- .config/i3/scripts/screenshot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/i3/scripts/screenshot.py b/.config/i3/scripts/screenshot.py index cbcd27e..cc2b68f 100755 --- a/.config/i3/scripts/screenshot.py +++ b/.config/i3/scripts/screenshot.py @@ -54,7 +54,7 @@ def read_args(argv): def screenshot(img_format): output = '/tmp/screenshot' proc = subprocess.run(['maim', '-sl', '--color=0.6,0.4,0.2,0.2', '-f', img_format, '-u', '-m', '9', '-b', '5', output], check=True) - with open(output) as f: + with open(output, 'rb') as f: return f.read() def save_img(path, img, img_format):