Skip to content

fix: check query_time instead of response_time_s list in xlsx output#2954

Open
imxde-code wants to merge 1 commit into
sherlock-project:masterfrom
imxde-code:fix/xlsx-response-time-none
Open

fix: check query_time instead of response_time_s list in xlsx output#2954
imxde-code wants to merge 1 commit into
sherlock-project:masterfrom
imxde-code:fix/xlsx-response-time-none

Conversation

@imxde-code
Copy link
Copy Markdown

Summary

Fixes #2891

The condition on line 906 checks if response_time_s is None, but response_time_s is initialised as an empty list ([]) on line 896 of the same block — so this check is always False and the empty-string fallback is never reached.

As a result, when a site's query_time is None (timeout or error), the raw None gets appended to the list. Pandas then writes None into the Excel cell instead of a blank string, which breaks downstream xlsx processing.

Root cause

# Before (line 906) — condition always False, None leaks into the list
if response_time_s is None:
    response_time_s.append("")
else:
    response_time_s.append(results[site]["status"].query_time)  # appends None

Fix

# After — checks the actual value, mirrors the CSV path (lines 875-877)
if results[site]["status"].query_time is None:
    response_time_s.append("")
else:
    response_time_s.append(results[site]["status"].query_time)

This mirrors the pattern already used correctly in the CSV output block (lines ~875–877).

Test plan

  • Run sherlock --xlsx <username> — sites that time out now produce blank cells instead of None
  • Existing tests pass

The condition `if response_time_s is None` was always False because
response_time_s is initialised as an empty list earlier in the same
block. This caused raw None values to be appended to the list for
timed-out or errored sites, which pandas then wrote as None cells in the
Excel output instead of blank strings.

Fix mirrors the correct pattern already used in the CSV output path
(lines ~875-877): check the actual query_time value before appending.

Fixes sherlock-project#2891
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: xlsx output always appends None for response_time_s when query_time is missing

1 participant