Bug 767174 - createrepo fails if lzma is not installed on Fedora 16
Summary: createrepo fails if lzma is not installed on Fedora 16
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: createrepo
Version: 16
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Luke Macken
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-12-13 13:46 UTC by Jay Dobies
Modified: 2016-09-20 02:43 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-13 16:09:02 UTC
Type: ---


Attachments (Terms of Use)

Description Jay Dobies 2011-12-13 13:46:10 UTC
It looks like createrepo is crashing (the bug notification tool pops up). I'm seeing both:

_read_gzip_header:IOError: Not a gzipped file
or
compressOpen:AttributeError: 'NoneType' object has no attribute 'LZMAFile'

I believe it's the TestErrata test that's calling createrepo since most of the test failures revolve around assertions in there, but I'm not 100% sure.

Comment 1 Pradeep Kilambi 2011-12-13 14:51:10 UTC
This looks like a missing dependency in createrepo. Looking at the createrepo code this happens when createrepo is not able to import lzma module. 

If i do,

$ yum install pyliblzma

this error will go away. reassigning to createrepo component.

more info on traceback,


ModifyRepoError: Traceback (most recent call last):
  File "/usr/share/createrepo/modifyrepo.py", line 217, in <module>
    ret = main(sys.argv[1:])
  File "/usr/share/createrepo/modifyrepo.py", line 210, in main
    repomd.add(metadata, mdtype=opts.mdtype)
  File "/usr/share/createrepo/modifyrepo.py", line 123, in add
    newmd = compressOpen(destmd, mode='wb', compress_type=self.compress_type)
  File "/usr/lib/python2.7/site-packages/createrepo/utils.py", line 129, in compressOpen
    return lzma.LZMAFile(fn, mode)
AttributeError: 'NoneType' object has no attribute 'LZMAFile'

looking at createrepo/utils.py

try:
    import lzma
    _available_compression.append('xz')
except ImportError:
    lzma = None

if lzma is not able to import, it defaults to None, but the compressOpen method tryies to do a return lzma.LZMAFile(fn, mode) even if lzma is None.

Comment 2 seth vidal 2011-12-13 16:09:02 UTC
createrepo in updates-testing has this requirement.


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