Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Dec 2, 2021. It is now read-only.

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

Open
ResolveWang wants to merge5 commits intofluentpython:master
base:master
Choose a base branch
Loading
fromResolveWang:master

Conversation

ResolveWang
Copy link

In the recent version of aiohttp(v2.x), the default value of charset isutf-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.

velimir, ScottyNZ, and ResolveWang reacted with thumbs up emoji
@ScottyNZ
Copy link

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

@ramalho
Copy link
Member

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.

ResolveWang and cdpath reacted with thumbs up emoji

Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@ResolveWang@ScottyNZ@ramalho

[8]ページ先頭

©2009-2025 Movatter.jp