Skip to content

fix: add support for Scrapy 2.20 - #1242

Merged
vdusek merged 3 commits into
masterfrom
fix/scrapy-w3lib-26-url-normalization
Nov 9, 2026
Merged

vdusek merged 3 commits into
masterfrom
fix/scrapy-w3lib-26-url-normalization

Conversation

@vdusek

@vdusek vdusek commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Bumps the lock file to Scrapy 2.20.0 and w3lib 2.6.0, which #1241 held back because they broke the Scrapy unit tests.

Scrapy 2.20 deprecates Headers.to_unicode_dict(), which to_apify_request called for every enqueued request. The headers are now decoded straight from Headers.items(), which works the same on every supported Scrapy version (2.14 and up) and raises no warning. Decoding stays strict, so non-UTF-8 headers still fall back to the serialized request. to_tuple_list() would turn them into U+FFFD characters instead.

w3lib 2.6 adds a trailing slash to URLs with an empty path (https://example.com becomes https://example.com/). Unique keys are unaffected because Crawlee strips that slash when computing them, so only tests asserting exact root URLs failed. They now use the trailing-slash form, which both w3lib versions leave unchanged.

Unit tests pass on Scrapy 2.20.0, 2.19.0, and 2.14.0.

✍️ Drafted by Claude Code

@vdusek vdusek added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Nov 9, 2026
@vdusek vdusek self-assigned this Nov 9, 2026
@codecov

codecov Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.84%. Comparing base (90184ed) to head (c4e5beb).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1242   +/-   ##
=======================================
  Coverage   93.84%   93.84%           
=======================================
  Files          54       54           
  Lines        3801     3803    +2     
=======================================
+ Hits         3567     3569    +2     
  Misses        234      234           
Flag Coverage Δ
e2e 31.44% <0.00%> (-0.02%) ⬇️
integration 51.35% <0.00%> (-0.03%) ⬇️
unit 91.03% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdusek vdusek changed the title fix: support Scrapy 2.20 fix: add support for Scrapy 2.20 Nov 9, 2026
@vdusek
vdusek marked this pull request as ready for review November 9, 2026 07:13
@vdusek
vdusek requested a review from Mantisus November 9, 2026 07:13
@apify-service-account apify-service-account added the tested Temporary label used only programatically for some analytics. label Nov 9, 2026

@Mantisus Mantisus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@apify-approval-mirror apify-approval-mirror Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mirroring approval from @Mantisus.

@vdusek
vdusek merged commit b7a6165 into master Nov 9, 2026
37 checks passed
@vdusek
vdusek deleted the fix/scrapy-w3lib-26-url-normalization branch November 9, 2026 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants