Skip to content

Commit

Permalink
Merge pull request #10844 from pradyunsg/accept-lowercase-doctype
Browse files Browse the repository at this point in the history
  • Loading branch information
pradyunsg authored Jan 30, 2022
2 parents 6cc96c2 + d028ae5 commit 9dec8a5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions news/10844.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Accept lowercase ``<!doctype html>`` on index pages.
2 changes: 1 addition & 1 deletion src/pip/_internal/index/collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
self.anchors: List[Dict[str, Optional[str]]] = []

def handle_decl(self, decl: str) -> None:
if decl != "DOCTYPE html":
if decl.lower() != "doctype html":
self._raise_error()
self._seen_decl = True

Expand Down
2 changes: 1 addition & 1 deletion tests/data/indexes/yanked/simple/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<body>
<a href="../../../packages/simple-1.0.tar.gz">simple-1.0.tar.gz</a>
Expand Down

0 comments on commit 9dec8a5

Please sign in to comment.