From d910c59d76e892538dd541cede29c7310feba128 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 23 Oct 2021 16:59:23 +0200 Subject: [PATCH] Aaaannnd I broke everything --- package_linter.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package_linter.py b/package_linter.py index 00c016f..922890f 100755 --- a/package_linter.py +++ b/package_linter.py @@ -493,11 +493,13 @@ class App(TestSuite): @test() def bad_encoding(self): - cmd = "file --mime-encoding $(find %s/ -type f) | grep 'iso-8859-1'" % self.path + cmd = "file --mime-encoding $(find %s/ -type f) | grep 'iso-8859-1' || true" % self.path bad_encoding_files = subprocess.check_output(cmd, shell=True).decode('utf-8').strip().split("\n") for file_ in bad_encoding_files: + if not file_: + continue file_ = file_.split()[0] - yield Info("%s appears to be encoded as latin-1 / iso-8859-1. Please consider converting it to utf-8 to avoid funky issues. Something like 'iconv -f iso-8859-1 -t utf-8 SOURCE DEST' should do the trick." % file_) + yield Info("%s appears to be encoded as latin-1 / iso-8859-1. Please consider converting it to utf-8 to avoid funky issues. Something like 'iconv -f iso-8859-1 -t utf-8 SOURCE > DEST' should do the trick." % file_) #######################################