Clarify the use of _build_opener in download_attachment
Before this change, download_attachment indirectly used _build_opener by calling
set_up_auth_cookie. This was misleading because the name of the function, set_up_auth_cookie, does not indicate that it will return a request handler object.
Since set_up_auth_cookie is only used by download_attachment, I suggest this small refactoring making download_attachment directly call _build_opener with an optional cookie handler if necessary.
This PR renames/transforms the set_up_auth_cookie function to get_auth_cookie_handler.
Clarify the use of
_build_opener
indownload_attachment
Before this change,
download_attachment
indirectly used_build_opener
by callingset_up_auth_cookie
. This was misleading because the name of the function,set_up_auth_cookie
, does not indicate that it will return a request handler object.Since
set_up_auth_cookie
is only used bydownload_attachment
, I suggest this small refactoring makingdownload_attachment
directly call_build_opener
with an optional cookie handler if necessary.This PR renames/transforms the
set_up_auth_cookie
function toget_auth_cookie_handler
.