Skip to content

AttributeError: 'NoneType' object has no attribute 'read' #11

Description

@huaijiao

大文件下载时,用stream=True会报错
response = requests_go.get(url=url, headers=headers, tls_config=tls,stream=True)
with open("1.jpg", 'wb') as f:
for chunk in response.iter_content(chunk_size=1024):
if chunk:
f.write(chunk)

File "C:\Users\Administrator\Anaconda3\lib\site-packages\requests\models.py",
line 828, in generate
chunk = self.raw.read(chunk_size)
AttributeError: 'NoneType' object has no attribute 'read'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions