Open ansiz opened 7 years ago
I have the same problem. Have you solved it?
I have the same problem. Have you solved it?
yep, just modify the file as I commited
It dosen't work!
My system is Windows 10
@duoluoxiaosheng 把你修改过的代码发来看一下吧,看看第80行报错的代码是什么内容
我只是在用户配置文件添加了"browser_command"
并没有修改程序文件
def launching_web_browser_for_url(url, success_msg_default=None, success_msg_user=None):
try:
setting = Setting.instance()
if setting.browser_command:
browser_command = [os.path.expandvars(arg).format(url=url)
for arg in setting.browser_command]
if os.name == 'nt':
# unicode arguments broken under windows
encoding = locale.getpreferredencoding()
browser_command = [arg.encode(encoding) for arg in browser_command]
subprocess.Popen(browser_command)
if success_msg_user:
sublime.status_message(success_msg_user)
else:
# Default web browser
desktop.open(url)
if success_msg_default:
sublime.status_message(success_msg_default)
except:
if setting.browser_command:
log.exception('Error while launching user defined web browser')
else:
log.exception('Error while launching default web browser')
第80行就是 subprocess.Popen(browser_command)
其中subprocess
是import
的一个包
@duoluoxiaosheng 那你自己改一下吧,我写得很清楚呀,需要修改的地方在我提交的文件中,你照着改那么一行就行了
好了,可以了,谢谢你
It seems there is no need to encode arguments in python 3.x, it reports errors on Windows while I set "browser_command": ["C:\Program Files (x86)\Google\Chrome\Application\chrome.exe","{url}"],: