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

File download error fix at staus code 201#7130

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
rohan45327 wants to merge1 commit intoscrapy:master
base:master
Choose a base branch
Loading
fromrohan45327:file-download-fix

Conversation

@rohan45327
Copy link

@rohan45327rohan45327 commentedOct 28, 2025
edited
Loading

This PR fixes a file download handling issue in the Scrapy pipeline where responses with HTTP status 201 were not being properly processed.

Changes Made

               `if response.status !=200:                        logger.warning(                           "File (code: %(status)s): Error downloading file from "                           "%(request)s referred in <%(referer)s>",                           {"status": response.status, "request": request, "referer": referer},                           extra={"spider": info.spider},                        )                       raise FileException("download-error")`

To

             `if response.status not in [200,201]:                    logger.warning(                       "File (code: %(status)s): Error downloading file from "                       "%(request)s referred in <%(referer)s>",                      {"status": response.status, "request": request, "referer": referer},                      extra={"spider": info.spider},                    )                   raise FileException("download-error")`

Result
Ensured downloaded files are stored and validated as expected.

Testing
Verified locally with multiple endpoints returning 200 and 201 responses.
Confirmed successful downloads and no runtime errors.

Please review and let me know if any improvements are needed.

@Gallaecio
Copy link
Member

Please, review the feedback from previous attempts to fix this issue.

@rohan45327
Copy link
Author

@Gallaecio
Hey ! Thanks for your review
I noticed that this issue has had multiple similar attempts in the past — most of them tried a direct fix like this one but didn’t get merged.
I’ll review those previous PRs and their feedback to understand what specific problems they encountered.

@wRAR
Copy link
Member

most of them tried a direct fix like this one but didn’t get merged.

Because people don't read the issue and assume this fix is enough.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

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

@rohan45327@Gallaecio@wRAR

[8]ページ先頭

©2009-2025 Movatter.jp