File objects get attribute content-type
which must be accessed through getattr
#647
Labels
content-type
which must be accessed through getattr
#647
Describe the bug
File objects get attribute
content-type
which must be accessed throughgetattr
. All other attributes can be accessed bysome_file.attribute
, but due to the-
that doesn't work for thecontent-type
attribute.To Reproduce
Steps to reproduce the behavior:
Get an attachment from a submission (
submission.attachments
). Then one must usegetattr(attachment, "content-type")
to get the content type. But one can accessattachment.filename
by dot notation.Expected behavior
I would expect the
content-type
attribute to be translated tocontent_type
.Environment information
python --version
): Python 3.10.12pip show canvasapi
):Additional context
Probably adding a translation of
-
to_
inCanvasObject.set_attributes
should suffice. Not sure if this would break anything.The text was updated successfully, but these errors were encountered: