From 26ff36479ad2de4d3b87b53000cca1d21207efbe Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Wed, 16 Nov 2011 13:57:27 +0200 Subject: [PATCH] EditFile: Don't try and store temporary files in /usr/bin. --- debian/changelog | 1 + ubuntutools/question.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9a5edf4..71244db 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,7 @@ ubuntu-dev-tools (0.136) UNRELEASED; urgency=low available (as is the case on Debian). * mk-sbuild: debootstrap with all components, so that eatmydata can be installed. + * EditFile: Don't try and store temporary files in /usr/bin. -- Marc Deslauriers Tue, 15 Nov 2011 16:01:32 -0500 diff --git a/ubuntutools/question.py b/ubuntutools/question.py index 5e5d4b5..260b700 100644 --- a/ubuntutools/question.py +++ b/ubuntutools/question.py @@ -167,8 +167,8 @@ class EditBugReport(EditFile): re.DOTALL | re.UNICODE) def __init__(self, subject, body, placeholders=None): - tmpfile = tempfile.NamedTemporaryFile(prefix=sys.argv[0] + '_', - suffix='.txt', + prefix = os.path.basename(sys.argv[0]) + '_' + tmpfile = tempfile.NamedTemporaryFile(prefix=prefix, suffix='.txt', delete=False) tmpfile.write((u'Summary (one line):\n%s\n\nDescription:\n%s' % (subject, body)).encode('utf-8'))