Switch all urllib/urlparse usage to six.moves.urllib.

This provides Python 2+3 compatibility for our use of urllib.

Also add a test to avoid future regressions.
This commit is contained in:
Tim Abbott
2016-01-23 18:39:44 -08:00
parent 52f9574047
commit 6528b18ad3
15 changed files with 58 additions and 55 deletions

View File

@@ -32,7 +32,7 @@ import optparse
import os
import sys
import time
import urlparse
from six.moves import urllib
import feedparser
import zulip
@@ -169,7 +169,7 @@ client = zulip.Client(email=opts.email, api_key=opts.api_key,
first_message = True
for feed_url in feed_urls:
feed_file = os.path.join(opts.data_dir, urlparse.urlparse(feed_url).netloc)
feed_file = os.path.join(opts.data_dir, urllib.parse.urlparse(feed_url).netloc)
try:
with open(feed_file, "r") as f: