Commits

clach04 committed abd2e2a

Fix bug that only appears in Jython 2.2(.1), 2.5.1 does not have problem

URLs such as "http://google.com"; end up with href="http://http://google.com";.
Unclear if this is a Jython bug or behavior.

Casting string to unicode avoids problem (and content should already
be Unicode). Casting to str() works BUT the content is expected to
be Unicode and thus not used in this change.

Comments (0)

Files changed (1)

python/pottymouth.py

 
 
     def handle_url(self, t):
-        if not protocol_pattern.match(t):
+        if not protocol_pattern.match(unicode(t)):
             t = Token(t.name, 'http://' + t)
 
         if self._url_check_domain and self._url_check_domain.findall(t):