77import base64
88import datetime
99import re
10- import socket
1110import six
1211
1312from six .moves .urllib .request import Request , urlopen
2827from ietf .person .models import Person
2928from ietf .utils .log import log
3029from ietf .utils .mail import send_mail_text
30+ from ietf .utils .text import decode
3131
3232#QUEUE_URL = "https://www.rfc-editor.org/queue2.xml"
3333#INDEX_URL = "https://www.rfc-editor.org/rfc/rfc-index.xml"
@@ -45,10 +45,6 @@ def get_child_text(parent_node, tag_name):
4545 return '\n \n ' .join (text )
4646
4747
48- def fetch_queue_xml (url ):
49- socket .setdefaulttimeout (30 )
50- return urlopen (url )
51-
5248def parse_queue (response ):
5349 """Parse RFC Editor queue XML into a bunch of tuples + warnings."""
5450
@@ -234,10 +230,6 @@ def update_drafts_from_queue(drafts):
234230 return changed , warnings
235231
236232
237- def fetch_index_xml (url ):
238- socket .setdefaulttimeout (30 )
239- return urlopen (url )
240-
241233def parse_index (response ):
242234 """Parse RFC Editor index XML into a bunch of tuples."""
243235
@@ -550,7 +542,7 @@ def post_approved_draft(url, name):
550542 text = error = ""
551543 try :
552544 f = urlopen (request , data = smart_bytes (urlencode ({ 'draft' : name })), timeout = 20 )
553- text = f .read ()
545+ text = decode ( f .read () )
554546 status_code = f .getcode ()
555547 f .close ()
556548 log ("RFC-Editor notification result for draft '%s': %s:'%s'" % (name , status_code , text ))
0 commit comments