[Django] #35341: An error occurred while executing Python management. py. ImportError: cannot import name 'force_unicode' from 'django. utils. encoding'

2024-03-29 Thread Django
#35341: An error occurred while executing Python management. py. ImportError:
cannot import name 'force_unicode' from 'django. utils. encoding'
-+
   Reporter:  3300299472 |  Owner:  nobody
   Type:  Bug| Status:  new
  Component:  Testing framework  |Version:  4.2
   Severity:  Normal |   Keywords:
   Triage Stage:  Unreviewed |  Has patch:  0
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  1
  UI/UX:  0  |
-+
 My project is using Django version 1.11.12, but I need to modify it to
 Django 4.2.11. However, an error has occurred. Can you tell me what I
 should do?
-- 
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/0107018e8960b54e-2df97322-f8ed-4ed4-837c-a3310a938296-00%40eu-central-1.amazonses.com.


Re: [Django] #35306: Improve documentation for the various date format settings

2024-03-29 Thread Django
#35306: Improve documentation for the various date format settings
-+-
 Reporter:  Richard  |Owner:  Lufafa
 Type:   |  Joshua
  Cleanup/optimization   |   Status:  assigned
Component:   |  Version:  5.0
  Internationalization   |
 Severity:  Normal   |   Resolution:
 Keywords:  LANGUAGE_CODE,   | Triage Stage:  Accepted
  DATE_FORMAT|
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Lufafa Joshua):

 * 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/0107018e89614cfe-f9c257ad-1a86-4f49-a2e6-5535995ae6fb-00%40eu-central-1.amazonses.com.


Re: [Django] #35341: An error occurred while executing Python management. py. ImportError: cannot import name 'force_unicode' from 'django. utils. encoding'

2024-03-29 Thread Django
#35341: An error occurred while executing Python management. py. ImportError:
cannot import name 'force_unicode' from 'django. utils. encoding'
---+--
 Reporter:  3300299472 |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  4.2
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  1  |UI/UX:  0
---+--
Changes (by 3300299472):

 * Attachment "error.PNG" added.

-- 
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/0107018e89619323-cbb8efd6-27ae-4507-aa40-4e88b6fc0879-00%40eu-central-1.amazonses.com.


Re: [Django] #35341: An error occurred while executing Python management. py. ImportError: cannot import name 'force_unicode' from 'django. utils. encoding'

2024-03-29 Thread Django
#35341: An error occurred while executing Python management. py. ImportError:
cannot import name 'force_unicode' from 'django. utils. encoding'
---+--
 Reporter:  3300299472 |Owner:  nobody
 Type:  Bug|   Status:  closed
Component:  Testing framework  |  Version:  4.2
 Severity:  Normal |   Resolution:  invalid
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  1  |UI/UX:  0
---+--
Changes (by Tim Graham):

 * resolution:   => invalid
 * status:  new => closed

Comment:

 See TicketClosingReasons/UseSupportChannels.
-- 
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/0107018e89b5076a-f9d266da-478a-45ab-982f-6ad731217cbd-00%40eu-central-1.amazonses.com.


Re: [Django] #28215: sensitive_post_parameters/sensitive_variables leaking sensitive values into the http 500 exception email

2024-03-29 Thread Django
#28215: sensitive_post_parameters/sensitive_variables leaking sensitive values 
into
the http 500 exception email
-+
 Reporter:  Peter Zsoldos|Owner:  (none)
 Type:  Bug  |   Status:  new
Component:  Error reporting  |  Version:  dev
 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 Natalia Bidart):

 * easy:  0 => 1
 * has_patch:  1 => 0
 * needs_tests:  1 => 0
 * version:  1.8 => dev

-- 
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/0107018e89ffc96b-6a9d9e42-6307-44f3-b04f-33f149430793-00%40eu-central-1.amazonses.com.


Re: [Django] #32831: Some cache tests are flaky (e.g. cache.tests.BaseMemcachedTests.test_touch)

2024-03-29 Thread Django
#32831: Some cache tests are flaky (e.g. 
cache.tests.BaseMemcachedTests.test_touch)
--+
 Reporter:  Chris Jerdonek|Owner:  (none)
 Type:  Cleanup/optimization  |   Status:  new
Component:  Core (Cache system)   |  Version:  dev
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Comment (by Natalia Bidart):

 Cache flaky test in main-random:
 {{{
  > git init /home/jenkins/workspace/main-
 random/database/spatialite/label/focal/python/python3.12 # timeout=10
 ...
 Using shuffle seed: 5744808359 (generated)
 ...
 ==
 FAIL [0.004s]: test_lru_get (cache.tests.LocMemCacheTests.test_lru_get)
 --
 Traceback (most recent call last):
   File "/home/jenkins/workspace/main-
 random/database/spatialite/label/focal/python/python3.12/django/test/utils.py",
 line 446, in inner
 return func(*args, **kwargs)
^
   File "/home/jenkins/workspace/main-
 random/database/spatialite/label/focal/python/python3.12/tests/cache/tests.py",
 line 1406, in test_lru_get
 self.assertEqual(cache.get(key), key)
 AssertionError: None != 0

 --
 Ran 17769 tests in 1613.662s

 FAILED (failures=1, skipped=1160, expected failures=5)
 }}}
-- 
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/0107018e8ac310c8-e1f62106-db07-44ee-bece-8b3d1b2f80e2-00%40eu-central-1.amazonses.com.


Re: [Django] #35339: Ordering and filtering a Postgres ArrayAgg with parameters inverts SQL param order

2024-03-29 Thread Django
#35339: Ordering and filtering a Postgres ArrayAgg with parameters inverts SQL
param order
-+-
 Reporter:  Chris M  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  postgres arrayagg| Triage Stage:  Accepted
  ordering   |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Natalia Bidart):

 * cc: Mariusz Felisiak, Simon Charette (added)
 * keywords:   => postgres arrayagg ordering
 * stage:  Unreviewed => Accepted
 * type:  Uncategorized => Bug
 * version:  5.0 => dev

Comment:

 Hello Chris, thank you for your detailed report.

 I can confirm that the provided test fails in current `main` as shown
 below. Adding Simon and Mariusz as cc to see if they can provide advice on
 the

 {{{#!diff
 diff --git a/tests/postgres_tests/test_aggregates.py
 b/tests/postgres_tests/test_aggregates.py
 index 386c55da25..5ab27752d1 100644
 --- a/tests/postgres_tests/test_aggregates.py
 +++ b/tests/postgres_tests/test_aggregates.py
 @@ -12,7 +12,7 @@ from django.db.models import (
  Window,
  )
  from django.db.models.fields.json import KeyTextTransform, KeyTransform
 -from django.db.models.functions import Cast, Concat, Substr
 +from django.db.models.functions import Cast, Concat, LPad, Substr
  from django.test import skipUnlessDBFeature
  from django.test.utils import Approximate
  from django.utils import timezone
 @@ -188,6 +188,16 @@ class TestGeneralAggregate(PostgreSQLTestCase):
  )
  self.assertEqual(values, {"arrayagg": expected_output})

 +def test_array_agg_filter_and_ordering_params(self):
 +values = AggregateTestModel.objects.aggregate(
 +arrayagg=ArrayAgg(
 +"char_field",
 +filter=Q(json_field__has_key="lang"),
 +ordering=LPad(Cast("integer_field", CharField()), 2,
 Value("0")),
 +)
 +)
 +self.assertEqual(values, {"arrayagg": ["Foo2", "Foo4"]})
 +
  def test_array_agg_integerfield(self):
  values = AggregateTestModel.objects.aggregate(
  arrayagg=ArrayAgg("integer_field")
 }}}

 Full trace with `--debug-sql`:
 {{{
 ==
 ERROR: test_array_agg_filter_and_ordering_params
 
(postgres_tests.test_aggregates.TestGeneralAggregate.test_array_agg_filter_and_ordering_params)
 --
 Traceback (most recent call last):
   File "/home/nessita/fellowship/django/django/db/backends/utils.py", line
 105, in _execute
 return self.cursor.execute(sql, params)

   File "/home/nessita/.virtualenvs/djangodev/lib/python3.11/site-
 packages/psycopg/cursor.py", line 732, in execute
 raise ex.with_traceback(None)
 psycopg.errors.UndefinedFunction: function lpad(character varying,
 unknown, integer) does not exist
 LINE 1: ...s_tests_aggregatetestmodel"."char_field" ORDER BY LPAD(("pos...
  ^
 HINT:  No function matches the given name and argument types. You might
 need to add explicit type casts.

 The above exception was the direct cause of the following exception:

 Traceback (most recent call last):
 ...
   File "/home/nessita/.virtualenvs/djangodev/lib/python3.11/site-
 packages/psycopg/cursor.py", line 732, in execute
 raise ex.with_traceback(None)
 django.db.utils.ProgrammingError: function lpad(character varying,
 unknown, integer) does not exist
 LINE 1: ...s_tests_aggregatetestmodel"."char_field" ORDER BY LPAD(("pos...
  ^
 HINT:  No function matches the given name and argument types. You might
 need to add explicit type casts.

 --
 (0.000)
 SELECT ARRAY_AGG("postgres_tests_aggregatetestmodel"."char_field"
  ORDER BY
 LPAD(("postgres_tests_aggregatetestmodel"."integer_field")::varchar,
 'lang', 2)) FILTER (
 WHERE "postgres_tests_aggregatetestmodel"."json_field" ? '0') AS
 "arrayagg"
 FROM "postgres_tests_aggregatetestmodel";

 args=('lang',
   Int4(2),
   '0');

 ALIAS=DEFAULT
 }}}
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this messa

[Django] #35342: models.fields.IntegerField.to_python() is converting float type numbers, making .clean_fields( ) less reliable

2024-03-29 Thread Django
#35342: models.fields.IntegerField.to_python() is converting float type numbers,
making .clean_fields( ) less reliable
-+-
   Reporter: |  Owner:  nobody
  thiper01@… |
   Type:  Bug| Status:  new
  Component:  Database   |Version:  5.0
  layer (models, ORM)|
   Severity:  Normal |   Keywords:
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  1
  UI/UX:  0  |
-+-
 During the full_clean( ) routine, when an IntegerField is being cleaned
 and the code calls the field's to_python( ) method, if the value of the
 field is a float, it will just be converted to an integer using
 {{{int(value)}}}. As it is characteristic of python's native int( )
 function, it converts any float to int regardless of decimal places and
 approximations necessary, allowing for examples like this to happen:

 {{{
 exModel = ModelWithIntegerField(value=1.2)
 >>   exModel.value #1.2
 exModel.clean_fields() #no validation error raised
 >>   exModel.value #1
 }}}

 I don't know if this behaviour is because of ticket #24229, but I believe
 there are better ways than just allowing any number through IntegerField
 verification as long as it's a number, regardless of how it affects the
 output.

 My suggestions to improve this are:
 1# Check first if it's a float type then verify if the numbers after the
 decimal point are 0 {{{if value%1 == 0}}}, if they are, no problem
 converting, if not raise a TypeError as it would distort the original
 value without warning.
-- 
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/0107018e8c417b84-88bf72b7-8ab3-4e78-ac29-002e77a533c3-00%40eu-central-1.amazonses.com.


Re: [Django] #35342: models.fields.IntegerField.to_python() is converting float type numbers, making .clean_fields( ) less reliable

2024-03-29 Thread Django
#35342: models.fields.IntegerField.to_python() is converting float type numbers,
making .clean_fields( ) less reliable
-+-
 Reporter:  thiper01@…   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  5.0
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by thiper01@…):

 * has_patch:  0 => 1

Comment:

 https://github.com/django/django/pull/18033
-- 
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/0107018e8c4eccc9-e00ea418-e3dc-490d-b64d-449c7da37982-00%40eu-central-1.amazonses.com.


Re: [Django] #35342: models.fields.IntegerField.to_python() is converting float type numbers, making .clean_fields( ) less reliable

2024-03-29 Thread Django
#35342: models.fields.IntegerField.to_python() is converting float type numbers,
making .clean_fields( ) less reliable
-+-
 Reporter:  thiper01@…   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  5.0
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  wontfix
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by David Sanders):

 * resolution:   => wontfix
 * status:  new => closed

Comment:

 Hi there,

 The issue tracker is for reporting bugs with Django, whereas this request
 is change in known behaviour that folks may be relying upon. Please start
 a discussion on the Django forum if you strongly feel this needs to
 change: https://www.djangoproject.com/community/  If the Django community
 agrees then this ticket can be reopened.

 Closing per
 https://code.djangoproject.com/wiki/DevelopersMailingList#BeenWONTFIXed
-- 
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/0107018e8c6b2cd6-7a709fe4-4b64-494c-a4ef-752b3cfe3c41-00%40eu-central-1.amazonses.com.


Re: [Django] #35328: Improve CSRF Origin checking messaging

2024-03-29 Thread Django
#35328: Improve CSRF Origin checking messaging
--+
 Reporter:  Ryan Hiebert  |Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  assigned
Component:  CSRF  |  Version:  dev
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by Ryan Hiebert):

 * needs_better_patch:  1 => 0

-- 
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/0107018e8d5683d1-0c883757-f830-432b-9b96-d95070ae96d8-00%40eu-central-1.amazonses.com.