The old centos 4 installation at work had been running fine, until the day I accidentally deleted python2.3 off of it. I needed to install python2.5 and didnt think this would cause any problems. However I ended up breaking yum [Our friendly package manager].
Quite a few people tried to fix this by installing 2.3 and although I cant give a detailed series of actions that led to this, but we were getting problems with PyUnicodeUCS2_DecodeUTF8 or more specifically
undefined symbol: PyUnicodeUCS2_DecodeUTF8
A little research into te problem indicated that its because of a representation issue for Unicode. The modules in question are using 4 bytes to represent a unicode whereas my Version of Python was using 2.
The only way to solve this problem is to use extension modules compiled with a Python binary built using the same size for Unicode characters.
However I was getting this inside pythons own libraries.
Therefore I Went to http://rpm.pbone.net and Went to Advanced rpm search, selected CentOS 4, and got rpm-python for the selected platform.
I Downloaded the package via wget and then ran the following command to unpack the rpm file:-
rpm2cpio python-2.3.4-14.4.i386.rpm | cpio -idmv
This made a heirarchy inside my working folder starting with the relative path usr.
After that, I copied everything from here to /usr/lib/python2.3 [or the Lib folder for python.]
I fired up yum and Everything worked like a breeze