Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use https for schema URL #3

Merged
merged 2 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions ietfbib2bibtex/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ def iterate_entries(self):
response = requests.get(self.remote, timeout=5)
root = lxml.etree.fromstring(response.content)

for element in root.iter("{http://www.rfc-editor.org/rfc-index}rfc-entry"):
doc_id = element.find("{http://www.rfc-editor.org/rfc-index}doc-id").text
for element in root.iter("{https://www.rfc-editor.org/rfc-index}rfc-entry"):
doc_id = element.find("{https://www.rfc-editor.org/rfc-index}doc-id").text
if not re.match(r"RFC\d+", doc_id):
# erroneous tagging
continue
title = element.find("{http://www.rfc-editor.org/rfc-index}title").text
title = element.find("{https://www.rfc-editor.org/rfc-index}title").text
yield re.sub(
r"(RFC)0*([1-9][0-9]*)", r"\1-\2", doc_id
), pybtex.database.Entry(
Expand All @@ -72,30 +72,30 @@ def iterate_entries(self):
"type": "RFC",
"number": re.sub(r"RFC0*([1-9][0-9]*)", r"\1", doc_id),
"month": (
element.find("{http://www.rfc-editor.org/rfc-index}date")
.find("{http://www.rfc-editor.org/rfc-index}month")
element.find("{https://www.rfc-editor.org/rfc-index}date")
.find("{https://www.rfc-editor.org/rfc-index}month")
.text
),
"year": (
element.find("{http://www.rfc-editor.org/rfc-index}date")
.find("{http://www.rfc-editor.org/rfc-index}year")
element.find("{https://www.rfc-editor.org/rfc-index}date")
.find("{https://www.rfc-editor.org/rfc-index}year")
.text
),
"doi": (
element.find("{http://www.rfc-editor.org/rfc-index}doi").text
element.find("{https://www.rfc-editor.org/rfc-index}doi").text
),
# pylint: disable=consider-using-f-string
"url": "https://doi.org/{}".format(
element.find("{http://www.rfc-editor.org/rfc-index}doi").text
element.find("{https://www.rfc-editor.org/rfc-index}doi").text
),
},
persons={
"author": [
pybtex.database.Person(
e.find("{http://www.rfc-editor.org/rfc-index}name").text
e.find("{https://www.rfc-editor.org/rfc-index}name").text
)
for e in element.findall(
"{http://www.rfc-editor.org/rfc-index}author"
"{https://www.rfc-editor.org/rfc-index}author"
)
],
},
Expand Down
8 changes: 4 additions & 4 deletions tests/test_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ def test_rfcindexsource_iterate_entries(mocker, mock_config):
mocker.Mock(
return_value=mocker.Mock(
content=b"""<?xml version="1.0" encoding="UTF-8"?>
<rfc-index xmlns="http://www.rfc-editor.org/rfc-index"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.rfc-editor.org/rfc-index
http://www.rfc-editor.org/rfc-index.xsd">
<rfc-index xmlns="https://www.rfc-editor.org/rfc-index"
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://www.rfc-editor.org/rfc-index
https://www.rfc-editor.org/rfc-index.xsd">
<rfc-entry>
<doc-id>RFC0781</doc-id>
<title>Specification of the Internet Protocol (IP) timestamp option</title>
Expand Down
Loading