[kde-freebsd] Re: ports/155435: [PATCH] devel/kdebindings4-python-pykdeuic4 leaves .pyo files after deinstall
Jason E. Hale
bsdkaffee at gmail.com
Mon Mar 14 22:40:14 CET 2011
The following reply was made to PR ports/155435; it has been noted by GNATS.
From: "Jason E. Hale" <bsdkaffee at gmail.com>
To: Raphael Kubo da Costa <kubito at gmail.com>
Cc: bug-followup at freebsd.org
Subject: Re: ports/155435: [PATCH] devel/kdebindings4-python-pykdeuic4 leaves .pyo files after deinstall
Date: Mon, 14 Mar 2011 17:31:06 -0400
On Friday, March 11, 2011 09:18:11 Raphael Kubo da Costa wrote:
> I suspect something might be wrong with the Python handling code in
> ports -- I also had a lot of *.pyo files in my 2.6 site-packages after
> the ports were upgraded to 2.7, and I had to manually remove them.
>
There were only a few ports that left .pyo files on my system and I followed
up on each one: astro/gpsd, print/system-config-printer, and
devel/kdebindings4-python-pykdeuic4. I'm sure there are more ports with the
same problem.
The problem is that if Python is run with -O as root, any modules that are
imported will be byte-compiled with the .pyo extension.
For example, if you do something like:
# python -O
>>> import PyQt4.uic.pykdeuic4
The .pyo file will be created for ${PYTHON_SITELIBDIR}/PyQt4/uic/pykdeuic4.py
> I see. Well, I'd rather have this kind of change discussed upstream. As
> for this specific problem, I don't think it's KDE's fault.
>
It may be the way the KDE developers chose to handle Python files, but it
seems that the way almost all FreeBSD Python ports handle the issue is to just
install both the .pyc and the .pyo files. If there is a chance that the file
could be created at some point I think we should just install it in the first
place.
I also realized that the pkg-plist for devel/kdebindings4-python-pykde4 would
also be affected if my patch for PythonMacros.cmake were to be applied.
More information about the kde-freebsd
mailing list