From db3ffaa8f0e335c305936313fb658a7482c283cc Mon Sep 17 00:00:00 2001 From: Allen Nelson Date: Mon, 25 Apr 2016 11:55:43 -0500 Subject: [PATCH] httpretty: working build for python3 --- .../python-modules/httpretty/setup.py.patch | 11 +++++++++++ pkgs/top-level/python-packages.nix | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/python-modules/httpretty/setup.py.patch diff --git a/pkgs/development/python-modules/httpretty/setup.py.patch b/pkgs/development/python-modules/httpretty/setup.py.patch new file mode 100644 index 000000000000..e07ba931705b --- /dev/null +++ b/pkgs/development/python-modules/httpretty/setup.py.patch @@ -0,0 +1,11 @@ +--- setup.py 2016-04-18 10:44:27.915536022 -0500 ++++ setup-new.py 2016-04-18 10:44:13.515537377 -0500 +@@ -75,7 +75,7 @@ + + + local_file = lambda *f: \ +- open(os.path.join(os.path.dirname(__file__), *f)).read() ++ open(os.path.join(os.path.dirname(__file__), *f), encoding="utf-8").read() + + + install_requires, dependency_links = \ diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 9e3605827d3f..89b8bebf9c04 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10420,7 +10420,6 @@ in modules // { httpretty = buildPythonPackage rec { name = "httpretty-${version}"; version = "0.8.6"; - disabled = isPy3k; doCheck = false; src = pkgs.fetchurl { @@ -10442,6 +10441,9 @@ in modules // { --- 566 ---- ! 'content-length': str(len(self.body)) DIFF + + # Explicit encoding flag is required with python3, unless locale is set. + patch -p0 -i ${../development/python-modules/httpretty/setup.py.patch} ''; meta = {