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

TypeError: write() argument must be str, not dict #25

Closed
hyfc opened this issue Jun 20, 2017 · 1 comment
Closed

TypeError: write() argument must be str, not dict #25

hyfc opened this issue Jun 20, 2017 · 1 comment

Comments

@hyfc
Copy link
Contributor

hyfc commented Jun 20, 2017

When I ran the Usage code in README.md, a TypeError occured which refers to this line :
await f.write(self.results)
Then I changed this line to await f.write(self.results['title']) and everything works just fine.
I noticed that in previous edition of this README file, when aiofile was not introduced, this part of code used this dict self.results the same way. So I'm not sure which is the right way to print the result.

@elliotgao2
Copy link
Owner

Use await f.write(self.results['title']) or await f.write(str(self.results)). I have updated the example.

@hyfc hyfc closed this as completed Jun 21, 2017
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

2 participants