From: Fredrik Tolf Date: Sun, 19 Mar 2017 20:00:54 +0000 (+0100) Subject: Merge branch 'master' into python2 X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=e216962e64bbfd0377511f456edc40570f8efb46;p=wrw.git Merge branch 'master' into python2 Conflicts: wrw/proto.py --- e216962e64bbfd0377511f456edc40570f8efb46 diff --cc wrw/proto.py index a67fa19,0e3c798..36a9db9 --- a/wrw/proto.py +++ b/wrw/proto.py @@@ -102,15 -103,15 +102,15 @@@ def simpleerror(env, startreq, code, ti return [buf] def urlq(url): - if isinstance(url, str): + if isinstance(url, unicode): url = url.encode("utf-8") ret = "" - invalid = ";&=#?/\"'" - invalid = b"%;&=#?/\"'" ++ invalid = "%;&=#?/\"'" for c in url: - if c in invalid or (c <= 32) or (c >= 128): - ret += "%%%02X" % c + if c in invalid or (ord(c) <= 32) or (ord(c) >= 128): + ret += "%%%02X" % ord(c) else: - ret += chr(c) + ret += c return ret class urlerror(ValueError):