yum ValueError: bad marshal data

fedora yum出问题,运行出现:

    import httplib
  File "/usr/lib/python2.6/httplib.py", line 1078, in <module>
    import ssl
ValueError: bad marshal data


google找到解决方法,是import的ssl.py对应的.pyc和.pyo的问题,删掉,问题解决。


文章摘自:http://www.mnxsolutions.com/linux/yum-python-logger-error-bad-marshal-data.html

24 Mar 2010

yum python logger error bad marshal data 

By admin -Linux No Comments

Interesting bug encountered today after a fresh install of RHEL5 from 5.3 media.

When attempting to run the command, ‘yum’.  The following error was presented:

# yum
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

To correct this issue, I first needed to determine if the problem was with yum, or something else.  So I created a simple python script:

#!/usr/bin/python
import logging

Actually, really simple. This helped me isolate the issue.

When running this program I was presented with the same error message:

Traceback (most recent call last):
  File "test.py", line 1, in ?
    import logging
ValueError: bad marshal data

So I wondered, what could cause this corruption. Maybe the installation had a corrupt package installed. rpm verification to double check.

# rpm -Va python
.M...U..    /usr/lib64/python2.4/aifc.py
..5.....    /usr/lib64/python2.4/logging/__init__.pyc

So I though, maybe somehow the .pyc file became corrupt. So lets just delete this file, since it is only a byte-compiled file that will be re-generated on-demand.

And, well, that was the solution:

# rm /usr/lib64/python2.4/logging/__init__.pyc

The problem is now resolved.

The RPM of python that was installed: python-2.4.3-24.el5.x86_64.rpm




  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值