diff --git a/.gitignore b/.gitignore
index f8c1ba8..e5177b6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -292,3 +292,4 @@
 /vim-8.2-520.tar.bz2
 /vim-8.2-525.tar.bz2
 /vim-8.2-534.tar.bz2
+/vim-8.2-587.tar.bz2
diff --git a/sources b/sources
index 8b045f2..838d2f7 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (vim-8.2-534.tar.bz2) = 5a8458c71e23f12c78b6e4c89bcd764dbf9b1e5a69fc6a7db17c1bdc0506eb4c35dc42c66fd50bbd9d41869e292e41a3bd4ace6c8ab6c619e5e4b9cf4017fc92
+SHA512 (vim-8.2-587.tar.bz2) = 3bd9af491080275c951ff9aa7176260895b4a5a12b107981feb2beaa1d90bf2551ae5bbbea7a3bafa0cc0fc0f9a36964934055f6cfb2f7805f1f0f371076a531
diff --git a/vim-python3-tests.patch b/vim-python3-tests.patch
index 26027f7..98b5f75 100644
--- a/vim-python3-tests.patch
+++ b/vim-python3-tests.patch
@@ -1,16 +1,16 @@
-diff -up vim80/runtime/tools/demoserver.py.python3-tests vim80/runtime/tools/demoserver.py
---- vim80/runtime/tools/demoserver.py.python3-tests	2018-05-11 08:24:41.774618804 +0200
-+++ vim80/runtime/tools/demoserver.py	2018-05-11 09:24:48.363309856 +0200
+diff -up vim82/runtime/tools/demoserver.py.python-tests vim82/runtime/tools/demoserver.py
+--- vim82/runtime/tools/demoserver.py.python-tests	2019-07-26 07:58:50.000000000 +0200
++++ vim82/runtime/tools/demoserver.py	2020-04-17 06:18:06.748977527 +0200
 @@ -1,4 +1,4 @@
 -#!/usr/bin/python
 +#!/usr/bin/python3
  #
  # Server that will accept connections from a Vim channel.
  # Run this server and then in Vim you can open the channel:
-diff -up vim80/src/auto/configure.python3-tests vim80/src/auto/configure
---- vim80/src/auto/configure.python3-tests	2018-05-11 08:25:03.632420873 +0200
-+++ vim80/src/auto/configure	2018-05-11 09:25:26.062000471 +0200
-@@ -6396,7 +6396,7 @@ eof
+diff -up vim82/src/auto/configure.python-tests vim82/src/auto/configure
+--- vim82/src/auto/configure.python-tests	2020-04-17 06:07:48.000000000 +0200
++++ vim82/src/auto/configure	2020-04-17 06:18:06.750977509 +0200
+@@ -6418,7 +6418,7 @@ eof
  	    if test "x$MACOS_X" = "xyes" && test -n "${python_PYTHONFRAMEWORK}" && ${vi_cv_path_python} -c \
  		"import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"; then
  	      vi_cv_path_python_plibs="-framework Python"
@@ -19,10 +19,10 @@ diff -up vim80/src/auto/configure.python3-tests vim80/src/auto/configure
  		  vi_cv_path_python_plibs="-F${python_PYTHONFRAMEWORKPREFIX} -framework Python"
  	      fi
  	    else
-diff -up vim80/src/configure.ac.python3-tests vim80/src/configure.ac
---- vim80/src/configure.ac.python3-tests	2018-05-11 08:25:26.070218957 +0200
-+++ vim80/src/configure.ac	2018-05-11 09:26:01.603708243 +0200
-@@ -1248,7 +1248,7 @@ eof
+diff -up vim82/src/configure.ac.python-tests vim82/src/configure.ac
+--- vim82/src/configure.ac.python-tests	2020-04-17 06:07:48.000000000 +0200
++++ vim82/src/configure.ac	2020-04-17 06:18:06.750977509 +0200
+@@ -1263,7 +1263,7 @@ eof
  	    if test "x$MACOS_X" = "xyes" && test -n "${python_PYTHONFRAMEWORK}" && ${vi_cv_path_python} -c \
  		"import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"; then
  	      vi_cv_path_python_plibs="-framework Python"
@@ -31,54 +31,54 @@ diff -up vim80/src/configure.ac.python3-tests vim80/src/configure.ac
  		  vi_cv_path_python_plibs="-F${python_PYTHONFRAMEWORKPREFIX} -framework Python"
  	      fi
  	    else
-diff -up vim80/src/testdir/test_channel_pipe.py.python3-tests vim80/src/testdir/test_channel_pipe.py
---- vim80/src/testdir/test_channel_pipe.py.python3-tests	2018-05-11 09:23:05.738146018 +0200
-+++ vim80/src/testdir/test_channel_pipe.py	2018-05-11 09:26:37.354413350 +0200
+diff -up vim82/src/testdir/test_channel_pipe.py.python-tests vim82/src/testdir/test_channel_pipe.py
+--- vim82/src/testdir/test_channel_pipe.py.python-tests	2019-07-26 07:58:53.000000000 +0200
++++ vim82/src/testdir/test_channel_pipe.py	2020-04-17 06:18:06.751977500 +0200
 @@ -1,4 +1,4 @@
 -#!/usr/bin/python
 +#!/usr/bin/python3
  #
  # Server that will communicate over stdin/stderr
  #
-diff -up vim80/src/testdir/test_channel.py.python3-tests vim80/src/testdir/test_channel.py
---- vim80/src/testdir/test_channel.py.python3-tests	2018-05-11 09:22:48.522284266 +0200
-+++ vim80/src/testdir/test_channel.py	2018-05-11 09:26:17.762574955 +0200
+diff -up vim82/src/testdir/test_channel.py.python-tests vim82/src/testdir/test_channel.py
+--- vim82/src/testdir/test_channel.py.python-tests	2020-04-17 06:18:06.751977500 +0200
++++ vim82/src/testdir/test_channel.py	2020-04-17 06:18:24.517813082 +0200
 @@ -1,4 +1,4 @@
--#!/usr/bin/python
+-#!/usr/bin/env python
 +#!/usr/bin/python3
  #
  # Server that will accept connections from a Vim channel.
  # Used by test_channel.vim.
-diff -up vim80/src/testdir/test_channel_write.py.python3-tests vim80/src/testdir/test_channel_write.py
---- vim80/src/testdir/test_channel_write.py.python3-tests	2018-05-11 09:23:21.254021422 +0200
-+++ vim80/src/testdir/test_channel_write.py	2018-05-11 09:26:54.952268193 +0200
+diff -up vim82/src/testdir/test_channel_write.py.python-tests vim82/src/testdir/test_channel_write.py
+--- vim82/src/testdir/test_channel_write.py.python-tests	2019-07-26 07:58:53.000000000 +0200
++++ vim82/src/testdir/test_channel_write.py	2020-04-17 06:18:06.751977500 +0200
 @@ -1,4 +1,4 @@
 -#!/usr/bin/python
 +#!/usr/bin/python3
  #
  # Program that writes a number to stdout repeatedly
  #
-diff -up vim80/src/testdir/test_makeencoding.py.python3-tests vim80/src/testdir/test_makeencoding.py
---- vim80/src/testdir/test_makeencoding.py.python3-tests	2018-05-11 09:23:38.990878990 +0200
-+++ vim80/src/testdir/test_makeencoding.py	2018-05-11 09:27:14.402107759 +0200
+diff -up vim82/src/testdir/test_makeencoding.py.python-tests vim82/src/testdir/test_makeencoding.py
+--- vim82/src/testdir/test_makeencoding.py.python-tests	2019-07-26 07:58:53.000000000 +0200
++++ vim82/src/testdir/test_makeencoding.py	2020-04-17 06:18:06.751977500 +0200
 @@ -1,4 +1,4 @@
 -#!/usr/bin/python
 +#!/usr/bin/python3
  # -*- coding: utf-8 -*-
  
  # Test program for :make, :grep and :cgetfile.
-diff -up vim80/src/testdir/test_netbeans.py.python3-tests vim80/src/testdir/test_netbeans.py
---- vim80/src/testdir/test_netbeans.py.python3-tests	2018-05-11 09:23:54.398752732 +0200
-+++ vim80/src/testdir/test_netbeans.py	2018-05-11 09:27:30.489975057 +0200
+diff -up vim82/src/testdir/test_netbeans.py.python-tests vim82/src/testdir/test_netbeans.py
+--- vim82/src/testdir/test_netbeans.py.python-tests	2019-07-26 07:58:53.000000000 +0200
++++ vim82/src/testdir/test_netbeans.py	2020-04-17 06:18:06.751977500 +0200
 @@ -1,4 +1,4 @@
 -#!/usr/bin/python
 +#!/usr/bin/python3
  #
  # Server that will communicate with Vim through the netbeans interface.
  # Used by test_netbeans.vim.
-diff -up vim80/src/testdir/test_short_sleep.py.python3-tests vim80/src/testdir/test_short_sleep.py
---- vim80/src/testdir/test_short_sleep.py.python3-tests	2018-05-11 09:24:09.134631798 +0200
-+++ vim80/src/testdir/test_short_sleep.py	2018-05-11 09:27:48.432827053 +0200
+diff -up vim82/src/testdir/test_short_sleep.py.python-tests vim82/src/testdir/test_short_sleep.py
+--- vim82/src/testdir/test_short_sleep.py.python-tests	2019-07-26 07:58:53.000000000 +0200
++++ vim82/src/testdir/test_short_sleep.py	2020-04-17 06:18:06.751977500 +0200
 @@ -1,4 +1,4 @@
 -#!/usr/bin/python
 +#!/usr/bin/python3
diff --git a/vim.spec b/vim.spec
index 8cc3bc6..a5d0794 100644
--- a/vim.spec
+++ b/vim.spec
@@ -1,4 +1,4 @@
-%define patchlevel 534
+%define patchlevel 587
 %if %{?WITH_SELINUX:0}%{!?WITH_SELINUX:1}
 %define WITH_SELINUX 1
 %endif
@@ -246,7 +246,7 @@ perl -pi -e "s,bin/nawk,bin/awk,g" runtime/tools/mve.awk
 %patch3013 -p1
 %patch3014 -p1
 %patch3016 -p1 -b .copypaste
-%patch3017 -p1
+%patch3017 -p1 -b .python-tests
 %patch3018 -p1
 
 %build
@@ -783,6 +783,9 @@ touch %{buildroot}/%{_datadir}/%{name}/vimfiles/doc/tags
 %{_datadir}/icons/locolor/*/apps/*
 
 %changelog
+* Fri Apr 17 2020 Zdenek Dohnal <zdohnal@redhat.com> - 2:8.2.587-1
+- patchlevel 587
+
 * Thu Apr 09 2020 Zdenek Dohnal <zdohnal@redhat.com> - 2:8.2.534-1
 - patchlevel 534