kanghtta / address-sanitizer

Automatically exported from code.google.com/p/address-sanitizer
0 stars 0 forks source link

2to3 dies on Clang 3.5's asan_symbolize.py #372

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Sorry to report this guys. What can I say about Python and breaking basic 
input/output....

$ sudo 2to3 -w /usr/local/bin/asan_symbolize.py 
RefactoringTool: Skipping implicit fixer: buffer
RefactoringTool: Skipping implicit fixer: idioms
RefactoringTool: Skipping implicit fixer: set_literal
RefactoringTool: Skipping implicit fixer: ws_comma
RefactoringTool: Can't parse /usr/local/bin/asan_symbolize.py: ParseError: bad 
input: type=22, value=u'=', context=('', (91, 34))
RefactoringTool: No files need to be modified.
RefactoringTool: There was 1 error:
RefactoringTool: Can't parse /usr/local/bin/asan_symbolize.py: ParseError: bad 
input: type=22, value=u'=', context=('', (91, 34))

Original issue reported on code.google.com by noloa...@gmail.com on 15 Jan 2015 at 2:11

GoogleCodeExporter commented 9 years ago
Line 91 is the print statement below:

    try:
      symbolizer_input = '%s %s' % (binary, offset)
      if DEBUG:
        print(symbolizer_input)
      print(symbolizer_input, file=self.pipe.stdin)
      while True:
        ...

Original comment by noloa...@gmail.com on 15 Jan 2015 at 2:13

GoogleCodeExporter commented 9 years ago
So it appears to make this work on some of the Pythons (god knows what they'll 
break next):

    print(symbolizer_input, file=self.pipe.stdin)

should be changed to:

    file=self.pipe.stdin
    print(symbolizer_input, file)

The changes need to occur on line 91 and 142.

Original comment by noloa...@gmail.com on 15 Jan 2015 at 2:41