[Piglit] [PATCH] tests: fix unicode issue on MinGW in find_static_tests.py

Brian Paul brianp at vmware.com
Thu May 3 02:04:57 UTC 2018


Explicity convert strings to unicode before writing.
This fixes an error when building with MinGW:
Traceback (most recent call last):
  File "/var/workspace/tests/find_static_tests.py", line 74, in <module>
    main()
  File "/var/workspace/tests/find_static_tests.py", line 69, in main
    f.write(filename)
TypeError: write() argument 1 must be unicode, not str
---
 tests/find_static_tests.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/find_static_tests.py b/tests/find_static_tests.py
index 2152731..6ac1445 100644
--- a/tests/find_static_tests.py
+++ b/tests/find_static_tests.py
@@ -66,8 +66,8 @@ def main():
     if sorted(files) != sorted(existing):
         with io.open(args.output, 'wt', encoding='utf-8') as f:
             for filename in files:
-                f.write(filename)
-                f.write('\n')
+                f.write(unicode(filename))
+                f.write(unicode('\n'))
 
 
 if __name__ == '__main__':
-- 
2.7.4



More information about the Piglit mailing list