diff --git a/check-exec_dir.patch b/check-exec_dir.patch new file mode 100644 index 0000000..3173786 --- /dev/null +++ b/check-exec_dir.patch @@ -0,0 +1,16 @@ +diff --git a/virtualenv.py b/virtualenv.py +index c4e3bd5..89b8863 100755 +--- a/virtualenv.py ++++ b/virtualenv.py +@@ -1181,8 +1181,9 @@ def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear, sy + exec_dir = join(sys.exec_prefix, 'Lib') + else: + exec_dir = join(sys.exec_prefix, 'lib', py_version) +- for fn in os.listdir(exec_dir): +- copyfile(join(exec_dir, fn), join(lib_dir, fn), symlink) ++ if os.path.isdir(exec_dir): ++ for fn in os.listdir(exec_dir): ++ copyfile(join(exec_dir, fn), join(lib_dir, fn), symlink) + + if is_jython: + # Jython has either jython-dev.jar and javalib/ dir, or just diff --git a/python-virtualenv.spec b/python-virtualenv.spec index 8bd1cfc..5c5abd9 100644 --- a/python-virtualenv.spec +++ b/python-virtualenv.spec @@ -8,7 +8,7 @@ Name: python-virtualenv Version: 15.0.3 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Tool to create isolated Python environments Group: Development/Languages @@ -16,6 +16,11 @@ License: MIT URL: http://pypi.python.org/pypi/virtualenv Source0: http://pypi.python.org/packages/source/v/virtualenv/virtualenv-%{version}.tar.gz +# virtualenv -p "/usr/bin/python3" venv fails if there are not packages installed +# under /usr/local/lib/pythonX.Y/site-packages. Check if exec_dir exists before +# listing it's content. +Patch0: check-exec_dir.patch + BuildArch: noarch BuildRequires: python2-devel @@ -81,6 +86,8 @@ licensed under an MIT-style permissive license %setup -q -n virtualenv-%{version} %{__sed} -i -e "1s|#!/usr/bin/env python||" virtualenv.py +%patch0 -p1 + %build # Build code %{py2_build} @@ -147,6 +154,9 @@ cp %{buildroot}/%{_bindir}/virtualenv %{buildroot}/%{_bindir}/virtualenv-2 %changelog +* Fri Feb 17 2017 Michal Cyprian - 15.0.3-6 +- Check if exec_dir exists before listing it's content during venv create process + * Sat Feb 11 2017 Fedora Release Engineering - 15.0.3-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild