fixing python 2.6 incompatibilities

the metadata writer fix was copied from pulp_rpm