"""
-import sys, os, string
+import sys, os
import time, urllib
from base64 import b64encode
from urlparse import urljoin
def get_error(msg):
- if type(msg) == type(""):
+ if isinstance(msg, str):
return msg
else:
s = []
for i in msg:
- s.append("'%s'" % string.join(string.split(str(i), "\n"), "\\n"))
- return "(%s)" % string.join(s)
+ s.append("'%s'" % str(i).replace('\n', "\\n"))
+ return "(%s)" % ' '.join(s)
urllib_ftpwrapper = urllib.ftpwrapper
def __init__(self, user, passwd, host, port, dirs):
urllib_ftpwrapper.__init__(self, user, passwd, host, port, dirs)
global ftpcache_key
- ftpcache_key = (user, host, port, string.join(dirs, '/'))
+ ftpcache_key = (user, host, port, tuple(dirs))
urllib.ftpwrapper = myftpwrapper