#23140 closed Bug (fixed)
page_range TypeError: sequence index must be integer, not 'slice'
Reported by: | Collin Anderson | Owned by: | nobody |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | Release blocker | Keywords: | |
Cc: | cmawebsite@… | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | yes |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
For years I've running page.paginator.page_range[:]
to make a copy of page_range. After #23088, I'm getting the error above. It might just be I'm the only one who's doing this, and should instead just call list(page.paginator.page_range)
, though it seems to me we list this in backwards incompatibilities and/or defer until 1.8.
Change History (9)
comment:1 by , 10 years ago
Severity: | Normal → Release blocker |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:3 by , 10 years ago
Component: | Uncategorized → Core (Other) |
---|---|
Type: | Uncategorized → Bug |
Version: | 1.7-rc-2 → master |
I've reverted the change on the 1.7 branch for now and changed this to a release blocker for master.
comment:5 by , 10 years ago
Needs documentation: | set |
---|
comment:6 by , 10 years ago
If we leave this in, there is also a documentation update needed as noted in #23158.
comment:7 by , 10 years ago
btw. https://github.com/django/django/commit/6508db2ff9fc5be95fec903b3fa7ab8204fe316a isn't reverted on the master branch so we should either revert it or update the ticket as closed and merge the documentation change.
Still that would be strange due to the fact that Django 1.7 wouldn't behave as Django 1.8 without any depraction
comment:8 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Consistency is now restored on master and 1.7 with 2d542bf60cc37c59872c5a20d6af3bf826038739 and 1cb919e408d943cf2fadebb2b12517f523feb718 respectively. Closing this for now as the issue should no longer appear.
comment:9 by , 10 years ago
this ticket is fixed for 1.7, so here's a new ticket for converting to an iterator in 1.8 #23190
As the instigator of this, given this has technically broken public API by changing the return type in a somewhat incompatible way (who knew that the
range
/xrange
classes don't support slicing!), I'm marking this as accepted and a release blocker, so at least attention is given to it, and a decision may be made before 1.7 final lands.Should the decision fall on the side of keeping the efficient iterator (at any time, even if postponed), it absolutely ought to end up in the backwards incompatibilities list because it doesn't quack like the same duck as one might be expecting.