fix: no need to encode arguments in python 3.x#120
Open
ansiz wants to merge 1 commit into
Open
Conversation
no need to encode arguments in python 3.x
|
I have the same problem. Have you solved it? |
Author
yep, just modify the file as I commited |
Author
|
@duoluoxiaosheng 把你修改过的代码发来看一下吧,看看第80行报错的代码是什么内容 |
|
我只是在用户配置文件添加了 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行就是 其中 |
Author
|
@duoluoxiaosheng 那你自己改一下吧,我写得很清楚呀,需要修改的地方在我提交的文件中,你照着改那么一行就行了 |
|
好了,可以了,谢谢你 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


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}"],: