| |
@@ -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.
|
| |
"""
|
| |
Signed-off-by: Andrei Stepanov astepano@redhat.com