##// END OF EJS Templates
Fall back to default editor if $EDITOR is non-ASCII....
Thomas Kluyver -
Show More
@@ -41,13 +41,19 b' from IPython.utils.traitlets import Integer, CBool, Unicode'
41 def get_default_editor():
41 def get_default_editor():
42 try:
42 try:
43 ed = os.environ['EDITOR']
43 ed = os.environ['EDITOR']
44 if not py3compat.PY3:
45 ed = ed.decode()
46 return ed
44 except KeyError:
47 except KeyError:
48 pass
49 except UnicodeError:
50 warn("$EDITOR environment variable is not pure ASCII. Using platform "
51 "default editor.")
52
45 if os.name == 'posix':
53 if os.name == 'posix':
46 ed = 'vi' # the only one guaranteed to be there!
54 return 'vi' # the only one guaranteed to be there!
47 else:
55 else:
48 ed = 'notepad' # same in Windows!
56 return 'notepad' # same in Windows!
49 return ed
50
51
57
52 def get_pasted_lines(sentinel, l_input=py3compat.input):
58 def get_pasted_lines(sentinel, l_input=py3compat.input):
53 """ Yield pasted lines until the user enters the given sentinel value.
59 """ Yield pasted lines until the user enters the given sentinel value.
General Comments 0
You need to be logged in to leave comments. Login now