Uh oh!
There was an error while loading. Please reload this page.
Make clients explicitly unpickleable. - #3230
Conversation
| """Base classes for client used to interact with Google Cloud APIs.""" | ||
| from pickle import PicklingError |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
dhermes
left a comment
There was a problem hiding this comment.
Content LGTM. Style nit in the string creation. (I would say it's a "teeny performance hit" to create a new string at every use, but that would be wrong since the string is created right before program exit.)
| """Base classes for client used to interact with Google Cloud APIs.""" | ||
| from pickle import PicklingError |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| def __getstate__(self): | ||
| """Explicitly state that clients are not pickleable.""" | ||
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| raise PicklingError('\n'.join([ | ||
| 'Pickling client objects is explicitly not supported.', | ||
| 'Clients have non-trivial state that is local and unpickleable.', | ||
| ])) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
The teeny performance hit would be to create a new string at module import for everyone else. |
dhermes
commented
Mar 28, 2017
Feel free to merge once you get CI green |
Issue caused by two unrelated PRs merging in close proximity: googleapis#3235 and googleapis#3230.
Issue caused by two unrelated PRs merging in close proximity: googleapis#3235 and googleapis#3230.
Closes#3211.