You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on my recent PR, I noticed that the request for uploading is prepared differently when debug mode is enabled. With debugging, it uses the session's prepare_request method:
I observed header differences between the two, but I can't immediately tell which is more correct, hence why I'm filing an issue rather than a PR. Note that the session.headers do get copied into the request directly inside _build_request. Changing the non-debug code to use self.session.prepare_request breaks several tests, too.
There's another case in Item.modify_metadata where the code directly contradicts the preceding comment:
While working on my recent PR, I noticed that the request for uploading is prepared differently when debug mode is enabled. With debugging, it uses the session's
prepare_request
method:internetarchive/internetarchive/item.py
Lines 1052 to 1055 in 6e23216
Without debugging, it uses the request's
prepare
method:internetarchive/internetarchive/item.py
Lines 1070 to 1071 in 6e23216
I observed header differences between the two, but I can't immediately tell which is more correct, hence why I'm filing an issue rather than a PR. Note that the
session.headers
do get copied into the request directly inside_build_request
. Changing the non-debug code to useself.session.prepare_request
breaks several tests, too.There's another case in
Item.modify_metadata
where the code directly contradicts the preceding comment:internetarchive/internetarchive/item.py
Lines 840 to 842 in 6e23216
The text was updated successfully, but these errors were encountered: