Description
In sherlock.py, the --xlsx output path has a logic bug when building the response_time_s list. The condition checks if response_time_s is None, but response_time_s is initialized as an empty list ([]) earlier in the same block — so this check is always False and the empty string fallback is never used.
This means that when a site's query_time is None (e.g. timed-out or errored requests), the raw None value gets appended to the list instead of "". When pandas then writes this to Excel, the cell contains None rather than a blank, which can cause downstream issues when processing the xlsx output.
Steps to reproduce
Run sherlock with --xlsx on a username. Sites that fail to respond (timeout/error) will have None in the response_time_s column instead of an empty string.
Root cause
# Line ~912 in sherlock.py
if response_time_s is None: # BUG: response_time_s is a list, never None
response_time_s.append("")
else:
response_time_s.append(results[site]["status"].query_time) # appends None
Compare with the CSV block just above it (lines ~882-884), which correctly does:
response_time_s = results[site]["status"].query_time
if response_time_s is None:
response_time_s = ""
Fix
Change the condition to check the actual value:
if results[site]["status"].query_time is None:
response_time_s.append("")
else:
response_time_s.append(results[site]["status"].query_time)
Description
In
sherlock.py, the--xlsxoutput path has a logic bug when building theresponse_time_slist. The condition checksif response_time_s is None, butresponse_time_sis initialized as an empty list ([]) earlier in the same block — so this check is alwaysFalseand the empty string fallback is never used.This means that when a site's
query_timeisNone(e.g. timed-out or errored requests), the rawNonevalue gets appended to the list instead of"". When pandas then writes this to Excel, the cell containsNonerather than a blank, which can cause downstream issues when processing the xlsx output.Steps to reproduce
Run sherlock with
--xlsxon a username. Sites that fail to respond (timeout/error) will haveNonein theresponse_time_scolumn instead of an empty string.Root cause
Compare with the CSV block just above it (lines ~882-884), which correctly does:
Fix
Change the condition to check the actual value: