After downloading Centos 5.5 i386 DVD and doing a fresh install on a VM I encountered this error:
Traceback (most recent call last): File "/usr/bin/yum", line 4, in ? import yum File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 30, in ? import logging ValueError: bad marshal data
I tried replacing yum and yum-fastestmirror by rpms to no avail. I would have tried replacing python itself but that will really break my system.
What solved my problem was the solution outlined by mnx solutions. It involved deleting some corrupted python runtime included in python’s packaging.
Run rpm verification on the python package.
# rpm -Va python .M...U.. /usr/lib/python2.4/aifc.py ..5..... /usr/lib/python2.4/logging/__init__.pyc
Delete the .pyc for logging.
# rm /usr/lib/python2.4/logging/__init__.pyc