'Encode container name so it can be used as part of the HTTP request.'

def _encode_container_name(self, name):

    if name.startswith('/'):
        name = name[1:]
    name = urlquote(name)
    if (name.find('/') != (-1)):
        raise InvalidContainerNameError(value='Container    name    cannot    contain    slashes', container_name=name, driver=self)
    if (len(name) > 256):
        raise InvalidContainerNameError(value='Container    name    cannot    be    longer    than    256    bytes', container_name=name, driver=self)
    return name
