about summary refs log tree commit diff
path: root/pkgs/development/interpreters
diff options
context:
space:
mode:
authorTimo Kaufmann <timokau@zoho.com>2018-04-24 16:03:25 +0200
committerFrederik Rietdijk <fridh@fridh.nl>2018-06-02 13:44:28 +0200
commitf2f7c4287ff257e7c219737b0d7416a7965c0c3e (patch)
tree5088efc50b655d9a4a90bd61416ab456df08ef49 /pkgs/development/interpreters
parent55c54d2bfe331b03cd885edf0a0df88430f67a64 (diff)
downloadnixlib-f2f7c4287ff257e7c219737b0d7416a7965c0c3e.tar
nixlib-f2f7c4287ff257e7c219737b0d7416a7965c0c3e.tar.gz
nixlib-f2f7c4287ff257e7c219737b0d7416a7965c0c3e.tar.bz2
nixlib-f2f7c4287ff257e7c219737b0d7416a7965c0c3e.tar.lz
nixlib-f2f7c4287ff257e7c219737b0d7416a7965c0c3e.tar.xz
nixlib-f2f7c4287ff257e7c219737b0d7416a7965c0c3e.tar.zst
nixlib-f2f7c4287ff257e7c219737b0d7416a7965c0c3e.zip
python: Fix upstream bugs #27177 and #25750
27177 was merged but not backported to 2.7.
There is currently an open PR for 25750.
Diffstat (limited to 'pkgs/development/interpreters')
-rw-r--r--pkgs/development/interpreters/python/cpython/2.7/default.nix18
1 files changed, 18 insertions, 0 deletions
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 [