This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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

Created on 2014-01-26 14:20 by marcusva, last changed 2022-04-11 14:57 by admin. This issue is now closed.

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 (5)
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) (Python triager) 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) (Python triager) 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
msg386318 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-02-03 18:16
Distutils is now deprecated (see PEP 632) and all tagged issues are being closed. From now until removal, only release blocking issues will be considered for distutils.

If this issue does not relate to distutils, please remove the component and reopen it. If you believe it still requires a fix, most likely the issue should be re-reported at https://github.com/pypa/setuptools
History
Date User Action Args
2022-04-11 14:57:57adminsetgithub: 64596
2021-02-03 18:16:29steve.dowersetstatus: open -> closed

nosy: + steve.dower
messages: + msg386318

resolution: out of date
stage: patch review -> resolved
2018-10-30 06:32:57koobssetversions: + Python 3.7, Python 3.8, - Python 3.5, Python 3.6
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