Skip to content

Commit

Permalink
Back to \r not being valid whitespace, but make sure that the URL inp…
Browse files Browse the repository at this point in the history
…ut source properly normalizes line endings.
  • Loading branch information
tabatkins committed Jul 19, 2023
1 parent 248d631 commit d29f71a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bikeshed/InputSource.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def read(self) -> InputContent:
# Use the response's Date header, although servers don't always set
# this according to the last change to the file.
date = email.utils.parsedate_to_datetime(response.headers["Date"]).date()
return InputContent(response.text.splitlines(True), date)
return InputContent([x + "\n" for x in response.text.splitlines(False)], date)

def relative(self, relativePath: str) -> UrlInputSource:
return UrlInputSource(urllib.parse.urljoin(self.sourceName, relativePath))
Expand Down
2 changes: 1 addition & 1 deletion bikeshed/h/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1535,7 +1535,7 @@ def isWhitespace(ch: str | int) -> bool:
cp = ord(ch)
else:
cp = ch
return cp in (0x9, 0xA, 0xC, 0xD, 0x20)
return cp in (0x9, 0xA, 0xC, 0x20)


def isControl(ch: str | int) -> bool:
Expand Down

0 comments on commit d29f71a

Please sign in to comment.