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

[Python] Fix #10948 wrong mode opened file fixed #10949

Merged
merged 1 commit into from
Mar 28, 2021
Merged

[Python] Fix #10948 wrong mode opened file fixed #10949

merged 1 commit into from
Mar 28, 2021

Conversation

goDeni
Copy link

@goDeni goDeni commented Mar 23, 2021

PR checklist

  • Read the contribution guidelines.1
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: 3.0.0 branch for changes related to OpenAPI spec 3.0. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

(details of the change, additional tests that have been done, reference to the issue for tracking, etc)

@goDeni
Copy link
Author

goDeni commented Mar 23, 2021

@kenjones-cisco please review this PR

@goDeni
Copy link
Author

goDeni commented Mar 24, 2021

I'm tired of doing dirty hacks for these methods to work
Community need this mini-fix

@HugoMario
Copy link
Contributor

Hello @goDeni,

Thanks for catching this issue and file a PR, however i think we should not replace the wb modes without leaving an option to the others 36 developers that worked on this and considered it as a valid option.

So, my propose is, add an option to the generator, and when this option is present use the w mode instead of wb. wdyt?

@goDeni
Copy link
Author

goDeni commented Mar 25, 2021

Hello @goDeni,

Thanks for catching this issue and file a PR, however i think we should not replace the wb modes without leaving an option to the others 36 developers that worked on this and considered it as a valid option.

So, my propose is, add an option to the generator, and when this option is present use the w mode instead of wb. wdyt?

Option to the generator is solve problem, but this take out implementation details

There is only one case when this method is called
is called when response_type='file' and _preload_content=True

and response.data always has str type


image

i don't see case when this method work correctly

if you can show me this case, i'll glad

@HugoMario HugoMario merged commit 4c0234e into swagger-api:master Mar 28, 2021
@goDeni goDeni deleted the issue-10948 branch March 29, 2021 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants