When unmerging python, the python_mod_cleanup() function in python.eclass is called to remove .pyc/.pyo leftovers from /usr/lib/python-X.Y : einfo "Cleaning orphaned Python bytecode from ${path} .." for obj in $(find ${path} -name *.pyc); do src_py="${obj%c}" if [ ! -f "${src_py}" ]; then einfo "Purging ${src_py}[co]" rm -f ${src_py}[co] fi done This code fails to cleanup .pyo files if all .pyc files have been manually removed in between, since the find reports nothing. This might sound a little unlikely, but that's just what the upcoming Catalyst2 tool does in livecd-stage1 : find ${clst_chroot_path}/usr/lib -iname "*.pyc" -exec rm -f {} \; This results in .pyo leftovers when python is unmerged.
Created attachment 94458 [details, diff] remove .pyc and .pyo I haven't tested this, but I think it will fix this problem. Does anyone care to give it a look?
Created attachment 94459 [details, diff] err, this one will really work The other patch was wrong, hopefully this is right... again, someone who is more familiar with this stuff needs to check this.
that doesn't work for .pyc files? do you mean something like echo ${obj%[co]}
Fixed in CVS. I had to fix the patch slightly but thanks for your work.