#234 Pass to fmf Tree a unicode string as a parameter.
Merged 5 years ago by astepano. Opened 5 years ago by astepano.

@@ -112,6 +112,14 @@ 

  conhandler.setFormatter(formatter)

  logger.addHandler(conhandler)

  

+ # Temporary fix for issue #233.  Strings in Python3 are all unicode.  To get a

+ # unicode string in Python2 necessary to use `unicode()`.  fmf.Tree() expects a

+ # unicode string even in Python2 module.

+ try:

+     UNICODE_EXISTS = bool(type(unicode))

+ except NameError:

+     unicode = str

+ 

  

  def main(argv):

      parser = argparse.ArgumentParser(description="Inventory for a QCow2 test image")
@@ -200,7 +208,7 @@ 

          if self.path != path or self.tree is None:

              FmfMetadataTree.path = path

              try:

-                 FmfMetadataTree.tree = fmf.Tree(path)

+                 FmfMetadataTree.tree = fmf.Tree(unicode(path))

              except Exception:

                  """Fmf initialization failed. Do not try initialize further for this path.

                  """

rebased onto 8e60e2b7ea2504285181588e28e76b0e2ca0998e

5 years ago

pretty please pagure-ci rebuild

rebased onto 25f32ccb83e92a62be7edbf2dc33b74701f334da

5 years ago

pretty please pagure-ci rebuild

rebased onto 2cd20e4

5 years ago

pretty please pagure-ci rebuild

Commit f7deee1 fixes this pull-request

Pull-Request has been merged by astepano

5 years ago

Pull-Request has been merged by astepano

5 years ago