You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All versions after PR #2082 when flags were added to Request. (>1.4.0)
Response.follow() method not consistent with Request.init(). Missing flags.
No sure how this got missed since PR #2082 was merged, but looking at the parameters for Request.__init__ and Response.follow it appears flags wasn't added to Response.follow to keep it in line with how creating new Request instances works. I'm not sure if this was just overlooked or was intentional, when flags support was added to requests. It's also missing for the subclasses of Response as well (TextResponse will need updated, the rest currently use inheritance).
I was looking to be able to add custom flags to certain Response.follow() calls but realized looking at the source they wouldn't be carried over to the new responses, but this can easily be worked around by manually added the flag after Request creation. This seems like an easy fix to include in 1.8.1 or later but doesn't seem too high priority and I just thought you guys should know or that it should at least be noted somewhere on this repo since the docs still say, "It accepts the same arguments as Request.__init__ method...".
The text was updated successfully, but these errors were encountered:
You're right! Thanks for the report. I think this is a reasonable thing, and a good implementation should not take long to get accepted. Do you plan to submit a PR?
Yep, both Response.follow and TextResponse.follow since it looks like the only subclass that overrides that method. Sorry haven't had time to write a PR for it this weekend, been too busy to even touch my laptop.
Versions Affected:
All versions after PR #2082 when flags were added to
Request
. (>1.4.0)Response.follow() method not consistent with Request.init(). Missing
flags
.No sure how this got missed since PR #2082 was merged, but looking at the parameters for
Request.__init__
andResponse.follow
it appearsflags
wasn't added toResponse.follow
to keep it in line with how creating newRequest
instances works. I'm not sure if this was just overlooked or was intentional, whenflags
support was added to requests. It's also missing for the subclasses ofResponse
as well (TextResponse
will need updated, the rest currently use inheritance).I was looking to be able to add custom
flags
to certainResponse.follow()
calls but realized looking at the source they wouldn't be carried over to the new responses, but this can easily be worked around by manually added the flag after Request creation. This seems like an easy fix to include in 1.8.1 or later but doesn't seem too high priority and I just thought you guys should know or that it should at least be noted somewhere on this repo since the docs still say, "It accepts the same arguments asRequest.__init__
method...".The text was updated successfully, but these errors were encountered: