From f2f7c4287ff257e7c219737b0d7416a7965c0c3e Mon Sep 17 00:00:00 2001 From: Timo Kaufmann Date: Tue, 24 Apr 2018 16:03:25 +0200 Subject: python: Fix upstream bugs #27177 and #25750 27177 was merged but not backported to 2.7. There is currently an open PR for 25750. --- .../interpreters/python/cpython/2.7/default.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'pkgs/development/interpreters') diff --git a/pkgs/development/interpreters/python/cpython/2.7/default.nix b/pkgs/development/interpreters/python/cpython/2.7/default.nix index ed1bc9dc817b..8dd4d9ad4fa2 100644 --- a/pkgs/development/interpreters/python/cpython/2.7/default.nix +++ b/pkgs/development/interpreters/python/cpython/2.7/default.nix @@ -58,6 +58,24 @@ let # if DETERMINISTIC_BUILD env var is set ./deterministic-build.patch + # Fix python bug #27177 (https://bugs.python.org/issue27177) + # The issue is that `match.group` only recognizes python integers + # instead of everything that has `__index__`. + # This bug was fixed upstream, but not backported to 2.7 + (fetchpatch { + name = "re_match_index.patch"; + url = "https://bugs.python.org/file43084/re_match_index.patch"; + sha256 = "0l9rw6r5r90iybdkp3hhl2pf0h0s1izc68h5d3ywrm92pq32wz57"; + }) + + # "`type_getattro()` calls `tp_descr_get(self, obj, type)` without actually owning a reference to "self". + # In very rare cases, this can cause a segmentation fault if "self" is deleted by the descriptor." + # https://github.com/python/cpython/pull/6118 + (fetchpatch { + name = "type_getattro.patch"; + url = "https://github.com/python/cpython/pull/6118/commits/8c6da2d7e7e719c40fb539b7f7cb7583cccc5527.patch"; + sha256 = "11v9yx20hs3jmw0wggzvmw39qs4mxay4kb8iq2qjydwy9ya61nrd"; + }) ] ++ optionals (x11Support && stdenv.isDarwin) [ ./use-correct-tcl-tk-on-darwin.patch ] ++ optionals stdenv.isLinux [ -- cgit 1.4.1