diff options
author | koobs <koobs@FreeBSD.org> | 2016-01-09 00:45:09 +0800 |
---|---|---|
committer | koobs <koobs@FreeBSD.org> | 2016-01-09 00:45:09 +0800 |
commit | 2288e81968f58cc7a5410473132303f1f6447d45 (patch) | |
tree | b14d8368654ff10811b2639080582589ce4e3316 /lang/python33 | |
parent | 116751515f4e60f852631a84102055384b126b77 (diff) | |
download | freebsd-ports-gnome-2288e81968f58cc7a5410473132303f1f6447d45.tar.gz freebsd-ports-gnome-2288e81968f58cc7a5410473132303f1f6447d45.tar.zst freebsd-ports-gnome-2288e81968f58cc7a5410473132303f1f6447d45.zip |
lang/python{27,3*}: Backport patch in upstream issue20397
In certain situations, file references (.py[co]) for Python files that
fail to compile with compileall() are still added to distutils --record
output.
This output is used for pkg-plist generation and must only contain
references to files that will be installed.
One example of a failure condition is when a Python 2/3 compatible
package containing a file containing Python 3.x only code is built with
Python 2.x, such as Gunicorn's _gaiohttp.py [1]
This change backports patches submitted against upstream issue 20397 [2]
that has not yet been committed.
- For Python 2.7 and 3.5, backport both install_lib and test
- For Python 3.2, 3.3 and 3.4, only backport install_lib
[1] https://svnweb.freebsd.org/changeset/ports/404558
[2] https://bugs.python.org/issue20397
Thank you to Brendan Molloy for producing and submitting the patches
against upstream sources.
Reviewed by: sbz (python)
MFH: 2016Q1
Differential Revision: D4832
Diffstat (limited to 'lang/python33')
-rw-r--r-- | lang/python33/Makefile | 2 | ||||
-rw-r--r-- | lang/python33/files/patch-Lib_distutils_command_install__lib.py | 34 |
2 files changed, 35 insertions, 1 deletions
diff --git a/lang/python33/Makefile b/lang/python33/Makefile index e49c1f9d9b1d..6fbe8155e3db 100644 --- a/lang/python33/Makefile +++ b/lang/python33/Makefile @@ -2,7 +2,7 @@ PORTNAME= python33 PORTVERSION= ${PYTHON_PORTVERSION} -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= lang python ipv6 MASTER_SITES= PYTHON/ftp/python/${PORTVERSION} DISTNAME= Python-${PORTVERSION} diff --git a/lang/python33/files/patch-Lib_distutils_command_install__lib.py b/lang/python33/files/patch-Lib_distutils_command_install__lib.py new file mode 100644 index 000000000000..816395cbf2a7 --- /dev/null +++ b/lang/python33/files/patch-Lib_distutils_command_install__lib.py @@ -0,0 +1,34 @@ +From 9934ce31b8447667f71c211e559a8de71e8263db Mon Sep 17 00:00:00 2001 +From: Brendan Molloy <brendan@bbqsrc.net> +Date: Mon, 4 Jan 2016 23:14:06 +1100 +Subject: [PATCH] Check bytecode file actually exists and tests + +Should solve issue 20397, where using the --record argument results +in files that failed to generate bytecode files are added to the +record file nonetheless. + +--- Lib/distutils/command/install_lib.py.orig 2014-10-12 06:52:02 UTC ++++ Lib/distutils/command/install_lib.py +@@ -165,11 +165,18 @@ class install_lib(Command): + if ext != PYTHON_SOURCE_EXTENSION: + continue + if self.compile: +- bytecode_files.append(imp.cache_from_source( +- py_file, debug_override=True)) ++ candidate = imp.cache_from_source( ++ py_file, debug_override=True) ++ ++ if os.path.isfile(candidate): ++ bytecode_files.append(candidate) ++ + if self.optimize > 0: +- bytecode_files.append(imp.cache_from_source( +- py_file, debug_override=False)) ++ candidate = imp.cache_from_source( ++ py_file, debug_override=False) ++ ++ if os.path.isfile(candidate): ++ bytecode_files.append(candidate) + + return bytecode_files + |