#14 Update to 16.7.9
Closed 4 years ago by churchyard. Opened 4 years ago by churchyard.
rpms/ churchyard/python-virtualenv 16.7.9  into  master

file modified
+1
@@ -6,3 +6,4 @@ 

  /virtualenv-16.0.0.tar.gz

  /virtualenv-16.6.1.tar.gz

  /virtualenv-16.7.3.tar.gz

+ /virtualenv-16.7.9.tar.gz

@@ -0,0 +1,40 @@ 

+ From 4955ebd4e8bfb01be582cdd7c0e9eb4155488ea6 Mon Sep 17 00:00:00 2001

+ From: Adam Williamson <adamw@happyassassin.net>

+ Date: Sat, 22 Feb 2020 04:53:46 -0800

+ Subject: [PATCH] Fix error printing in bailout for Python < 2.7 (#1651)

+ 

+ Ironically, the code that tries to print an error message when

+ we're running on Python < 2.7 can only work on Python 2.7 or

+ higher! Prior to 2.7, the curly-braces style of string formatting

+ required all fields to be explicitly numbered; you have to use

+ {0}, you cannot use {}. So if you actually try to run virtualenv

+ on Python 2.6, you get an error when trying to print the error!

+ This should fix that, and print the right error...

+ 

+ Signed-off-by: Adam Williamson <awilliam@redhat.com>

+ ---

+  docs/changelog/1651.bugfix.rst | 1 +

+  virtualenv.py                  | 2 +-

+  2 files changed, 2 insertions(+), 1 deletion(-)

+  create mode 100644 docs/changelog/1651.bugfix.rst

+ 

+ diff --git a/docs/changelog/1651.bugfix.rst b/docs/changelog/1651.bugfix.rst

+ new file mode 100644

+ index 000000000..26dd9c6ac

+ --- /dev/null

+ +++ b/docs/changelog/1651.bugfix.rst

+ @@ -0,0 +1 @@

+ +fix error printing in bailout for Python < 2.7 - by ``AdamWill`

+ diff --git a/virtualenv.py b/virtualenv.py

+ index 000d50a99..5968059b2 100755

+ --- a/virtualenv.py

+ +++ b/virtualenv.py

+ @@ -50,7 +50,7 @@

+  virtualenv_version = __version__  # legacy

+  DEBUG = os.environ.get("_VIRTUALENV_DEBUG", None) == "1"

+  if sys.version_info < (2, 7):

+ -    print("ERROR: {}".format(sys.exc_info()[1]))

+ +    print("ERROR: {0}".format(sys.exc_info()[1]))

+      print("ERROR: this script requires Python 2.7 or greater.")

+      sys.exit(101)

+  

file modified
+11 -2
@@ -1,6 +1,6 @@ 

  Name:           python-virtualenv

- Version:        16.7.3

- Release:        3%{?dist}

+ Version:        16.7.9

+ Release:        1%{?dist}

  Summary:        Tool to create isolated Python environments

  

  License:        MIT
@@ -10,6 +10,11 @@ 

  # Add /usr/share/python-wheels to file_search_dirs

  Patch1: rpm-wheels.patch

  

+ # Backports:

+ # Fix error printing in bailout for Python < 2.7

+ # https://github.com/pypa/virtualenv/pull/1651

+ Patch2:         https://github.com/pypa/virtualenv/commit/4955ebd4e8bfb01be582cdd7c0e9eb4155488ea6.patch

+ 

  BuildArch:      noarch

  BuildRequires:  git-core

  
@@ -140,6 +145,10 @@ 

  

  

  %changelog

+ * Mon Feb 24 2020 Miro Hrončok <mhroncok@redhat.com> - 16.7.9-1

+ - Update to 16.7.9

+ - Fix error printing in bailout for Python < 2.7

+ 

  * Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 16.7.3-3

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

  

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- SHA512 (virtualenv-16.7.3.tar.gz) = 0109d4260882a1ecb93556ab6661dd42314ef45618cbbe25925dc068ed199281ae5f968dfca5ab26029a4d9e486eaae916d1287b7a3461b4d5e9b92d4ebf8b8a

+ SHA512 (virtualenv-16.7.9.tar.gz) = ba2d08ec3425929806506c4c33e48d250153b02bd454eb340ab959519dd82ede8b12f2d2ab839e2a8711f29695d3956a457a1ca366a3b4fb4fb26c4c8d48c6cd

  • Fix error printing in bailout for Python < 2.7
<mock-chroot> sh-5.0# rpm -q python3-virtualenv
python3-virtualenv-16.7.3-3.fc32.noarch

<mock-chroot> sh-5.0# virtualenv -p python2.6
Running virtualenv with interpreter /usr/bin/python2.6
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/virtualenv.py", line 53, in <module>
    print("ERROR: {}".format(sys.exc_info()[1]))
ValueError: zero length field name in format
<mock-chroot> sh-5.0# rpm -q python3-virtualenv
python3-virtualenv-16.7.9-1.fc33.noarch
<mock-chroot> sh-5.0# virtualenv -p python2.6
Running virtualenv with interpreter /usr/bin/python2.6
ERROR: None
ERROR: this script requires Python 2.7 or greater.

This is improved but not quite perfect. Let me see if we can get that line removed entirely (I'd still like to ship this pre-beta freeze even as is).

Pull-Request has been closed by churchyard

4 years ago