From 7d90a73ed28c72628a5576b4edbf0236e5db2478 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Thu, 28 Jul 2016 12:34:41 +0200 Subject: [PATCH] Catch error when md5sum file is corrupted Fix #622 --- gns3server/utils/images.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gns3server/utils/images.py b/gns3server/utils/images.py index 02055a65..69234518 100644 --- a/gns3server/utils/images.py +++ b/gns3server/utils/images.py @@ -36,7 +36,8 @@ def md5sum(path): try: with open(path + '.md5sum') as f: return f.read() - except OSError: + # Unicode error is when user rename an image to .md5sum .... + except (OSError, UnicodeDecodeError): pass try: