diff --git a/0001-Always-import-XDG-desktop-files-as-utf8.patch b/0001-Always-import-XDG-desktop-files-as-utf8.patch new file mode 100644 index 0000000..c1af903 --- /dev/null +++ b/0001-Always-import-XDG-desktop-files-as-utf8.patch @@ -0,0 +1,35 @@ +From e090267a175d2f2d52128c780108835f36d1ef1e Mon Sep 17 00:00:00 2001 +From: Dirk Mueller +Date: Sun, 18 Feb 2018 15:23:39 +0100 +Subject: [PATCH] Always import XDG desktop files as utf8 + +Don't rely on them being entirely ASCII or the system +locale. +--- + MenuXDGCheck.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/MenuXDGCheck.py b/MenuXDGCheck.py +index 66912ea..d4418a9 100644 +--- a/MenuXDGCheck.py ++++ b/MenuXDGCheck.py +@@ -6,6 +6,7 @@ + # http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html + # + ++import codecs + import os + try: + import ConfigParser as cfgparser +@@ -30,7 +31,7 @@ class MenuXDGCheck(AbstractCheck.AbstractFilesCheck): + def parse_desktop_file(self, pkg, root, f, filename): + cfp = cfgparser.RawConfigParser() + try: +- with open(f, 'rb') as inputf: ++ with codecs.open(f, encoding='utf-8') as inputf: + cfp.readfp(inputf, filename) + except cfgparser.DuplicateSectionError as e: + printError( +-- +2.16.1 + diff --git a/0001-Improve-XDG-Menu-checks-stability.patch b/0001-Improve-XDG-Menu-checks-stability.patch index 1549b01..0067d52 100644 --- a/0001-Improve-XDG-Menu-checks-stability.patch +++ b/0001-Improve-XDG-Menu-checks-stability.patch @@ -41,7 +41,7 @@ Index: rpmlint-rpmlint-1.10/MenuXDGCheck.py + def parse_desktop_file(self, pkg, root, f, filename): + cfp = cfgparser.RawConfigParser() + try: -+ with open(f, 'r') as inputf: ++ with open(f, 'rb') as inputf: + cfp.readfp(inputf, filename) + except cfgparser.DuplicateSectionError as e: + printError( diff --git a/rpmlint.changes b/rpmlint.changes index 659c40a..ad51382 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Feb 18 14:26:09 UTC 2018 - dmueller@suse.com + +- add 0001-Always-import-XDG-desktop-files-as-utf8.patch + ------------------------------------------------------------------- Thu Feb 15 09:35:51 UTC 2018 - coolo@suse.com diff --git a/rpmlint.spec b/rpmlint.spec index 859b9a2..78add9e 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -89,6 +89,7 @@ Patch70: rpmlint-all-pie.patch Patch71: 0001-Avoid-calling-close-on-undefined-fd-variable.patch Patch72: rpmlint-slpp-NUM-NUM.patch Patch73: 0001-Binariescheck-Check-for-chroot-chdir-on-ARM-PPC.patch +Patch74: 0001-Always-import-XDG-desktop-files-as-utf8.patch BuildRequires: obs-service-format_spec_file BuildRequires: python3-flake8 BuildRequires: python3-pytest