mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-10 06:46:15 +01:00
- run_editor: use shlex.split instead of plain split in order to build a proper cmd for $EDITOR
This commit is contained in:
parent
2dac43aecf
commit
0e30e56ded
@ -21,6 +21,7 @@ import subprocess
|
|||||||
import re
|
import re
|
||||||
import socket
|
import socket
|
||||||
import errno
|
import errno
|
||||||
|
import shlex
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from urllib.parse import urlsplit, urlunsplit, urlparse, quote_plus, urlencode, unquote
|
from urllib.parse import urlsplit, urlunsplit, urlparse, quote_plus, urlencode, unquote
|
||||||
@ -3480,7 +3481,7 @@ def run_pager(message, tmp_suffix=''):
|
|||||||
|
|
||||||
def run_editor(filename):
|
def run_editor(filename):
|
||||||
editor = os.getenv('EDITOR', default=get_default_editor())
|
editor = os.getenv('EDITOR', default=get_default_editor())
|
||||||
cmd = editor.split(' ')
|
cmd = shlex.split(editor)
|
||||||
cmd.append(filename)
|
cmd.append(filename)
|
||||||
return run_external(cmd[0], *cmd[1:])
|
return run_external(cmd[0], *cmd[1:])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user