Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 413771 - python-distutils-ng.eclass fails bytecode generation with Python 3
Summary: python-distutils-ng.eclass fails bytecode generation with Python 3
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-27 18:23 UTC by James Rowe
Modified: 2012-05-02 21:41 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Fix bytecode generation for Python 3 (0001-Fix-bytecode-compilation-with-Python-3.patch,962 bytes, patch)
2012-04-27 18:23 UTC, James Rowe
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James Rowe 2012-04-27 18:23:04 UTC
The print syntax used in python-distutils-ng_src_install is invalid with
Python 3, and bytecode isn't generated for packages using the eclass.

The patch attached fixes that by just using the print() syntax,
which in this simple case works identically for Python 2.5+.

Thanks,

James

Reproducible: Always
Comment 1 James Rowe 2012-04-27 18:23:32 UTC
Created attachment 310289 [details, diff]
Fix bytecode generation for Python 3
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-05-02 14:07:01 UTC
If someone needed compatibility with ancient Python versions, I guess sys.stdout.write() could be used instead.
Comment 3 James Rowe 2012-05-02 17:20:29 UTC
> If someone needed compatibility with ancient Python versions, I guess
> sys.stdout.write() could be used instead.

Just in case my original comment was a little misleading.  The
`print(" ".join(sys.path))` version works right back to 2.0, when str.join 
was introduced.  What I really meant was "my change works correctly with all 
Python versions currently in the tree."
Comment 4 Mike Gilbert gentoo-dev 2012-05-02 21:41:12 UTC
Thank you for the report and patch James. I have committed your solution.