Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 454179 - yum unable to load Python module _sha256 after upgrade to FC9
Summary: yum unable to load Python module _sha256 after upgrade to FC9
Alias: None
Product: Fedora
Classification: Fedora
Component: python
Version: 9
Hardware: i686
OS: Linux
Target Milestone: ---
Assignee: James Antill
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2008-07-06 01:15 UTC by Farrell Gerbode
Modified: 2014-01-21 23:03 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2009-07-15 08:24:02 UTC

Attachments (Terms of Use)

Description Farrell Gerbode 2008-07-06 01:15:36 UTC
Description of problem:
Unable to run yum due to missing Python module _sha256 after upgrade to FC9 from
FC8 updated on 4 July 2008

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. yum <any argument included no argument>
Actual results:

# yum
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   No module named _sha256

Please install a package which provides this module, or
verify that the module is installed correctly.

It's possible that the above module doesn't match the
current version of Python, which is:
2.5.1 (r251:54863, Jun 15 2008, 23:59:20) 
[GCC 4.1.2 20070925 (Red Hat 4.1.2-33)]

If you cannot solve this problem yourself, please go to 
the yum faq at:

Expected results:

Additional info:

I tried to execute yum from a terminal window (after su) when I did not receive
expected alerts to update software and when I was unable to get "Software
Updater" to start up.  (It tried to start, but disappeared without putting a
window on the display.)

This problem sounds like it might be related to 240629.  However, I am working
FC9 downloaded on 15 May 2008.

Hardware is an old Compaq 7EL series 7000T (Athlon) > 6 years old, 1 GB memory.

Comment 1 Farrell Gerbode 2008-07-06 02:33:15 UTC
I was able to create a workaround from a posting in the Forums at


and did rpm -Uvh *.rpm  as su root

It updated the packages now and yum works, Software Updater works.

The Forum posting also said to update python-fedora*.  However, that added
dependencies for python-bugzilla, python-feedparser and several others, so I
skipped that.  I had to add python-devel because of dependency of pycairo.

My problem appears to be solved.  However, there probably is a problem in the
.iso for FC9 if it's still the same one I downloaded on May 15.

Comment 2 Seth Vidal 2008-07-06 13:15:37 UTC
We've had no other reports of problems from the isos. I think this is just a one
off issue.

Comment 3 James Antill 2008-07-06 23:13:57 UTC
 This looks like python was broken ... do you know what version of python you
had when things weren't working? Also "rpm -V" might have shed some light on the

 But if noone hits the problem again, who cares what happened :).

Comment 4 Farrell Gerbode 2008-07-07 04:10:42 UTC
In the output included above, the version of python that yum said it was using was:
2.5.1 (r251:54863, Jun 15 2008, 23:59:20) 
[GCC 4.1.2 20070925 (Red Hat 4.1.2-33)]

Unfortunately, I do not know the full rpm name for the python that was
installed.  I do know that I ran Software Updater on FC8 less than 24 hours
before starting the upgrade to FC9.  So, whatever python I had on FC8 was
considered to be current on July 4th.  Is it possible that the FC8 version was
at or above the version on the ISO for FC9 and that python (and its related
components) were not completely upgraded?

BTW, the FC8 was a clean install from around May 20 with updates applied three
or four times since that date.

Comment 5 James Antill 2008-07-07 04:37:38 UTC
""" Is it possible that the FC8 version was at or above the version on the ISO
for FC9 and that python (and its related components) were not completely

 It's true that if you did an Fed-8 update after Thursday you'd have had a newer
python than is on the Fed-9 ISO. But it's only a point release difference, so
AFAIK that shouldn't cause a problem.
 I'll try and test this soon, to make sure there isn't a generic problem.

Comment 6 James Antill 2008-07-09 23:29:21 UTC
 Ok, the problem is this:

. python-2.5.1-26.fc8.x86_64 hashlib links against openssl-0.9.8b-17.fc8.x86_64
. Fedora-9/anaconda/yum upgrades to openssl-0:0.9.8g-6.fc9.x86_64
. Fedora-9/anaconda/yum doesn't downgrade to python-2.5.1-25.fc9 (as it's older)
. Thus python -c "import _hashlib" fails post install.
. Thus python -c "import _sha256" fails post install.

...I fixed it by copying and from a Fed-8 box into
/lib64 ... but that's obviously not a good solutiuon going forward.


Comment 7 Jesse Keating 2008-07-10 17:01:27 UTC
Upgrades suck, especially if you've gotten to the point where your packages on
disk are n-v-r higher than the ones you're trying to upgrade to.  There really
isn't a solution to this except for maybe preupgrade, but I'm not sure
preupgrade would allow use of the F9 updates repo during upgrades.

Comment 8 James Antill 2008-07-10 17:07:13 UTC
 Well there are two "obvious" solutions I see:

1. New python in Fed-8 which is nevra smaller than the python the on Fedora-9
ISO, everyone who's already upgraded is still screwed ... but it works for
everyone else.

2. New python in Fed-8 which is still nevra smaller than the latest Fed-9
update, but still higher than what is in Fed-8 now (and thus. on the Fed-9 ISO)
... and contains some kind of workaround for the libssl ... just dump copies of / somewhere than can find it?

...Jeremy mentioned doing #1 too, and I assume everyone will hate #2 (although
it's the only auto. fix for people who have already upgraded). So I can do that,
unless someone has another idea?

Comment 9 James Antill 2008-07-10 17:29:35 UTC
 Ok, looking at the code there is a third possibility:

 hashlib does "import _hashlib" and if that fails then tries to "import _sha";
"import _md5"; "import _sha256" and "import _sha512" ... however only the last
two fail because from we have:

        if (openssl_ver < 0x00908000):
            # OpenSSL doesn't do these until 0.9.8 so we'll bring our own hash
            exts.append( Extension('_sha256', ['sha256module.c']) )
            exts.append( Extension('_sha512', ['sha512module.c']) ) we can just remove the above test.

Comment 10 James Antill 2008-07-10 17:31:38 UTC
 Anyone have suggestions on a way to test to make sure that is all that's needed?

Comment 11 James Antill 2008-07-10 18:00:57 UTC
 Ok, I tested it by force downgrading to:

python-2.5.1-26.fc8.x86_64.rpm python-libs-2.5.1-26.fc8.x86_64.rpm

...which gives:

error: Failed dependencies: is needed by python-2.5.1-26.fc8.x86_64 is needed by python-2.5.1-26.fc8.x86_64 is needed by tkinter-2.5.1-26.fc8.x86_64 is needed by tkinter-2.5.1-26.fc8.x86_64 is needed by tkinter-2.5.1-26.fc8.x86_64

...but --nodeps to the rescue there, that gives the above errors about importing
_sha256, then I tried:

python-2.5.1-26.fc8.2.x86_64.rpm python-libs-2.5.1-26.fc8.2.x86_64.rpm

...which is the same thing but with the above change, "yum lsu" now
fails due to:

  File "/usr/lib/python2.5/site-packages/urlgrabber/", line 331, in
    class HTTPSHandler(KeepAliveHandler, urllib2.HTTPSHandler):
AttributeError: 'module' object has no attribute 'HTTPSHandler'

...because openssl still isn't available, however patching urlgrabber with a
simple try/except pass around that lets "yum lsu" work, and indeed I could then
"yum up -y" to get a fully working system again (obviously it would fail for
people who have a repo on an HTTPS URL ... but that's a much smaller number).

 So what does everyone think, do a Fed-8 python and * python-urlgrabber update
with those two changes?

Comment 12 Farrell Gerbode 2008-07-10 19:09:52 UTC
Folks, I have to apologize for an error in reporting this problem:  It was
discovered on i386, not i686.

In reading some of the appends emailed today, I the references to 64bit finally
registered in my consciousness.  I went back to bugzilla to investigate and
found that apparently I selected the wrong hardware in reporting the problem.

I regret any confusion that has caused.  However, it appears that the problem
occurs in at least two versions.

Comment 13 Fedora Update System 2008-07-10 22:02:03 UTC
python-urlgrabber-3.0.0-9.fc8 has been submitted as an update for Fedora 8

Comment 14 Stephen Warren 2008-07-11 16:01:27 UTC
FYI, I was just hit by this too, on i386/i686 architecture.

I also worked around it using the URL in comment #1 here, the 4th comment at
that URL (although I didn't need to manually update the python-fedora RPM).

Re: Comment #3, I don't know which Python version I had before the upgrade,
although I had just updated to the latest released F8 updates immediately before.

Re: Comment #7:

> "Upgrades suck, especially if you've gotten to the point where your
> packages on disk are n-v-r higher than the ones you're trying to
> upgrade to."

Surely this should *never* happen; any F9 RPM should always be NVR higher than
any F8 RPM; this is assured by incrementing F8 versions e.g. 1.fc8, 2.fc8 (F9
branches here) 2.fc8.1 (instead of 3.fc8). Isn't this enforced by Koji/Bodhi?
I'm sure the Wiki tells packagers to do this.

Finally, and this may/may-not be related, after I upgraded to F9, I noticed that
the grub configuration wasn't updated to include the new F9 kernel. I don't know
if this could be related to the same/similar issue with yum/Python? The
installer didn't give me any error messages (although I didn't check the text
consoles). Feel free to ignore this if it's not relevant to this bug particular

Comment 15 Farrell Gerbode 2008-07-11 18:15:30 UTC
I thought that grub said it was booting an fc8 kernel when I rebooted after the
upgrade, but got caught up in the update problem before investigating it.  It
was corrected by updates applied after correcting the python problems.

Comment 16 James Antill 2008-07-11 19:12:46 UTC
 These are not 100% tested yet, but installing these before the update should
fix everything:

Comment 17 Fedora Update System 2008-07-15 12:17:28 UTC
python-urlgrabber-3.0.0-9.fc8 has been pushed to the Fedora 8 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update python-urlgrabber'.  You can provide feedback for this update here:

Comment 18 James Antill 2008-07-15 13:24:21 UTC
 I tested updating to both of the above pacakges and upgrfading from Fed-8 to
Fed-9 ... everything worked (well on the yum side, xorg* on the other hand :).
 So I think I'm going to push the urlgrabber to stable today, and push the
python one later this week.

Comment 19 Fedora Update System 2008-07-17 14:19:19 UTC
python-urlgrabber-3.0.0-9.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 20 Cédric OLIVIER 2008-07-21 21:53:25 UTC
I have done a preupgrade today (2008-07-21) with an up to date fedora8 to fedora
9 and I have the same problem.

Comment 21 James Antill 2008-07-22 02:23:06 UTC
 Yes, the last part needed is in updates-testing and has been requested to go
into updates (for Fed-8) but hasn't got there yet. this should be fixed in the next couple of days, when that moves.

Comment 22 Bug Zapper 2009-06-10 01:56:28 UTC
This message is a reminder that Fedora 9 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 9.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '9'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 9's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 9 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here:

Comment 23 Bug Zapper 2009-07-15 08:24:02 UTC
Fedora 9 changed to end-of-life (EOL) status on 2009-07-10. Fedora 9 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.