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

Working with Text Files in Python - Error: a bytes-like object is required, not 'str' #1900

Closed
jakubow opened this issue Sep 18, 2020 · 3 comments

Comments

@jakubow
Copy link

jakubow commented Sep 18, 2020

Lesson Title: Working with Text Files in Python
System: Windows
Software: Komodo Edit 12, Python 3.8.5
Steps:
I am trying to do: Creating and Writing to a Text File
I enter into Komodo:

file-output.py

f = open('helloworld.txt','wb')
f.write('hello world')
f.close()

I save the file as file-output.py
I "Run Python"

Returns the following error:
Traceback (most recent call last):
File "file-output.py", line 3, in
f.write('hello world')
TypeError: a bytes-like object is required, not 'str'

@acrymble
Copy link

Relevant earlier ticket: #1611 (this may be a mac vs pc problem)

@walshbr
Copy link
Contributor

walshbr commented Sep 18, 2020

This is a duplicate of #1777, which I think we were looking to hire a bug tester to look at?

@acrymble
Copy link

Thanks @jakubow we have someone taking a look at the matter. I hope you're able to adapt the examples as you go through in the meantime.

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

No branches or pull requests

3 participants