Merge branch 'editor_temp_name' of https://github.com/Carpetsmoker/qutebrowser into Carpetsmoker-editor_temp_name

This commit is contained in:
Florian Bruhin 2015-05-29 23:46:46 +02:00
commit 1b89d880f5
2 changed files with 3 additions and 2 deletions

View File

@ -70,7 +70,7 @@ def run(args):
sys.exit(usertypes.Exit.ok)
if args.temp_basedir:
args.basedir = tempfile.mkdtemp()
args.basedir = tempfile.mkdtemp(prefix='qutebrowser-basedir-')
quitter = Quitter(args)
objreg.register('quitter', quitter)

View File

@ -122,7 +122,8 @@ class ExternalEditor(QObject):
raise ValueError("Already editing a file!")
self._text = text
try:
self._oshandle, self._filename = tempfile.mkstemp(text=True)
self._oshandle, self._filename = tempfile.mkstemp(
text=True, prefix='qutebrowser-editor-')
if text:
encoding = config.get('general', 'editor-encoding')
with open(self._filename, 'w', encoding=encoding) as f: