Skip to content

Commit

Permalink
fix: Avoid pickling processed credentials (#1016)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsg committed May 1, 2023
1 parent 892481a commit 7935824
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion google/cloud/storage/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,11 @@ def __init__(
if project is _marker:
project = None

# Save the initial value of client_info and client_options before they
# Save the initial value of constructor arguments before they
# are passed along, for use in __reduce__ defined elsewhere.
self._initial_client_info = client_info
self._initial_client_options = client_options
self._initial_credentials = credentials

kw_args = {"client_info": client_info}

Expand Down
2 changes: 1 addition & 1 deletion google/cloud/storage/transfer_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ def _reduce_client(cl):

client_object_id = id(cl)
project = cl.project
credentials = cl._credentials
credentials = cl._initial_credentials
_http = None # Can't carry this over
client_info = cl._initial_client_info
client_options = cl._initial_client_options
Expand Down

0 comments on commit 7935824

Please sign in to comment.