In the attach_file method,
with open(filename, "rb") as infile:
content = infile.read()
return self.attach_content(
content,
name,
content_type,
page_id=page_id,
title=title,
space=space,
comment=comment,
)
Is there some reason that should not be
with open(filename, "rb") as infile:
return self.attach_content(
infile,
name,
content_type,
page_id=page_id,
title=title,
space=space,
comment=comment,
)
instead?