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

Clarify which Python parameter is required, w or wb? #2448

Closed
anisa-hawes opened this issue Dec 16, 2021 · 3 comments · Fixed by #2450
Closed

Clarify which Python parameter is required, w or wb? #2448

anisa-hawes opened this issue Dec 16, 2021 · 3 comments · Fixed by #2450

Comments

@anisa-hawes
Copy link
Contributor

anisa-hawes commented Dec 16, 2021

Hello there @jairomelo,

I'd like to ask for your help to clarify an inconsistency across one of the lessons in our Python sequence. A reader got in touch to let us know about a mistake the EN lesson working-with-text-files. He noticed that one of the code blocks (which gives the parameter w) is followed by a textual explanation of what the parameter is doing (referencing the parameter wb). This causes confusion and seems like an error.

As I reviewed this EN lesson alongside the ES, PT and FR translations, I find that we have a mix of approaches!

Which Python parameter is required, w or wb?

Let me know if you have time to help? With your advice, I am happy to implement the changes needed.

Thank you,
Anisa

--

EN working-with-text-files
f = open('helloworld.txt','w') "The wb parameter says that you intend to write content to this new file using Python"

FR travailler-avec-des-fichiers-texte
f = open('helloworld.txt','w') "Le paramètre wb spécifie que le fichier ouvert est destiné à l’écriture (write) de contenus par Python"

ES trabajar-con-archivos-de-texto
f = open ('holamundo.txt','w') "El parámetro w indica que pretendemos escribir contenido en este nuevo archivo utilizando Python"

PT trabalhando-ficheiros-texto-python
f = open('olamundo.txt','wb') "O parâmetro wb diz que você pretende gravar conteúdo neste novo ficheiro usando Python"

@anisa-hawes
Copy link
Contributor Author

This also relates to a previous Issue, in which we updated the command = response.read() to = response.read().decode('UTF-8').

In the case of one of the other FR lessons, we discussed and decided in collaboration with @ericbrasiln that we would make an adjustment from wb to w. But I'm not sure what is best in this case?

@anisa-hawes anisa-hawes changed the title Clarify which Python command is required, w or wb? Clarify which Python parameter is required, w or wb? Dec 17, 2021
@acrymble
Copy link

This problem originated with some advice from a reader that wasn't tested fully and was implemented: #1611

@anisa-hawes
Copy link
Contributor Author

anisa-hawes commented Dec 22, 2021

Thank you, Adam. This is useful. I've read through the thread of #1611, which seems to conclude that wb is the best solution.... But I've also read a more recent thread #1777 which notes that the wb was added to avoid an error on Windows, but @jairomelo and @JoshuaGOB concluded in the end that it is best to eliminate the binary option and use w.

So, I'll update the EN, FR and PT lessons to make them consistent with the ES solution implemented with PR #1997.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants