Skip to content

Error branch is Python 2 code (bytes/str, Windows paths) - by reading #6

Open

Description

@dpc00

Claude reports:

By reading, not run (no Ruby on this machine): the error-handling branch of RubyCheckOnSave.run is Python 2 code and cannot work on ST3/4.

child_process.communicate()[0] returns bytes on Python 3, but the code then calls cmd_output.split('\n') and tests "error" not in line, which raises TypeError on bytes, so the "Ruby syntax error" dialog would never appear when ruby reports an error. It also does first_line.split(':', 2), which on Windows splits C:\path\a.rb:3: syntax error after the drive letter, and goto_line is passed a string line.

Fix: cmd_output = child_process.communicate()[0].decode('utf-8', 'replace'), split with re.match(r'.*?:(\d+): (.*)', line), and pass int(line) to goto_line.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions