This question was already asked on Sublime Forum, but it seems no one can answer it. Maybe you can?
I've got the same issue on Windows 7 and 8, Sublime 2.0.1 x86 version:
Traceback (most recent call last):
File "./sublime_plugin.py", line 362, in run_
File "./myTestPlugin.py", line 8, in run
AttributeError: 'module' object has no attribute 'argv'
Because sublime plugins are not scripts. There is no command line, so there are no command line arguments to parse.
Python, in Sublime, is embedded, and for embedded python code to have sys.argv
set, Sublime would have to set the arguments explicitly. See Intro to embedding Python.
If you feel strongly about this, you'd have to make a case with the Sublime Text 2 developer to add a PySys_SetArgvEx(argc, argv, updatepath)
call after Py_Initialize()
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With