sublimehq / sublime_text

Issue tracker for Sublime Text
https://www.sublimetext.com
812 stars 39 forks source link

OSError: resource not found (Which one?) #2113

Closed evandrocoan closed 3 years ago

evandrocoan commented 6 years ago

Summary

When the Sublime Text API raises:

Traceback (most recent call last):
  File "D:\User\Programs\SublimeText\3143\sublime_plugin.py", line 210, in on_api_ready
    m.plugin_loaded()
  File "AMXXEditor in C:\Sublime Text 3\Installed Packages\Amxmodx.sublime-package", line 42, in plugin_loaded
  File "AMXXEditor in C:\Sublime Text 3\Installed Packages\Amxmodx.sublime-package", line 68, in install_build_systens
  File "D:\User\Programs\SublimeText\3143\sublime.py", line 192, in load_resource
    raise IOError("resource not found")
OSError: resource not found

It fails in displaying what was the resource it did not found. How I am supposed to know what is this mysterious resource which could not be found?

Expected behavior

Traceback (most recent call last):
  ...
  File "D:\User\Programs\SublimeText\3143\sublime.py", line 192, in load_resource
    raise IOError("resource `%s` not found" % resource_path)
OSError: resource `C:\Sublime Text 3\Packages\User\Bilu.bilu` not found

Actual behavior

Traceback (most recent call last):
  ...
  File "D:\User\Programs\SublimeText\3143\sublime.py", line 192, in load_resource
    raise IOError("resource not found")
OSError: resource not found

Environment

Thom1729 commented 5 years ago

FYI, sublime_lib.ResourcePath.read_text|bytes() will catch the IOError and raise FileNotFoundError with the path in the message.

BenjaminSchaaf commented 3 years ago

Fixed in Sublime Text 4.