-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Add session as optional parameter to safe_urlopen #4943
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
Conversation
mattrobenolt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see a reason to allow this. If we pass in a session explicitly, there's no point in using safe_urlopen. Just use the methods on your session directly.
|
@mattrobenolt but the methods on the session don't do what |
|
(The reason we want to pass in a session is because we pour cookies into the session cookie jar before calling this) |
|
Like what? It was intended just to be a wrapper around the I see in the related PR that you're using |
|
@mattrobenolt i thought there was a reason for it. I see that it catches and reraises errors, that it sets a default encoding to utf-8 and sets a default timeout. Obviously we can duplicate that behavior but seems like that would be easy to miss then. |
|
Original code comes from the WIP code here: #4574 |
|
Yeah, totally get what you're saying. I just don't particularly want to conflate I'd almost rather just have a |
|
Summary from chat: we should probably make the build_session thing return a Then maybe also rename |
|
Bonus points for moving as much logic as possible from |
|
Closed in favour of #4945 |
When we merge this we can close this PR
#4574
We will move it into a plugin
getsentry/sentry-plugins#135 (comment)