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

AddDownloaderMiddlewareManager.download_async(), deprecate returning Deferreds from downloader mws#7069

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
wRAR wants to merge10 commits intoscrapy:master
base:master
Choose a base branch
Loading
fromwRAR:downloader-mw-async
Open
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Inline MiddlewareManager._warn_spider_arg().
  • Loading branch information
@wRAR
wRAR committedOct 3, 2025
commitca65eb76cca5ef465fe2aa89f1cbaf9af7feba43
12 changes: 11 additions & 1 deletionscrapy/core/spidermw.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -438,7 +438,17 @@ async def process_start(
self, spider: Spider | None = None
) -> AsyncIterator[Any] | None:
if spider:
self._warn_spider_arg("process_start")
if self.crawler:
msg = (
"Passing a spider argument to SpiderMiddlewareManager.process_start() is deprecated"
" and the passed value is ignored."
)
else:
msg = (
"Passing a spider argument to SpiderMiddlewareManager.process_start() is deprecated,"
" SpiderMiddlewareManager should be instantiated with a Crawler instance instead."
)
warn(msg, category=ScrapyDeprecationWarning, stacklevel=2)
self._set_compat_spider(spider)
self._check_deprecated_start_requests_use()
if self._use_start_requests:
Expand Down
13 changes: 0 additions & 13 deletionsscrapy/middleware.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -84,19 +84,6 @@ def _set_compat_spider(self, spider: Spider | None) -> None:
f" {self._compat_spider} and {spider}"
)

def _warn_spider_arg(self, method_name: str) -> None:
if self.crawler:
msg = (
f"Passing a spider argument to {type(self).__name__}.{method_name}() is deprecated"
" and the passed value is ignored."
)
else:
msg = (
f"Passing a spider argument to {type(self).__name__}.{method_name}() is deprecated,"
f" {type(self).__name__} should be instantiated with a Crawler instance instead."
)
warnings.warn(msg, category=ScrapyDeprecationWarning, stacklevel=3)

@classmethod
@abstractmethod
def _get_mwlist_from_settings(cls, settings: Settings) -> list[Any]:
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp