Bug 24089

Summary: The rpm python dumps core
Product: [Retired] Red Hat Linux Reporter: Red Hat Bugzilla <bugzilla>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-01-16 14:53:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Red Hat Bugzilla 2001-01-16 03:43:53 UTC
The following script works under RedHat 7.0.

---foo-
#! /usr/bin/python

import sys
import os
import rpm

fd = os.open(sys.argv [1], 0)
try:
  (h, isSource) = rpm.headerFromPackage(fd)
  print isSource
  print h
except:
  pass
os.close(fd)
---

# ./foo ./foo
zsh: 1801 segmentation fault  ./foo ./foo

Comment 1 Red Hat Bugzilla 2001-01-16 14:51:32 UTC
Here's what I see (hjl is script above):
	bash$ ./hjl /D/7.0/i386/time-1.7-12.i386.rpm 
	0
	<header object at 80d9bf8>
Please reopen with more info.

Comment 2 Red Hat Bugzilla 2001-01-16 14:53:00 UTC
Ooops, got it now.

Comment 3 Red Hat Bugzilla 2001-01-16 14:58:50 UTC
This looks better:

Starting program: /usr/bin/python ./hjl ./hjl
[New Thread 1024 (LWP 18326)]
0
None

Fixed in CVS.