#59 Port to <str> return values from RPM. BZ 1851499
Merged 3 years ago by ngompa. Opened 3 years ago by mdomonko.
mdomonko/rpmdevtools bz1851499  into  master

file modified
+2 -2
@@ -44,8 +44,8 @@ 

      mi.pattern('version', rpm.RPMMIRE_STRCMP, keyid)

      for hdr in mi:

          sum = hdr['summary']

-         mo = re.search(br'\<.*\>', sum)

-         email = mo.group().decode(errors='replace')

+         mo = re.search(r'\<.*\>', sum)

+         email = mo.group()

          return email

  

  

file modified
+2 -2
@@ -42,8 +42,8 @@ 

  test_re = re.compile(r"^perl-(?:Devel|ExtUtils|Test)-")

  lib_re1 = re.compile(r"^lib.+")

  lib_re2 = re.compile(r"-libs?$")

- a_re = re.compile(br"\w\.a$")

- so_re = re.compile(br"\w\.so(?:\.\d+)*$")

+ a_re = re.compile(r"\w\.a$")

+ so_re = re.compile(r"\w\.so(?:\.\d+)*$")

  comp_re = re.compile(r"^compat-gcc")

  # required by Ant, which is required by Eclipse...

  jdev_re = re.compile(r"^java-.+-gcj-compat-devel$")

These regexes are matched against the data returned from the RPM header
functions further down the code, however the format of the data has
recently changed from <bytes> objects to decoded <str> objects, so we
should no longer declare the regexes as bytes.

Basically an inverse of the following two commits:
32581a8
d93953b

Details on the RPM change:
https://github.com/rpm-software-management/rpm/commit/84920f898315d09a57a3f1067433eaeb7de5e830

Pull-Request has been merged by ngompa

3 years ago

Thanks for the patch!

Metadata