def makedirs(self, path): """Creates a directory and all parent/intermediate directories.""" try: os.makedirs(path) except FileExistsError: raise errors.AlreadyExistsError(None, None, "Directory already exists")
def makedirs(self, dirname): """Creates a directory and all parent/intermediate directories.""" if self.exists(dirname): raise errors.AlreadyExistsError(None, None, "Directory already exists") client = boto3.client("s3") bucket, path = self.bucket_and_path(dirname) if not path.endswith("/"): path += "/" # This will make sure we don't override a file client.put_object(Body='', Bucket=bucket, Key=path)