From f064c5ee4f9a2efac47e0b5f5d7b5ddf3e8657f4 Mon Sep 17 00:00:00 2001 From: Severin Strobl Date: Wed, 5 Jan 2022 18:59:12 +0100 Subject: py-appdirs: patch for encoding issue (#28253) Reading appdirs.py without explicitly requesting UTF-8 decoding results in the build process to fail for Python 3.6. See https://github.com/ActiveState/appdirs/pull/152 for the upstream fix. --- .../packages/py-appdirs/decode-appdirs.patch | 21 +++++++++++++++++++++ .../repos/builtin/packages/py-appdirs/package.py | 1 + 2 files changed, 22 insertions(+) create mode 100644 var/spack/repos/builtin/packages/py-appdirs/decode-appdirs.patch diff --git a/var/spack/repos/builtin/packages/py-appdirs/decode-appdirs.patch b/var/spack/repos/builtin/packages/py-appdirs/decode-appdirs.patch new file mode 100644 index 0000000000..393e576acc --- /dev/null +++ b/var/spack/repos/builtin/packages/py-appdirs/decode-appdirs.patch @@ -0,0 +1,21 @@ +diff --git a/setup.py b/setup.py +index 293c1c4..122cd04 100644 +--- a/setup.py ++++ b/setup.py +@@ -2,6 +2,7 @@ + import sys + import os + import os.path ++from io import open + # appdirs is a dependency of setuptools, so allow installing without it. + try: + from setuptools import setup +@@ -15,7 +16,7 @@ if sys.version_info < (2, 7): + + + def read(fname): +- inf = open(os.path.join(os.path.dirname(__file__), fname)) ++ inf = open(os.path.join(os.path.dirname(__file__), fname), encoding='utf8') + out = "\n" + inf.read().replace("\r\n", "\n") + inf.close() + return out diff --git a/var/spack/repos/builtin/packages/py-appdirs/package.py b/var/spack/repos/builtin/packages/py-appdirs/package.py index 54a26e5b80..4eed612eef 100644 --- a/var/spack/repos/builtin/packages/py-appdirs/package.py +++ b/var/spack/repos/builtin/packages/py-appdirs/package.py @@ -18,4 +18,5 @@ class PyAppdirs(PythonPackage): version('1.4.0', sha256='8fc245efb4387a4e3e0ac8ebcc704582df7d72ff6a42a53f5600bbb18fdaadc5') patch('setuptools-import.patch', when='@:1.4.0') + patch('decode-appdirs.patch', when='@1.4.4') depends_on('py-setuptools', type='build') -- cgit v1.2.3-70-g09d2