This is another string/byte conversion issue between Python 2 and 3. In Python 2, the subprocess communication expects a byte string, but in Python 3, it expects bytes. Since both versions are capable of using strings when universal_newlines is set to True AND filecheck operates on strings, force the use of strings.
Details
Diff Detail
- Repository
- rLLDB LLDB
Event Timeline
packages/Python/lldbsuite/test/lldbtest.py | ||
---|---|---|
2230–2233 | Ok I had to stare at this for a long time to figure out what was going on. I think you need to update the comment here, because it makes it sounds like output is the result of a Popen.communicate. But output is the result of a debugger.HandleCommand(). I think we should actually just leave this the way it was and fix it in the call to Popen (see below) | |
2243–2245 | If I'm not mistaken, Python 3 can accept stdin as bytes or string, and either will work, it depends on the value of universal_newlines, and stdout will be in whatever format stdin was in. If we pass universal_newlines=True, then it will expect a string and output a string, otherwise it expects a bytes and output a bytes. Given that FileCheck is supposed to operate on textual data and not binary data, perhaps we should be doing that here? |
Force the comparison in filecheck to use text rather than bytes
packages/Python/lldbsuite/test/lldbtest.py | ||
---|---|---|
2243–2245 | Brilliant! :) |
Ok I had to stare at this for a long time to figure out what was going on. I think you need to update the comment here, because it makes it sounds like output is the result of a Popen.communicate. But output is the result of a debugger.HandleCommand().
I think we should actually just leave this the way it was and fix it in the call to Popen (see below)