Skip to content

Conversation

@nMaroulis
Copy link

@nMaroulis nMaroulis commented Dec 10, 2025

References:
Fixes Issue #2096

Overview:
Fixes an issue where _load_image fails on URLs containing HTTP credentials (e.g., http://user:[email protected]/image.jpg) and raises http.client.InvalidURL.

Solution:

  • Detect URLs with embedded credentials.
  • Use HTTPPasswordMgrWithDefaultRealm + HTTPBasicAuthHandler from urllib.request.
  • Strip credentials from the URL before opening.
  • Imports remain inside the function to match library style.

Test plan:
Verified that _load_image now works with:

  • Normal URLs
  • URLs with embedded credentials
  • data: URLs

@nMaroulis nMaroulis changed the title Handle URLs with embedded HTTP credentials in _load_image Fix issue #2096: Handle URLs with embedded HTTP credentials in _load_image Dec 10, 2025
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.

1 participant