diff options
Diffstat (limited to 'QMTest/TestCmd.py')
-rw-r--r-- | QMTest/TestCmd.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/QMTest/TestCmd.py b/QMTest/TestCmd.py index 198f586..2fba0a0 100644 --- a/QMTest/TestCmd.py +++ b/QMTest/TestCmd.py @@ -1731,7 +1731,11 @@ class TestCmd(object): file = self.canonicalize(file) if mode[0] != 'w': raise ValueError("mode must begin with 'w'") - open(file, mode).write(content) + try: + open(file, mode).write(content) + except TypeError as e: + # python 3 default strings are not bytes, but unicode + open(file, mode).write(bytes(content,'utf-8')) # Local Variables: # tab-width:4 |