#479 RPM 4.15 changed header returns from type 'bytes' to 'string'.
Merged by onosek. Opened by merlinm.
merlinm/rpkg rpm-header-return-fix  into  master

Download 479.patch

A change in the RPM bindings 4.15 [1] that changed the RPM header return type from 'bytes' to 'string' causes module scratch build submissions that include custom SRPMs (eg., fedpkg module-scratch-build ... --srpm foo.src.rpm) to blow up with the error:

Could not execute module_scratch_build: 'str' object has no attribute 'decode'

This PR handles that RPM change by handling either return value type.

[1] https://github.com/rpm-software-management/rpm/commit/84920f898315d09a57a3f1067433eaeb7de5e830

@merlinm would be nice to document the argument and return type of _string.

@onosek please take a look.

rebased onto fdc40f7be78e120f6b880d352cc916f39d36477f

@merlinm would be nice to document the argument and return type of _string.

@csomh Documentation added!

Lgtm! Let's wait for another pair of eyes.

It looks safe. Thank you.

Pull-Request has been merged by onosek

Metadata