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

http.client.HTTPResponse is not playing nice (Python 3.x) #127

Closed
Milestone
@SimonSapin

Description

@SimonSapin

This gives the empty string on Python 3.x

fromurllib.clientimporturlopenhtml5lib.serialize(html5lib.parse(urlopen('http://html5lib.readthedocs.org/en/latest/')))

The cause is a bug in Python:http://bugs.python.org/issue20007 , bug given CPython’s release cycle timeline I would like to have a work-around in html5lib.

The bug is triggered here:

isUnicode=isinstance(source.read(0),text_type)

Unfortunately, the only work-around I can think of (adding a special caseif isinstance(source, http.client.HTTPResponse): isUnicode = False ) is very ugly.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp