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

Remove charset from CONTENT_TYPE from http_charfinder.py in chapter18 #13

Open
wants to merge 5 commits into
base: master
from

Conversation

@ResolveWang
Copy link

@ResolveWang ResolveWang commented Aug 6, 2017

In the recent version of aiohttp(v2.x), the default value of charset is utf-8, if we use

CONTENT_TYPE = 'text/html; charset=UTF-8'

The code will raise the exception below

ValueError: charset must not be in content_type argument

This PR removes the charset since its default value is utf-8.

@ScottyNZ
Copy link

@ScottyNZ ScottyNZ commented Dec 30, 2017

Also, if using python 3.6+ need to change **vars(descr) to **descr._asdict()

@ramalho
Copy link
Member

@ramalho ramalho commented Dec 30, 2017

Thank you both for this contribution. I have not yet started working on a 2nd edition of Fluent Python. Almost all the issues (like this one) are related to breaking changes that happened in asyncio, which was a provisional package in Python 3.4 when I wrote the book. I have since fixed some of the asyncio examples that I use in talks or courses, only to seem them break again in the next release. So my current plan is to review your contributions only when I actually start working on the 2nd edition of the book. I appreciate your contributions and I will let you know when they are added to the new edition.

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

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.