diff --git a/seed/applicationservice/2022.03.08/base/manual/install/diff.py b/seed/applicationservice/2022.03.08/base/manual/install/diff.py index 74114443..f5780f60 100755 --- a/seed/applicationservice/2022.03.08/base/manual/install/diff.py +++ b/seed/applicationservice/2022.03.08/base/manual/install/diff.py @@ -42,12 +42,16 @@ type = "installe" +++ """) for filename in FILES: - with open(join(OLD_DIR, filename[1:]), 'r') as ori: - ori_content = ori.readlines() - with open(join(NEW_DIR, filename[1:]), 'r') as new: - new_content = new.readlines() print(f'- mise à jour du fichier {filename} :\n') - print('```diff') - for line in unified_diff(ori_content, new_content, fromfile=filename, tofile=filename): - print(line.rstrip()) - print('```') + try: + with open(join(OLD_DIR, filename[1:]), 'r') as ori: + ori_content = ori.readlines() + with open(join(NEW_DIR, filename[1:]), 'r') as new: + new_content = new.readlines() + except UnicodeDecodeError: + print('fichier binaire') + else: + print('```diff') + for line in unified_diff(ori_content, new_content, fromfile=filename, tofile=filename): + print(line.rstrip()) + print('```')