sublime_text
sublime_text copied to clipboard
`sublime.load_binary_resource` raises `FileNotFoundError` for a large file
Description of the bug
As the title.
Steps to reproduce
- Let's create a 100MB file:
Packages/out
$ dd if=/dev/zero of=out bs=104857600 count=1
- Reproduce the bug.
>>> sublime.find_resources('out')
['Packages/out']
>>> sublime.load_binary_resource(sublime.find_resources('out')[0])
Traceback (most recent call last):
File "__main__", line 1, in <module>
File "C:\Program Files\Sublime Text\Lib\python38\sublime.py", line 1211, in load_binary_resource
raise FileNotFoundError(f'resource "{name}" not found')
FileNotFoundError: resource "Packages/out" not found
Expected behavior
Either raises something like FileTooLargeError or just load it anyway (It's plugin author's design decision. You know sometimes you just need to load a large file anyway.).
Actual behavior
It raises FileNotFoundError, which is confusing.
Sublime Text build number
4175
Operating system & version
Win10 22H2 10945.4529
gentle bump, this is blocking for GitHub-Copilot LSP integration
@kraktus As a small note, this has been resolved in ST 4201 (private beta).