Skip to content

fix: handle UnicodeDecodeError on usernames with special characters#2899

Open
Bahtya wants to merge 1 commit intosherlock-project:masterfrom
Bahtya:fix/unicode-decode-error-usernames
Open

fix: handle UnicodeDecodeError on usernames with special characters#2899
Bahtya wants to merge 1 commit intosherlock-project:masterfrom
Bahtya:fix/unicode-decode-error-usernames

Conversation

@Bahtya
Copy link
Copy Markdown

@Bahtya Bahtya commented Apr 12, 2026

Summary

Fixes #2730

When processing usernames containing special characters (non-ASCII), Sherlock crashes with a UnicodeDecodeError. This PR wraps the username handling in proper encoding error handling.

Changes

  • Added try/except for UnicodeDecodeError when processing usernames
  • Falls back gracefully instead of crashing

Testing

  • Tested with usernames containing special characters
  • Existing tests continue to pass

Re-opens #2893 from a proper feature branch instead of fork master.

…ixes sherlock-project#2730)

Added a UnicodeError exception handler in get_response() to catch
UnicodeDecodeError and UnicodeEncodeError that can occur when the
requests library handles redirects from servers with improperly
encoded URLs. This prevents the program from crashing when scanning
usernames with special characters (e.g., 'Émile').

The fix treats these errors similarly to other connection errors,
allowing the scan to continue gracefully.

Bahtya
@Bahtya Bahtya requested a review from ppfeister as a code owner April 12, 2026 20:18
@Bahtya
Copy link
Copy Markdown
Author

Bahtya commented Apr 12, 2026

@ppfeister Friendly ping 👋 This is a resubmission of #2893 (closed) from a proper feature branch. The fix handles UnicodeDecodeError when processing usernames with special characters (fixes #2730). Would appreciate a review.

@Bahtya
Copy link
Copy Markdown
Author

Bahtya commented May 9, 2026

Hi @ppfeister, friendly ping. This fix handles UnicodeDecodeError when processing usernames with special characters. Would appreciate a review.

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.

Crash: UnicodeDecodeError on usernames with special characters

1 participant