Document: fix content indexer, where no filename is supplied

bzr revid: p_christ@hol.gr-20100701175131-pbp7lsswuh8muyou
This commit is contained in:
P. Christeas
2010-07-01 20:51:31 +03:00
parent ad1253c96b
commit 6d64f88d55
+4 -1
View File
@@ -153,7 +153,10 @@ class contentIndex(object):
if realfname :
fname = realfname
else:
bname,ext = os.path.splitext(filename)
try:
bname,ext = os.path.splitext(filename or 'test.tmp')
except Exception:
bname, ext = filename, 'tmp'
fd, fname = tempfile.mkstemp(suffix=ext)
os.write(fd, content)
os.close(fd)