From: Oleg Broytman Date: Tue, 12 Jul 2011 15:18:10 +0000 (+0000) Subject: Do not split/decode query and tag - only split host and path and recode the host. X-Git-Tag: v4.5.3~37 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=6eae6e394f44a55e5be10aa59408bdf76d0af9e0;p=bookmarks_db.git Do not split/decode query and tag - only split host and path and recode the host. git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@339 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23 --- diff --git a/bkmk_objects.py b/bkmk_objects.py index be139ed..281b95c 100644 --- a/bkmk_objects.py +++ b/bkmk_objects.py @@ -67,13 +67,6 @@ class Bookmark: user, password = urllib.splitpasswd(user) host, port = urllib.splitport(host) if port: port = int(port) - path, tag = urllib.splittag(path) - path, query = urllib.splitquery(path) - path = urllib.unquote(path) - if tag: tag = urllib.unquote_plus(tag) - - if host: # host can be None for Mozilla's place: URLs - host = host.decode(parser_charset or 'utf-8').encode('idna') href = protocol + "://" if user: @@ -82,18 +75,11 @@ class Bookmark: href += ':' + urllib.quote(password) href += '@' if host: - href += host + href += host.decode(parser_charset or 'utf-8').encode('idna') if port: href += ':%d' % port if path: - if protocol == "file": - href += urllib.quote(path) - else: - href += urllib.quote(path) - if query: - href += '?' + query - if tag: - href += '#' + urllib.quote_plus(tag) + href += path self.href = href self.add_date = add_date