Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 887109a

Browse files
committed
Minor bug fix (for not displaying heuristic detected page charset None)
1 parent ebe8ee3 commit 887109a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/request/basic.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,9 @@ def getHeuristicCharEncoding(page):
186186
"""
187187
retVal = detect(page)["encoding"]
188188

189-
infoMsg = "heuristics detected web page charset '%s'" % retVal
190-
singleTimeLogMessage(infoMsg, logging.INFO, retVal)
189+
if retVal:
190+
infoMsg = "heuristics detected web page charset '%s'" % retVal
191+
singleTimeLogMessage(infoMsg, logging.INFO, retVal)
191192

192193
return retVal
193194

0 commit comments

Comments
 (0)