Skip to content
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

Handle file objects like file_upload #477

Merged
merged 3 commits into from
Sep 24, 2018
Merged

Handle file objects like file_upload #477

merged 3 commits into from
Sep 24, 2018

Conversation

ob-stripe
Copy link
Contributor

r? @brandur-stripe
cc @stripe/api-libraries

Exactly like stripe/stripe-ruby#689, but for Python.

@brandur-stripe
Copy link
Contributor

LGTM!

@ob-stripe
Copy link
Contributor Author

Pushed another commit to only use files.stripe.com for file creation requests. ptal @brandur-stripe

stripe.api_base = None
yield
stripe.api_base = stripe.upload_api_base
stripe.upload_api_base = 'https://files.stripe.com'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not too familiar with the framework here, but are you sure this doesn't need to be in a finally to guarantee that these values are set back in case of an exception?

Copy link
Contributor Author

@ob-stripe ob-stripe Sep 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tested it, and it's not necessary. The framework already catches exceptions in tests and reports them as errors, and still executes the post-yield code.

@brandur-stripe
Copy link
Contributor

Left a minor comment above, but otherwise LGTM!

@ob-stripe ob-stripe merged commit 2226f47 into master Sep 24, 2018
@ob-stripe ob-stripe deleted the ob-file-resource branch September 24, 2018 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants