tberghammer added a comment.

I don't think using unicode strings everywhere is a good idea because when we 
compare a string coming from the SB API with a string literal we don't want to 
do a lot of conversion. Also I think enforcing all string literals to be 
unicode is something what will break all the time.

I tried to change the code to use "self.session = io.open(path, mode="w", 
encoding="utf-8")" but it was failing with the following stack trace:

  Traceback (most recent call last):
  File "./test/dotest.py", line 7, in <module>
    lldbsuite.test.run_suite()
  File "/mnt/ssd/ll/git/lldb/packages/Python/lldbsuite/test/dotest.py", line 
1089, in run_suite
    resultclass=test_result.LLDBTestResult).run(configuration.suite)
  File 
"/mnt/ssd/ll/git/lldb/third_party/Python/module/unittest2/unittest2/runner.py", 
line 162, in run
    test(result)
  File 
"/mnt/ssd/ll/git/lldb/third_party/Python/module/unittest2/unittest2/suite.py", 
line 65, in __call__
    return self.run(*args, **kwds)
  File 
"/mnt/ssd/ll/git/lldb/third_party/Python/module/unittest2/unittest2/suite.py", 
line 85, in run
    self._wrapped_run(result)
  File 
"/mnt/ssd/ll/git/lldb/third_party/Python/module/unittest2/unittest2/suite.py", 
line 115, in _wrapped_run
    test._wrapped_run(result, debug)
  File 
"/mnt/ssd/ll/git/lldb/third_party/Python/module/unittest2/unittest2/suite.py", 
line 117, in _wrapped_run
    test(result)
  File 
"/mnt/ssd/ll/git/lldb/third_party/Python/module/unittest2/unittest2/case.py", 
line 433, in __call__
    return self.run(*args, **kwds)
  File 
"/mnt/ssd/ll/git/lldb/third_party/Python/module/unittest2/unittest2/case.py", 
line 369, in run
    self.dumpSessionInfo()
  File "/mnt/ssd/ll/git/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 
1857, in dumpSessionInfo
    print("Session info generated @", datetime.datetime.now().ctime(), 
file=self.session)
  TypeError: must be unicode, not str


http://reviews.llvm.org/D16680



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to