From 3775f1862101312742bf5d5c4eef391294a8ed55 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Sun, 3 Oct 2010 17:58:56 +0200 Subject: [PATCH] Fix Linkchecker URL list detection. --- linkcheck/fileutil.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linkcheck/fileutil.py b/linkcheck/fileutil.py index 297aa6c0..3784c523 100644 --- a/linkcheck/fileutil.py +++ b/linkcheck/fileutil.py @@ -190,7 +190,8 @@ def guess_mimetype (filename, read=None): """Return MIME type of file, or 'application/octet-stream' if it could not be determined.""" mime, encoding = mimedb.guess_type(filename, strict=False) - if not mime and read is not None: + # Mime type text/plain can be differentiated further with content reading. + if (mime == "text/plain" or not mime) and read is not None: # try to read some content and do a poor man's file(1) # XXX replace with file(1) on Unix systems try: