1. 15 Dec, 2022 3 commits
  2. 28 Oct, 2020 1 commit
  3. 04 Oct, 2019 1 commit
  4. 13 Aug, 2019 2 commits
  5. 25 Jul, 2019 2 commits
    • Will Thompson's avatar
      rebase: add --skip · 377187eb
      Will Thompson authored
      This is useful when a few languages have syntax errors, but you want to
      process the rest.
      377187eb
    • Will Thompson's avatar
      rebase: show rev & filename when .po parsing fails · f57cefbc
      Will Thompson authored
      Previously, on encountering a file that polib cannot parse, there was no
      indication (without --debug) of which file is causing offence:
      
          Traceback (most recent call last):
            File "../../wjt/translate-o-tron-3000/t3k", line 296, in <module>
              main()
            File "../../wjt/translate-o-tron-3000/t3k", line 292, in main
              args.func(args)
            File "../../wjt/translate-o-tron-3000/t3k", line 170, in rebase
              git_show_rev_file(args.git_dir, args.base_rev, rel_path)
            File "/usr/lib/python3/dist-packages/polib.py", line 139, in pofile
              return _pofile_or_mofile(pofile, 'pofile', **kwargs)
            File "/usr/lib/python3/dist-packages/polib.py", line 87, in _pofile_or_mofile
              instance = parser.parse()
            File "/usr/lib/python3/dist-packages/polib.py", line 1428, in parse
              (fpath, self.current_line))
          OSError: Syntax error in po file (line 2340)
      
      Since we are passing the contents of the file to pofile(), not its path,
      the 'fpath' visible in the backtrace is the empty string – polib doesn't
      know what it's called. Even though the (private) POFile constructor
      accepts a fpath argument to deal with this case, the pofile() wrapper
      function doesn't pass it through; and it would be cheating to tell it a
      path that is not actually an on-disk file. Rather than materializing the
      file, we can just include the revision and path ourselves:
      
          Traceback (most recent call last):
            File "../../wjt/translate-o-tron-3000/t3k", line 158, in _parse_pofile_at_rev
              return polib.pofile(contents)
            File "/usr/lib/python3/dist-packages/polib.py", line 139, in pofile
              return _pofile_or_mofile(pofile, 'pofile', **kwargs)
            File "/usr/lib/python3/dist-packages/polib.py", line 87, in _pofile_or_mofile
              instance = parser.parse()
            File "/usr/lib/python3/dist-packages/polib.py", line 1428, in parse
              (fpath, self.current_line))
          OSError: Syntax error in po file (line 2340)
      
          The above exception was the direct cause of the following exception:
      
          Traceback (most recent call last):
            File "../../wjt/translate-o-tron-3000/t3k", line 309, in <module>
              main()
            File "../../wjt/translate-o-tron-3000/t3k", line 305, in main
              args.func(args)
            File "../../wjt/translate-o-tron-3000/t3k", line 185, in rebase
              base = _parse_pofile_at_rev(args.git_dir, args.base_rev, rel_path)
            File "../../wjt/translate-o-tron-3000/t3k", line 160, in _parse_pofile_at_rev
              raise IOError(f"Failed to parse {rev_filename}") from exc
          OSError: Failed to parse 3.26.7:po/ca.po
      f57cefbc
  6. 24 Jun, 2019 5 commits
  7. 21 Jun, 2019 1 commit