diff options
author | Christopher Larson <kergoth@gmail.com> | 2012-05-21 16:34:49 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-05-22 14:56:16 +0100 |
commit | 532f96ddcc2e3641db25b08d4ca93ce4d196a984 (patch) | |
tree | 2ce79df367143b7e32a1574196487639d4297ec8 | |
parent | 5c880fb3018629c00783a9869bc48685d23b58b8 (diff) | |
download | ast2050-yocto-poky-532f96ddcc2e3641db25b08d4ca93ce4d196a984.zip ast2050-yocto-poky-532f96ddcc2e3641db25b08d4ca93ce4d196a984.tar.gz |
fetch2: quote/unquote url paths
This ensures we can handle things like %-encoded characters in the path
portion of urls.
(Bitbake rev: b1dbc24ebcc4e5100c32568c2c41fd982fb4bcce)
Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/bb/fetch2/__init__.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index 6cd389a..0b976c4 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py @@ -28,6 +28,7 @@ from __future__ import absolute_import from __future__ import print_function import os, re import logging +import urllib import bb.persist_data, bb.utils from bb import data @@ -147,14 +148,14 @@ def decodeurl(url): s1, s2 = s.split('=') p[s1] = s2 - return (type, host, path, user, pswd, p) + return type, host, urllib.unquote(path), user, pswd, p def encodeurl(decoded): """Encodes a URL from tokens (scheme, network location, path, user, password, parameters). """ - (type, host, path, user, pswd, p) = decoded + type, host, path, user, pswd, p = decoded if not path: raise MissingParameterError('path', "encoded from the data %s" % str(decoded)) @@ -168,7 +169,7 @@ def encodeurl(decoded): url += "@" if host and type != "file": url += "%s" % host - url += "%s" % path + url += "%s" % urllib.quote(path) if p: for parm in p: url += ";%s=%s" % (parm, p[parm]) |