From 4d3f3fbf8d6b610e35204dc399c3e77cfbf2966a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 1 Jan 2009 18:53:37 -0800 Subject: [PATCH] Fix #1518 (bad temporary file handling during manpage creation) --- src/calibre/linux.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/calibre/linux.py b/src/calibre/linux.py index 296024c251..224e301562 100644 --- a/src/calibre/linux.py +++ b/src/calibre/linux.py @@ -2,10 +2,10 @@ __license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal ' ''' Post installation script for linux ''' import sys, os, re, shutil - from subprocess import check_call, call -from calibre import __version__, __appname__ +from tempfile import NamedTemporaryFile +from calibre import __version__, __appname__ from calibre.devices import devices DEVICES = devices() @@ -401,9 +401,9 @@ def install_man_pages(fatal_errors): import subprocess print 'Installing MAN pages...' manpath = '/usr/share/man/man1' - f = open_file('/tmp/man_extra', 'wb') + f = NamedTemporaryFile() f.write('[see also]\nhttp://%s.kovidgoyal.net\n'%__appname__) - f.close() + f.flush() manifest = [] os.environ['PATH'] += ':'+os.path.expanduser('~/bin') for src in entry_points['console_scripts']: