Skip to content

TypeError on every save: settings file name uses __name__ (ST3/4) #4

Open

Description

@dpc00

Claude reports:

The package's default setting is never loaded on Sublime Text 3/4, so saving any .rb file raises a TypeError.

Sublime Text build 4215, Windows. The package is not in Package Control's Install Package list here, so I copied the files from the repo master into Packages. I opened a .rb file, changed it and saved. The console showed:

RubyCheckOnSave.py, line 15, in run
    child_process = subprocess.Popen(args, ...)
TypeError: expected str, bytes or os.PathLike object, not NoneType

Cause: sublime.load_settings(__name__ + '.sublime-settings'). On ST3/4 __name__ is RubyCheckOnSave.RubyCheckOnSave, so it looks for RubyCheckOnSave.RubyCheckOnSave.sublime-settings, which does not exist. ruby is then None and Popen gets [None, "-cw", path].

Fix (tested): sublime.load_settings('RubyCheckOnSave.sublime-settings'). After this change the setting is read and the next save fails only because /usr/bin/ruby does not exist (see the next issue).

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