EditFile: Don't try and store temporary files in /usr/bin.

This commit is contained in:
Stefano Rivera 2011-11-16 13:57:27 +02:00
parent fc669d8645
commit 26ff36479a
2 changed files with 3 additions and 2 deletions

1
debian/changelog vendored
View File

@ -9,6 +9,7 @@ ubuntu-dev-tools (0.136) UNRELEASED; urgency=low
available (as is the case on Debian). available (as is the case on Debian).
* mk-sbuild: debootstrap with all components, so that eatmydata can be * mk-sbuild: debootstrap with all components, so that eatmydata can be
installed. installed.
* EditFile: Don't try and store temporary files in /usr/bin.
-- Marc Deslauriers <marc.deslauriers@ubuntu.com> Tue, 15 Nov 2011 16:01:32 -0500 -- Marc Deslauriers <marc.deslauriers@ubuntu.com> Tue, 15 Nov 2011 16:01:32 -0500

View File

@ -167,8 +167,8 @@ class EditBugReport(EditFile):
re.DOTALL | re.UNICODE) re.DOTALL | re.UNICODE)
def __init__(self, subject, body, placeholders=None): def __init__(self, subject, body, placeholders=None):
tmpfile = tempfile.NamedTemporaryFile(prefix=sys.argv[0] + '_', prefix = os.path.basename(sys.argv[0]) + '_'
suffix='.txt', tmpfile = tempfile.NamedTemporaryFile(prefix=prefix, suffix='.txt',
delete=False) delete=False)
tmpfile.write((u'Summary (one line):\n%s\n\nDescription:\n%s' tmpfile.write((u'Summary (one line):\n%s\n\nDescription:\n%s'
% (subject, body)).encode('utf-8')) % (subject, body)).encode('utf-8'))