@@ -1897,7 +1897,7 @@ def safeStringFormat(format_, params):
18971897 if isinstance (params , six .string_types ):
18981898 retVal = retVal .replace ("%s" , params , 1 )
18991899 elif not isListLike (params ):
1900- retVal = retVal .replace ("%s" , getText (params ), 1 )
1900+ retVal = retVal .replace ("%s" , getUnicode (params ), 1 )
19011901 else :
19021902 start , end = 0 , len (retVal )
19031903 match = re .search (r"%s(.+)%s" % (PAYLOAD_DELIMITER , PAYLOAD_DELIMITER ), retVal )
@@ -1906,7 +1906,7 @@ def safeStringFormat(format_, params):
19061906 if retVal .count ("%s" , start , end ) == len (params ):
19071907 for param in params :
19081908 index = retVal .find ("%s" , start )
1909- retVal = retVal [:index ] + getText (param ) + retVal [index + 2 :]
1909+ retVal = retVal [:index ] + getUnicode (param ) + retVal [index + 2 :]
19101910 else :
19111911 if any ('%s' in _ for _ in conf .parameters .values ()):
19121912 parts = format_ .split (' ' )
@@ -1930,6 +1930,9 @@ def safeStringFormat(format_, params):
19301930 count += 1
19311931 else :
19321932 break
1933+
1934+ retVal = getText (retVal )
1935+
19331936 return retVal
19341937
19351938def getFilteredPageContent (page , onlyText = True , split = " " ):
@@ -4115,10 +4118,10 @@ def asciifyUrl(url, forceQuote=False):
41154118 parts = _urllib .parse .urlsplit (url )
41164119 if not parts .scheme or not parts .netloc :
41174120 # apparently not an url
4118- return url
4121+ return getText ( url )
41194122
41204123 if all (char in string .printable for char in url ):
4121- return url
4124+ return getText ( url )
41224125
41234126 # idna-encode domain
41244127 try :
@@ -4160,7 +4163,7 @@ def quote(s, safe):
41604163 if port :
41614164 netloc += ':' + str (port )
41624165
4163- return _urllib .parse .urlunsplit ([parts .scheme , netloc , path , query , parts .fragment ]) or url
4166+ return getText ( _urllib .parse .urlunsplit ([parts .scheme , netloc , path , query , parts .fragment ]) or url )
41644167
41654168def isAdminFromPrivileges (privileges ):
41664169 """
@@ -4193,9 +4196,9 @@ def isAdminFromPrivileges(privileges):
41934196
41944197def findPageForms (content , url , raise_ = False , addToTargets = False ):
41954198 """
4196- Parses given page content for possible forms
4199+ Parses given page content for possible forms (Note: still not implemented for Python3)
41974200
4198- >>> findPageForms('<html><form action="/input.php" method="POST"><input type="text" name="id" value="1"><input type="submit" value="Submit"></form></html>', '')
4201+ >> findPageForms('<html><form action="/input.php" method="POST"><input type="text" name="id" value="1"><input type="submit" value="Submit"></form></html>', '')
41994202 set([(u'/input.php', 'POST', u'id=1', None, None)])
42004203 """
42014204
0 commit comments