Package: python3-yapps
Version: 2.2.1-1
Severity: important

While trying to port keymapper to the current version of yapps2, and
after attempting to work around https://bugs.debian.org/911730 by moving
the pre-parser code to the post-parser position, I got this:

  yapps2 x11.g
  x11.g:90:1: Trying to find one of "parser"
  Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/yapps/runtime.py", line 438, in 
wrap_error_reporter
      return getattr(parser, rule)(*args,**kw)
    File "/usr/lib/python3/dist-packages/yapps/grammar.py", line 80, in Parser
      self._scan('"parser"', context=_context)
    File "/usr/lib/python3/dist-packages/yapps/runtime.py", line 376, in _scan
      return self._scanner.scan(type, **kw)
    File "/usr/lib/python3/dist-packages/yapps/runtime.py", line 344, in scan
      tok = self.token([type],context)
    File "/usr/lib/python3/dist-packages/yapps/runtime.py", line 297, in token
      raise SyntaxError(self.get_pos(), msg, context=context)
  yapps.runtime.SyntaxError: SyntaxError@('x11.g', 90, 1)(Trying to find one of 
"parser")
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/usr/bin/yapps2", line 11, in <module>
      load_entry_point('Yapps2==2.2.1', 'console_scripts', 'yapps2')()
    File "/usr/lib/python3/dist-packages/yapps/cli_tool.py", line 111, in main
      sys.exit(generate(optz.grammar_path, outputfile, **parser_flags))
    File "/usr/lib/python3/dist-packages/yapps/cli_tool.py", line 64, in 
generate
      t = runtime.wrap_error_reporter(parser, 'Parser')
    File "/usr/lib/python3/dist-packages/yapps/runtime.py", line 440, in 
wrap_error_reporter
      print_error(e, parser._scanner)
    File "/usr/lib/python3/dist-packages/yapps/runtime.py", line 420, in 
print_error
      scanner.print_line_with_pointer(pos)
    File "/usr/lib/python3/dist-packages/yapps/runtime.py", line 230, in 
print_line_with_pointer
      print >>out, '> ',text
  TypeError: unsupported operand type(s) for >>: 'builtin_function_or_method' 
and '_io.TextIOWrapper'. Did you mean "print(<message>, file=<output_stream>)"?

The first exception is probably my fault somehow; I'm doing this in
spare moments so haven't worked out the details.  However, the second
exception is because there is code in a Python 3 module that's using the
Python 2 print syntax.

Please could you fix the port by converting
Scanner.print_line_with_pointer to Python 3 print syntax?

Thanks,

-- 
Colin Watson                                       [[email protected]]

Reply via email to