Skip to content

Fix filtered links leaking into URL-only results - #588

Closed
AryanRG wants to merge 1 commit into
mahmoud:masterfrom
AryanRG:fix/find-all-links-filtered-urls
Closed

AryanRG wants to merge 1 commit into
mahmoud:masterfrom
AryanRG:fix/find-all-links-filtered-urls

Conversation

@AryanRG

@AryanRG AryanRG commented Oct 17, 2026 •

Copy link
Copy Markdown

The change

Fix find_all_links() returning rejected matches as strings when with_text=False. With schemes=['https'], for example, an HTTP match previously appeared in the URL-only result instead of being filtered out. The same happened for a schemeless match when default_scheme=False. The change retains those strings only in text-preserving mode, with regression coverage for both filters and mixed accepted/rejected input.

Focused URL tests and doctests: 142 passed. The full local suite had 680 passed and two loopback-bind PermissionError failures; the same two failed on the unchanged base (676 passed). Other platforms and interpreter versions were not tested locally.

The backstory

This is my first encounter with boltons, during an exploratory correctness scout. The URL utility caught my attention because its filtering options could return plain strings where the documented URL-only mode promises URL objects; I wanted to make that behavior reliable for callers.

AI assistance

  • Harness/tooling: OpenAI Codex.
  • Model(s): GPT-6.1 Sol for investigation, patch and tests; GPT-6 Astra for an independent technical review.
  • Original prompt(s), as close to verbatim as I can manage: "Local-only correctness scout for boltons at pinned clone HEAD 4e5faa3. Check applicable repo policy, licensing, AI disclosure, contribution/issue-first gates and current upstream issues/PRs for duplicates before editing. Find at most one concrete P2/P3 behavior bug in a stable public API, small in scope, with reproducible contract evidence and no overlapping PR. Reproduce failing behavior on base, implement minimal fix and focused regression via apply_patch, run relevant tests and report exact diff/base/tests/limits. If no compelling unique bug, stop clean with evidence. No commit, fork, push, issue, PR, comment, signing, or personal representation. Preserve user files. No Kiro; no model switch unless actual cybersecurity filter." The follow-up review request asked for an independent, read-only review of the exact two-file patch, including correctness, regressions and test limits.

@AryanRG AryanRG changed the title test Fix filtered links leaking into URL-only results Oct 17, 2026
mahmoud added a commit that referenced this pull request Oct 25, 2026
…d keep IPv6 in navigate, reclassify re-registered schemes (#499, #588, #589, #489, #574)
@mahmoud

mahmoud commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Folded into #609 (see the PR description for credit). Thanks for the report and the repro.

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.

2 participants