I think I have a good idea how to fix this. in lldbsuite.support we can add unicode_file.py. Make it implement the file interface so that it looks just like an io object so it can be used with print(file=), and with the 'with' keyword, etc. Make the open method call io.open() with an encoding, then make the read / write methods do a python version check before sending the read / write call to the underlying io object. Then you basically just do
self.session_file = unicode_file.open(path, mode='w', encoding='utf-8') and then you can write however you want. print(u"", self.session_file) print("", self.session_file) will both work in any python version On Thu, Jan 28, 2016 at 10:21 AM Tamas Berghammer <tbergham...@google.com> wrote: > tberghammer added a comment. > > The traceback calculation is done inside unittest2 so I think we shouldn't > change it and we don't have access to the session variable either. > > > http://reviews.llvm.org/D16680 > > > >
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits