Fix Linkchecker URL list detection.

This commit is contained in:
Bastian Kleineidam 2010-10-03 17:58:56 +02:00
parent 7a44f3d563
commit 3775f18621

View file

@ -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: