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: Byte-compiled files should be absent in tarballs
Type: Stage:
Components: Versions: Python 3.3, Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Arfrever, benjamin.peterson, georg.brandl, larry
Priority: release blocker Keywords:

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

Messages (7)
msg208562 - (view) Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * (Python triager) Date: 2014-01-20 19:13
Tarballs of 3.3.2 (and all previous versions tested by me) do not contain any *.py[co] files.
Tarballs of 3.3.3 contain 1 .pyc file, which is even generated for wrong Python version:

$ find -name "*.py[co]"
./Tools/hg/hgtouch.pyc
$ file Tools/hg/hgtouch.pyc
Tools/hg/hgtouch.pyc: python 2.7 byte-compiled

Please ensure that this problem will not occur with future tarballs.
msg208563 - (view) Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * (Python triager) Date: 2014-01-20 19:23
Potential fix:

--- Makefile.pre.in
+++ Makefile.pre.in
@@ -1487,4 +1487,4 @@
 # Touch generated files
 touch:
-       hg --config extensions.touch=Tools/hg/hgtouch.py touch -v
+       PYTHONDONTWRITEBYTECODE=1 hg --config extensions.touch=Tools/hg/hgtouch.py touch -v
msg208564 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2014-01-20 19:27
Your fix won't work, because release managers call hgtouch from a different spot, from a private tool called "release.py".

You'll notice that all the 3.4 releases have that hgtouch.pyc file--up until 3.4b2.  I already found that bug.  I added "Tools/hg/hgtouch.pyc" to the tuple of "files we don't want in tarballs" in export() in release.py.  Didn't push it because I was doing other hacking and it wasn't ready, but I could push just that change.
msg208565 - (view) Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * (Python triager) Date: 2014-01-20 19:33
When Mercurial is ported to Python 3 somewhen in the future, then e.g. Tools/hg/__pycache__/hgtouch.cpython-34.pyc could be generated, so PYTHONDONTWRITEBYTECODE=1 might still be useful in release.py.
msg208566 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2014-01-20 19:35
The construction of release.py would make it easy to just always pass it in when running Python (and hg, and any program).  Maybe that's a better choice.
msg208572 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2014-01-20 19:50
http://hg.python.org/release/rev/9272f4fd7689
msg208573 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2014-01-20 20:06
> When Mercurial is ported to Python 3 somewhen in the future

Good one.
History
Date User Action Args
2022-04-11 14:57:57adminsetgithub: 64515
2014-01-20 20:06:35georg.brandlsetmessages: + msg208573
2014-01-20 19:50:46benjamin.petersonsetstatus: open -> closed

nosy: + benjamin.peterson
messages: + msg208572

resolution: fixed
2014-01-20 19:35:16larrysetmessages: + msg208566
2014-01-20 19:33:42Arfreversetmessages: + msg208565
2014-01-20 19:27:55larrysetmessages: + msg208564
2014-01-20 19:23:25Arfreversetmessages: + msg208563
2014-01-20 19:14:27georg.brandlsetpriority: normal -> release blocker
nosy: + larry
2014-01-20 19:13:21Arfrevercreate