classification
Title: distutils --record option does not validate existence of byte-compiled files
Type: behavior Stage: patch review
Components: Distutils Versions: Python 3.6, Python 3.5, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: bbqsrc, berker.peksag, eric.araujo, koobs, marcusva
Priority: normal Keywords: easy, needs review, patch

Created on 2014-01-26 14:20 by marcusva, last changed 2016-03-05 10:03 by berker.peksag.

Files
File name Uploaded Description Edit
20397-head.patch bbqsrc, 2016-01-06 09:05 Patch against head review
20397-py27.patch bbqsrc, 2016-01-06 09:06 Patch against 2.7 branch
Messages (4)
msg209320 - (view) Author: Marcus von Appen (marcusva) Date: 2014-01-26 14:20
Using the --record argument with distutils' install command currently assumes that all .py files can be compiled (and optimized) successfully. 

If this is not the case for whatever reason, you end up with invalid entries in the record list. install_lib._bytecode_filenames() should verify, if the file could be created successfully (by e.g. checking for its existence) or the util.byte_compile() function should return a value that indicates, if the byte-compiled (or optimized) file could be created, so that the subsequent call to _bytecode_filenames() receives a list with valid entries.

The issue can be recreated with e.g. http://pypi.python.org/pypi/Products.PasswordResetTool, which will create invalid entries for skins/PasswordReset/pwreset_constructURL.py,
which acts as template/fragment.
msg257444 - (view) Author: Kubilay Kocak (koobs) Date: 2016-01-04 08:26
setuptools and therefore pip are also affected by this
msg257591 - (view) Author: Brendan Molloy (bbqsrc) * Date: 2016-01-06 09:07
I've just uploaded patches for head and 2.7, with relevant unit tests.
msg257798 - (view) Author: Kubilay Kocak (koobs) Date: 2016-01-09 07:37
This needs review, commit, merge.

We've back-ported and committed these patches against all of our FreeBSD Python ports (27,32,33,34,35)

https://svnweb.freebsd.org/ports?view=revision&revision=405569
History
Date User Action Args
2016-03-05 10:03:19berker.peksagsetnosy: + berker.peksag

versions: - Python 3.2, Python 3.3, Python 3.4
2016-01-09 07:37:20koobssetstage: needs patch -> patch review
messages: + msg257798
versions: + Python 3.2, Python 3.3
2016-01-06 09:07:34koobssetkeywords: + needs review
2016-01-06 09:07:05bbqsrcsetnosy: + bbqsrc
messages: + msg257591
2016-01-06 09:06:47bbqsrcsetfiles: + 20397-py27.patch
2016-01-06 09:06:00bbqsrcsetfiles: + 20397-head.patch
keywords: + patch
2016-01-04 08:26:30koobssetmessages: + msg257444
2016-01-04 08:25:09koobssetkeywords: + easy
versions: + Python 3.6
2014-04-11 06:11:13eric.araujosetnosy: + eric.araujo
title: distutils --record option does not validate existance of byte-compiled files -> distutils --record option does not validate existence of byte-compiled files

stage: needs patch
versions: + Python 3.4, Python 3.5, - Python 3.1, Python 3.2, Python 3.3
2014-04-06 12:14:36koobssetnosy: + koobs
2014-01-26 14:20:14marcusvacreate