Skip to content

Commit 5d824b5

Browse files
committed
Changed some cases of urlopen() to use requests.get()
- Legacy-Id: 17374
1 parent 94e4dc7 commit 5d824b5

3 files changed

Lines changed: 4 additions & 8 deletions

File tree

ietf/bin/iana-protocols-updates

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ syslog.syslog("Updating history log with new RFC entries from IANA protocols pag
3030
# FIXME: this needs to be the date where this tool is first deployed
3131
rfc_must_published_later_than = datetime.datetime(2012, 11, 26, 0, 0, 0)
3232

33-
text = fetch_protocol_page(settings.IANA_SYNC_PROTOCOLS_URL)
33+
text = requests.get(settings.IANA_SYNC_PROTOCOLS_URL).text
3434
rfc_numbers = parse_protocol_page(text)
3535
for chunk in chunks(rfc_numbers, 100):
3636
updated = update_rfc_log_from_protocol_page(chunk, rfc_must_published_later_than)

ietf/bin/rfc-editor-index-updates

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import sys
1111
import syslog
1212
import traceback
1313

14-
from six.moves.urllib.request import urlopen
15-
1614
# boilerplate
1715
basedir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))
1816
sys.path = [ basedir ] + sys.path
@@ -49,11 +47,10 @@ log("Updating document metadata from RFC index from %s" % settings.RFC_EDITOR_IN
4947

5048

5149
socket.setdefaulttimeout(30)
52-
rfc_index_xml = urlopen(settings.RFC_EDITOR_INDEX_URL)
50+
rfc_index_xml = requests.get(settings.RFC_EDITOR_INDEX_URL).text
5351
index_data = ietf.sync.rfceditor.parse_index(rfc_index_xml)
5452

55-
rfc_errata_json = urlopen(settings.RFC_EDITOR_ERRATA_JSON_URL)
56-
errata_data = json.load(rfc_errata_json)
53+
errata_data = requests.get(settings.RFC_EDITOR_ERRATA_JSON_URL).json()
5754

5855
if len(index_data) < ietf.sync.rfceditor.MIN_INDEX_RESULTS:
5956
log("Not enough index entries, only %s" % len(index_data))

ietf/bin/rfc-editor-queue-updates

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import os
44
import socket
55
import sys
6-
from six.moves.urllib.request import urlopen
76

87
# boilerplate
98
basedir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))
@@ -21,7 +20,7 @@ from ietf.utils.log import log
2120
log("Updating RFC Editor queue states from %s" % settings.RFC_EDITOR_QUEUE_URL)
2221

2322
socket.setdefaulttimeout(30)
24-
response = urlopen(settings.RFC_EDITOR_QUEUE_URL)
23+
response = requests.get(settings.RFC_EDITOR_QUEUE_URL).text
2524
drafts, warnings = parse_queue(response)
2625
for w in warnings:
2726
log(u"Warning: %s" % w)

0 commit comments

Comments
 (0)