summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeverin Strobl <severin.strobl@dlr.de>2022-01-05 18:59:12 +0100
committerGitHub <noreply@github.com>2022-01-05 10:59:12 -0700
commitf064c5ee4f9a2efac47e0b5f5d7b5ddf3e8657f4 (patch)
treeead0d6cf228c4ad31367f4dab4463bd77dd7c53a
parent3e992aa283bce1fbc6d8b52a6927ce304fd0c5da (diff)
downloadspack-f064c5ee4f9a2efac47e0b5f5d7b5ddf3e8657f4.tar.gz
spack-f064c5ee4f9a2efac47e0b5f5d7b5ddf3e8657f4.tar.bz2
spack-f064c5ee4f9a2efac47e0b5f5d7b5ddf3e8657f4.tar.xz
spack-f064c5ee4f9a2efac47e0b5f5d7b5ddf3e8657f4.zip
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.
-rw-r--r--var/spack/repos/builtin/packages/py-appdirs/decode-appdirs.patch21
-rw-r--r--var/spack/repos/builtin/packages/py-appdirs/package.py1
2 files changed, 22 insertions, 0 deletions
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')