From 198048c356ab84363941e7db0461ee31c6d58951 Mon Sep 17 00:00:00 2001 From: Todd Owen Date: Thu, 12 Jun 2014 12:59:09 +0800 Subject: [PATCH] Fix in pkgutil: don't call pipes.quote() on None. In this function, 'site' may be None, which will cause an exception if it is passed to pipes.quote(). --- packaging/pkgutil | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packaging/pkgutil b/packaging/pkgutil index e7d1ce7a0d6..78a7db72bf5 100644 --- a/packaging/pkgutil +++ b/packaging/pkgutil @@ -74,12 +74,10 @@ def package_installed(module, name): def package_latest(module, name, site): # Only supports one package - name = pipes.quote(name) - site = pipes.quote(site) cmd = [ 'pkgutil', '--single', '-c' ] if site is not None: - cmd += [ '-t', site ] - cmd.append(name) + cmd += [ '-t', pipes.quote(site) ] + cmd.append(pipes.quote(name)) cmd += [ '| tail -1 | grep -v SAME' ] rc, out, err = module.run_command(' '.join(cmd), use_unsafe_shell=True) if rc == 1: