Minor just in case patch (to prevent junk reports)

This commit is contained in:
Miroslav Stampar
2018-01-15 09:48:07 +01:00
parent f6738adc04
commit a59198d1e4
3 changed files with 4 additions and 4 deletions

View File

@@ -218,7 +218,7 @@ def checkCharEncoding(encoding, warn=True):
try:
codecs.lookup(encoding.encode(UNICODE_ENCODING) if isinstance(encoding, unicode) else encoding)
except (LookupError, ValueError):
if warn:
if warn and ' ' not in encoding:
warnMsg = "unknown web page charset '%s'. " % encoding
warnMsg += "Please report by e-mail to '%s'" % DEV_EMAIL_ADDRESS
singleTimeLogMessage(warnMsg, logging.WARN, encoding)