-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File objects get attribute content-type
which must be accessed through getattr
#647
Labels
Comments
Can I look into this? |
#650 I attempted to solve this issue by editing CanvasObject.set_attributes and adding some test cases. Please let me know if there is anything I need to change. |
nayanpaa
added a commit
to nayanpaa/canvasapi
that referenced
this issue
Apr 24, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: