slight cleaning for webserver

This commit is contained in:
ville rantanen
2018-11-20 23:00:43 +02:00
parent d8c6a73fab
commit c35fee7989
2 changed files with 14 additions and 9 deletions

View File

@@ -119,11 +119,11 @@ def add_single(conn,filename,change=False,hash=None,minsize=0,fullfile=False):
if hash==None:
hash=get_md5(filename,fullfile)
ftime=os.path.getmtime(filename)
mime=MIME.file(filename.encode('UTF-8'))
mime=MIME.file(str(filename.encode('UTF-8')))
except IOError:
print("File '%s' not found. Bad link?"%(filename,))
return
except UnicodeDecodeError:
except (UnicodeDecodeError, TypeError):
mime="NA"
if change: