Re: [Django] #35395: slice filter crashes on an empty dict with Python 3.12

2024-04-24 Thread Django
#35395: slice filter crashes on an empty dict with Python 3.12
-+-
 Reporter:  Tim Richardson   |Owner:  Tim
 |  Richardson
 Type:  Bug  |   Status:  closed
Component:  Template system  |  Version:  4.2
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Sarah Boyce <42296566+sarahboyce@…>):

 * resolution:   => fixed
 * status:  assigned => closed

Comment:

 In [changeset:"e64d42e753e5c7763398d018f5ccaa95efc7588e" e64d42e]:
 {{{#!CommitTicketReference repository=""
 revision="e64d42e753e5c7763398d018f5ccaa95efc7588e"
 Fixed #35395 -- slice filter crashes on an empty dict with Python 3.12.

 Keep consistent behaviour of slice() filter between python 3.12 and prior
 versions in the case of a dict passed to the filter (catch the new to
 python
 3.12 KeyError exception).
 }}}
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018f0f4f8f55-e2a3eff6-13f6-4789-ae1c-4d49cc0c30e8-00%40eu-central-1.amazonses.com.


Re: [Django] #35395: slice filter crashes on an empty dict with Python 3.12

2024-04-24 Thread Django
#35395: slice filter crashes on an empty dict with Python 3.12
-+-
 Reporter:  Tim Richardson   |Owner:  Tim
 |  Richardson
 Type:  Bug  |   Status:  assigned
Component:  Template system  |  Version:  4.2
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Comment (by Tim Richardson):

 thanks. That was my first PR and it was a very well documented, clear and
 easy process.
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018f0f4aad1a-ab667eb7-59fb-47a4-8e15-212b347bbd16-00%40eu-central-1.amazonses.com.


Re: [Django] #35395: slice filter crashes on an empty dict with Python 3.12

2024-04-24 Thread Django
#35395: slice filter crashes on an empty dict with Python 3.12
-+-
 Reporter:  Tim Richardson   |Owner:  Tim
 |  Richardson
 Type:  Bug  |   Status:  assigned
Component:  Template system  |  Version:  4.2
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Sarah Boyce):

 * stage:  Accepted => Ready for checkin

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018f0ef1e63e-188d605a-8d0d-4bde-9de2-1b933fb8d681-00%40eu-central-1.amazonses.com.


Re: [Django] #35395: slice filter crashes on an empty dict with Python 3.12

2024-04-24 Thread Django
#35395: slice filter crashes on an empty dict with Python 3.12
-+-
 Reporter:  Tim Richardson   |Owner:  Tim
 |  Richardson
 Type:  Bug  |   Status:  assigned
Component:  Template system  |  Version:  4.2
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Comment (by Sarah Boyce):

 Hello, thank you for the PR!

 > When I submit a patch for this, is there a preferred way I can request
 that it be backported to 4.2 LTS, so at least someone considers it?

 Requesting on the ticket is fine. I have considered it, however I agree
 with Tim Graham that this doesn't qualify for a backport. 4.2 is only
 receiving security and data loss fixes.
 `slice` is also documented to be for lists
 (https://docs.djangoproject.com/en/5.0/ref/templates/builtins/#slice), so
 I agree this is unexpected usage. I think you will need to make a custom
 template filter in your code for 4.2.
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018f0eda7031-49b48bd2-45bd-4b92-b7bf-854d059a7688-00%40eu-central-1.amazonses.com.


Re: [Django] #35395: slice filter crashes on an empty dict with Python 3.12

2024-04-22 Thread Django
#35395: slice filter crashes on an empty dict with Python 3.12
-+-
 Reporter:  Tim Richardson   |Owner:  Tim
 |  Richardson
 Type:  Bug  |   Status:  assigned
Component:  Template system  |  Version:  4.2
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Comment (by Tim Richardson):

 PR link

 https://github.com/django/django/pull/18096
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018f0985a2f0-159cbfb3-4de5-4af3-b1c9-5e4e02075abf-00%40eu-central-1.amazonses.com.


Re: [Django] #35395: slice filter crashes on an empty dict with Python 3.12

2024-04-22 Thread Django
#35395: slice filter crashes on an empty dict with Python 3.12
-+-
 Reporter:  Tim Richardson   |Owner:  Tim
 |  Richardson
 Type:  Bug  |   Status:  assigned
Component:  Template system  |  Version:  4.2
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Tim Richardson):

 * has_patch:  0 => 1

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018f0980529e-910d2d3b-58f9-48e4-b55c-cfb08e1e617f-00%40eu-central-1.amazonses.com.


Re: [Django] #35395: slice filter crashes on an empty dict with Python 3.12

2024-04-22 Thread Django
#35395: slice filter crashes on an empty dict with Python 3.12
-+-
 Reporter:  Tim Richardson   |Owner:  Tim
 |  Richardson
 Type:  Bug  |   Status:  assigned
Component:  Template system  |  Version:  4.2
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Tim Richardson):

 * owner:  nobody => Tim Richardson
 * status:  new => assigned

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018f094cf208-d68fe106-3be1-4545-baf1-e968c876f225-00%40eu-central-1.amazonses.com.


Re: [Django] #35395: slice filter crashes on an empty dict with Python 3.12

2024-04-22 Thread Django
#35395: slice filter crashes on an empty dict with Python 3.12
-+
 Reporter:  Tim Richardson   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Template system  |  Version:  4.2
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+
Comment (by Tim Richardson):

 When I submit a patch for this, is there a preferred way I can request
 that it be backported to 4.2 LTS, so at least someone considers it?
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018f0948f39c-68c41457-0dd5-48d2-ad8e-f56cd5db56ba-00%40eu-central-1.amazonses.com.


Re: [Django] #35395: slice filter crashes on an empty dict with Python 3.12 (was: Python 3.12 filter bug with Django 4.2.11)

2024-04-22 Thread Django
#35395: slice filter crashes on an empty dict with Python 3.12
-+
 Reporter:  Tim Richardson   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Template system  |  Version:  4.2
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+
Changes (by Tim Graham):

 * easy:  0 => 1
 * resolution:  needsinfo =>
 * stage:  Unreviewed => Accepted
 * status:  closed => new
 * summary:  Python 3.12 filter bug with Django 4.2.11 => slice filter
 crashes on an empty dict with Python 3.12

Comment:

 Thanks. It looks like unexpected usage since slicing dictionaries doesn't
 make sense. It won't hurt to fix it, but I don't think the fix will be
 backported so you may have to work around it in your code.

 A test which passes on Python 3.11 and crashes on 3.12.
 {{{#!diff
 diff --git a/tests/template_tests/filter_tests/test_slice.py
 b/tests/template_tests/filter_tests/test_slice.py
 index 5a5dd6b155..23257b1282 100644
 --- a/tests/template_tests/filter_tests/test_slice.py
 +++ b/tests/template_tests/filter_tests/test_slice.py
 @@ -53,3 +53,6 @@ class FunctionTests(SimpleTestCase):
  def test_fail_silently(self):
  obj = object()
  self.assertEqual(slice_filter(obj, "0::2"), obj)
 +
 +def test_empty_dict(self):
 +self.assertEqual(slice_filter({}, "1"), {})
 }}}
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018f061c4dec-5dd336ff-a078-4304-be3a-ae533b9e834d-00%40eu-central-1.amazonses.com.