Skip to content

Commit 25af6fb

Browse files
committed
Updated the test crawler for python3.
- Legacy-Id: 16438
1 parent a91cfa7 commit 25af6fb

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

bin/test-crawl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env python
2+
# Copyright The IETF Trust 2013-2019, All Rights Reserved
23

34
import os, sys, re, datetime, argparse, traceback, json, subprocess
45
import html5lib
@@ -62,6 +63,7 @@ import debug # pyflakes:ignore
6263

6364
from ietf.name.models import DocTypeName
6465
from ietf.utils.html import unescape
66+
from ietf.utils.test_utils import unicontent
6567

6668
# --- Constants ---
6769

@@ -387,7 +389,7 @@ if __name__ == "__main__":
387389
if ctype == "text/html":
388390
try:
389391
if args.follow and not skip_extract_from(url):
390-
for u in extract_html_urls(r.content):
392+
for u in extract_html_urls(unicontent(r)):
391393
if u not in visited and u not in urls:
392394
urls[u] = url
393395
referrers[u] = url
@@ -403,7 +405,7 @@ if __name__ == "__main__":
403405
elif ctype == "application/json":
404406
try:
405407
if args.follow:
406-
for u in extract_tastypie_urls(r.content):
408+
for u in extract_tastypie_urls(unicontent(r)):
407409
if u not in visited and u not in urls:
408410
urls[u] = url
409411
referrers[u] = url

0 commit comments

Comments
 (0)