Hey, I accidentally saved the py files in my plugin with a byte order mark. (Notepad and VS write one by default.) I then found OSX would not read them – see below, “import hashlib” is the first characters of the file after the BOM. Removing the BOM made the error disappear. Also, it works fine on Windows.
According to python.org/dev/peps/pep-0263/ the BOM should be treated as if the first line was “# coding: utf-8” so it should work fine.
Error spew with a BOM on OSX:
reloading plugin Web Inspector.swi
Traceback (most recent call last):
File “/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py”, line 74, in reload_plugin
m = importlib.import_module(modulename)
File “./importlib/init.py”, line 90, in import_module
File “”, line 1584, in _gcd_import
File “”, line 1565, in _find_and_load
File “”, line 1532, in _find_and_load_unlocked
File “/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py”, line 678, in load_module
exec(compile(source, source_path, ‘exec’), mod.dict)
File “swi in /Users/montogeek/Library/Application Support/Sublime Text 3/Installed Packages/Web Inspector.sublime-package”, line 1
import hashlib