Re: [Django] #34486: SearchVector.as_sql causes AttributeError

2023-04-11 Thread Django
#34486: SearchVector.as_sql causes AttributeError
--+--
 Reporter:  Scott Macpherson  |Owner:  (none)
 Type:  Bug   |   Status:  new
Component:  contrib.postgres  |  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:  0 |UI/UX:  0
--+--

Comment (by Scott Macpherson):

 That commit does indeed resolve this issue. While checking that out I
 discovered that SearchHeadline.as_sql suffers from the same issue. Should
 I log a separate bug for that?

-- 
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/0107018773d0bb3f-65a6da2d-6ce1-4e5b-a4a7-4dcb899aec66-00%40eu-central-1.amazonses.com.


Re: [Django] #34486: SearchVector.as_sql causes AttributeError

2023-04-11 Thread Django
#34486: SearchVector.as_sql causes AttributeError
--+--
 Reporter:  Scott Macpherson  |Owner:  (none)
 Type:  Bug   |   Status:  new
Component:  contrib.postgres  |  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:  0 |UI/UX:  0
--+--
Changes (by Tim Graham):

 * type:  Uncategorized => Bug


Comment:

 I guess it's fixed by 4bf4222010fd8e413963c6c873e4088614332ef9 which
 removed `compose_sql()`?

-- 
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/010701877385a924-fcf58d50-fe4e-4550-ae75-e4ada49bc300-00%40eu-central-1.amazonses.com.


Re: [Django] #34486: SearchVector.as_sql causes AttributeError

2023-04-11 Thread Django
#34486: SearchVector.as_sql causes AttributeError
--+--
 Reporter:  Scott Macpherson  |Owner:  (none)
 Type:  Uncategorized |   Status:  new
Component:  contrib.postgres  |  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:  0 |UI/UX:  0
--+--
Changes (by Scott Macpherson):

 * Attachment "traceback.txt" added.

 Traceback

-- 
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/01070187734474d3-aaeefd61-2484-4665-af46-77b8367dd0d3-00%40eu-central-1.amazonses.com.


[Django] #34486: SearchVector.as_sql causes AttributeError

2023-04-11 Thread Django
#34486: SearchVector.as_sql causes AttributeError
+
   Reporter:  Scott Macpherson  |  Owner:  (none)
   Type:  Uncategorized | Status:  new
  Component:  contrib.postgres  |Version:  4.2
   Severity:  Normal|   Keywords:
   Triage Stage:  Unreviewed|  Has patch:  0
Needs documentation:  0 |Needs tests:  0
Patch needs improvement:  0 |  Easy pickings:  0
  UI/UX:  0 |
+
 Following an upgrade to Django 4.2 and psycopg3, any use of SearchVector
 has started returning AttributeError "'NoneType' object has no attribute
 'pgconn'".

 It seems to be because the instance of DatabaseWrapper passed in to as_sql
 doesn't have a connection: DatabaseOperations.compose_sql calls mogrify,
 which in turn calls .connection on the DatabaseWrapper, which returns
 NoneType.

 I've verified that calling connection.connect() in search.py immediately
 before the compose_sql line resolves this, but I don't know nearly enough
 to know if this is the real root problem, or where in the stack the
 connection is supposed to be created if it is.

-- 
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/0107018773440872-4e02c6cd-a66f-430d-8974-e5916dcb936b-00%40eu-central-1.amazonses.com.


Re: [Django] #34485: Update examples by using f-strings instead of %

2023-04-11 Thread Django
#34485: Update examples by using f-strings instead of %
-+-
 Reporter:  Pravesh Aryal|Owner:  nobody
 Type:   |   Status:  closed
  Cleanup/optimization   |
Component:  Documentation|  Version:  dev
 Severity:  Normal   |   Resolution:  duplicate
 Keywords:  documentation,   | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by David Smith):

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


Comment:

 This seems to me like a duicate of #33034

-- 
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/01070187723cfd1b-6bf22485-1e89-4bbc-bc94-58ee73a77d0a-00%40eu-central-1.amazonses.com.


Re: [Django] #34482: Unable to access "non-picklable" attributes of empty HttpRequest and HttpResponse objects after shallow copy.

2023-04-11 Thread Django
#34482: Unable to access "non-picklable" attributes of empty HttpRequest and
HttpResponse objects after shallow copy.
-+-
 Reporter:  Anvesh Mishra|Owner:  Anvesh Mishra
 Type:  Bug  |   Status:  assigned
Component:  HTTP handling|  Version:  4.2
 Severity:  Release blocker  |   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 Anvesh Mishra):

 Created the required [https://github.com/django/django/pull/16753 PR]. I
 don't know if this patch will work as Adam pointed out various
 possibilities that can occur in his
 [https://code.djangoproject.com/ticket/34484 comments on this ticket].
 Didn't add the regression tests yet due to the regressions added in
 d7f5bfd241666c0a76e90208da1e9ef81aec44db and
 6220c445c40a6a7f4d442de8bde2628346153963. Maybe we could add regressions
 for `WSGIRequest` and `ASGIRequest` as pointed out by
 [https://code.djangoproject.com/ticket/34484#comment:2 Adam Jhonson in
 this comment].

-- 
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/010701877216f61d-9fd17642-68b9-42ed-81f5-15914e8e5075-00%40eu-central-1.amazonses.com.


Re: [Django] #34485: Update examples by using f-strings instead of %

2023-04-11 Thread Django
#34485: Update examples by using f-strings instead of %
-+-
 Reporter:  krishnassecla|Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Documentation|  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:  documentation,   | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by krishnassecla):

 * Attachment "Screenshot from 2023-04-12 02-01-13.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/0107018771f67803-a239463a-697f-4ee4-a66d-f8ed1add99f4-00%40eu-central-1.amazonses.com.


[Django] #34485: Update examples by using f-strings instead of %

2023-04-11 Thread Django
#34485: Update examples by using f-strings instead of %
-+-
   Reporter: |  Owner:  nobody
  krishnassecla  |
   Type: | Status:  new
  Cleanup/optimization   |
  Component: |Version:  dev
  Documentation  |
   Severity:  Normal |   Keywords:  documentation,
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  1
  UI/UX:  0  |
-+-
 The page
 https://docs.djangoproject.com/en/4.2/topics/db/examples/one_to_one/ has
 examples with __str__ methods using older python % instead of newer and
 pythonic f-strings.

-- 
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/0107018771f5c7f0-695d1b74-2474-4fb6-8715-c504962c4285-00%40eu-central-1.amazonses.com.


Re: [Django] #34482: Unable to access "non-picklable" attributes of empty HttpRequest and HttpResponse objects after shallow copy.

2023-04-11 Thread Django
#34482: Unable to access "non-picklable" attributes of empty HttpRequest and
HttpResponse objects after shallow copy.
-+-
 Reporter:  Anvesh Mishra|Owner:  Anvesh Mishra
 Type:  Bug  |   Status:  assigned
Component:  HTTP handling|  Version:  4.2
 Severity:  Release blocker  |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Description changed by Anvesh Mishra:

Old description:

> Trying to access the non-picklable attributes of `HttpRequest` object
> after shallow copy leads to an `AttributeError`.
> Example:
>
> {{{
> request = HttpRequest()
> request_copy = copy(request)
> match = request_copy.resolver_match
>
> AttributeError: 'WSGIRequest' object has no attribute 'resolver_match'
> }}}

New description:

 Trying to access the non-picklable attributes of `HttpRequest` and
 `HttpResponse`object after shallow copy leads to an `AttributeError`.
 Example:

 {{{
 request = HttpRequest()
 request_copy = copy(request)
 match = request_copy.resolver_match

 AttributeError: 'WSGIRequest' object has no attribute 'resolver_match'
 }}}

--

-- 
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/0107018771b120b4-b7663aa3-e591-4c8c-9357-64130865fa18-00%40eu-central-1.amazonses.com.


Re: [Django] #34484: HttpRequest.__deepcopy__ doesn't deepcopy attributes

2023-04-11 Thread Django
#34484: HttpRequest.__deepcopy__ doesn't deepcopy attributes
-+--
 Reporter:  Adam Johnson |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  HTTP handling|  Version:  4.2
 Severity:  Release blocker  |   Resolution:
 Keywords:   | Triage Stage:  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--

Comment (by Adam Johnson):

 Maybe...

 On the HttpResponse change, it does seem quite hacky to have HttpResponse
 know about the attributes the test client adds and remove them at pickle
 time. It will cause issues in tests that end up copying responses and
 expect the attributes to still exist.

 There are definitely tests out there that make requests within setUp and
 store the responses for assertions within actual test methods - this is a
 pattern that Will Vincent promotes in his books... The issue will occur if
 such a test is converted to use setUpTestData, which can easily happen
 since it's promoted for speed.

-- 
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/01070187719b1bd6-f7f9efe0-63cc-4430-971d-8fb919722491-00%40eu-central-1.amazonses.com.


Re: [Django] #34484: HttpRequest.__deepcopy__ doesn't deepcopy attributes

2023-04-11 Thread Django
#34484: HttpRequest.__deepcopy__ doesn't deepcopy attributes
-+--
 Reporter:  Adam Johnson |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  HTTP handling|  Version:  4.2
 Severity:  Release blocker  |   Resolution:
 Keywords:   | Triage Stage:  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--

Comment (by Mariusz Felisiak):

 Adam, Would you like to revert both?
 (d7f5bfd241666c0a76e90208da1e9ef81aec44db and
 6220c445c40a6a7f4d442de8bde2628346153963.)

-- 
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/01070187717ce08e-4ed8c227-7049-4490-ab3b-f361bc560a0e-00%40eu-central-1.amazonses.com.


Re: [Django] #34483: Negative result of django.utils.timesince.timesince

2023-04-11 Thread Django
#34483: Negative result of django.utils.timesince.timesince
-+
 Reporter:  Lorenzo Peña |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Utilities|  Version:  4.2
 Severity:  Release blocker  |   Resolution:
 Keywords:  timesince| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+
Changes (by Mariusz Felisiak):

 * cc: GianpaoloBranca (added)
 * severity:  Normal => Release blocker
 * stage:  Unreviewed => Accepted


Comment:

 Thanks for the report.

 Regression in 8d67e16493c903adc9d049141028bc0fff43f8c8.
 Reproduced at 3b4728310a7a64f8fcc548163b0aa5f98a5c78f5.

-- 
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/0107018770f73d0f-9355100c-5c53-4d1c-8551-18aa373e24f4-00%40eu-central-1.amazonses.com.


Re: [Django] #30386: Admin foreign key widgets don't quote keys.

2023-04-11 Thread Django
#30386: Admin foreign key widgets don't quote keys.
-+-
 Reporter:  Joshua Goodwin   |Owner:
 |  Oluwayemisi Ismail
 Type:  Bug  |   Status:  assigned
Component:  contrib.admin|  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 Yhemisi):

 * 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/0107018770d6bd63-17ec6448-f498-49a8-8e15-a4d26f4a53f3-00%40eu-central-1.amazonses.com.


Re: [Django] #34482: Unable to access "non-picklable" attributes of empty HttpRequest and HttpResponse objects after shallow copy.

2023-04-11 Thread Django
#34482: Unable to access "non-picklable" attributes of empty HttpRequest and
HttpResponse objects after shallow copy.
-+-
 Reporter:  Anvesh Mishra|Owner:  Anvesh Mishra
 Type:  Bug  |   Status:  assigned
Component:  HTTP handling|  Version:  4.2
 Severity:  Release blocker  |   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 Adam Johnson):

 I opened #34484 for a report due to a related failure caused by the same
 patch.

-- 
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/0107018770d29d72-d1a74c7b-9008-4ec3-87dd-087eeedbe281-00%40eu-central-1.amazonses.com.


Re: [Django] #34484: HttpRequest.__deepcopy__ doesn't deepcopy attributes

2023-04-11 Thread Django
#34484: HttpRequest.__deepcopy__ doesn't deepcopy attributes
-+--
 Reporter:  Adam Johnson |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  HTTP handling|  Version:  4.2
 Severity:  Release blocker  |   Resolution:
 Keywords:   | Triage Stage:  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--

Comment (by Adam Johnson):

 I think there are a couple of issues in the original patch, which is why
 we have two tickets:

 (1) `__getstate__` completely drops attributes, so unpickled request
 objects end up missing attributes, hence #34482. Dropping attributes
 entirely in `__getstate__` should only be done where the interface of the
 class works with a missing private attribute, otherwise unpickling is
 broken.

 (2) `__deepcopy__` performs a shallow copy of the object, hence this
 ticket. It looks like this was added after
 [https://github.com/django/django/pull/15937#issuecomment-1217486491 this
 comment from Mariusz] during review, in order to fix test failures. I
 think in reality the failures were exposing problems in the `__getstate__`
 implementation, and adding a `__deepcopy__` only papered over them.

 I reproduced the failure Mariusz talked about in that comment, by removing
 `__deepcopy__`:

 {{{
 ==
 ERROR: test_password_reset_change_view
 (auth_tests.test_templates.AuthTemplateTests.test_password_reset_change_view)
 --
 Traceback (most recent call last):
 ...
   File
 "/Users/chainz/Documents/Projects/django/tests/auth_tests/test_templates.py",
 line 115, in test_password_reset_change_view
 response =
 PasswordChangeView.as_view(success_url="dummy/")(self.request)
 ^
 ...
 csrf_secret = request.COOKIES[settings.CSRF_COOKIE_NAME]
 ^
   File
 "/Users/chainz/Documents/Projects/django/django/utils/functional.py", line
 57, in __get__
 res = instance.__dict__[self.name] = self.func(instance)
 ^
   File
 "/Users/chainz/Documents/Projects/django/django/core/handlers/wsgi.py",
 line 111, in COOKIES
 raw_cookie = get_str_from_wsgi(self.environ, "HTTP_COOKIE", "")
 ^
 AttributeError: 'WSGIRequest' object has no attribute 'environ'
 }}}

 A missing attribute is exactly the problem as in (1).


 I lean towards reverting the patch, and then working on a new one. This
 stuff is hard to get right, and it would be better to work on it calmly
 rather than rushing through a fix. I'll also note the patch also missed
 tests for `WSGIRequest` and `ASGIRequest`.

-- 
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/0107018770d20805-b955b5c2-da1c-4fd3-b667-92b5a1543a9c-00%40eu-central-1.amazonses.com.


Re: [Django] #34484: HttpRequest.__deepcopy__ doesn't deepcopy attributes

2023-04-11 Thread Django
#34484: HttpRequest.__deepcopy__ doesn't deepcopy attributes
-+--
 Reporter:  Adam Johnson |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  HTTP handling|  Version:  4.2
 Severity:  Release blocker  |   Resolution:
 Keywords:   | Triage Stage:  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--
Description changed by Adam Johnson:

Old description:

> Regression in Django 4.2. Deepcopying a HttpRequest no longer deepcopies
> its attributes, including attached ones like `session`.
>
> Leads to test pollution where a request is created in setUpTestData, for
> example:
>
> {{{
> from django.test import TestCase
> from django.test import RequestFactory
>

> class ExampleTests(TestCase):
> @classmethod
> def setUpTestData(cls):
> cls.request = RequestFactory().get("/")
> cls.request.session = {}
>
> def test_adding(self):
> self.request.session["foo"] = 1
> self.assertEqual(self.request.session, {"foo": 1})
>
> def test_looking(self):
> self.assertEqual(self.request.session, {})
> }}}
>
> (Simplified from a real test suite.)
>
> Bisected to #29186 / 6220c445c40a6a7f4d442de8bde2628346153963, using
> these commands to run the above test case:
>
> {{{
> git bisect start facc153af7 ff8e5eacda
> git bisect run sh -c 'cd tests && ./runtests.py test_regression -v 2'
> }}}
>
> I see #34482 was also just opened as a regression from that same ticket.

New description:

 Regression in Django 4.2. Deepcopying a HttpRequest no longer deepcopies
 its attributes, including attached ones like `session`.

 Leads to test pollution where a request is created in setUpTestData, for
 example:

 {{{
 from django.test import TestCase
 from django.test import RequestFactory


 class ExampleTests(TestCase):
 @classmethod
 def setUpTestData(cls):
 cls.request = RequestFactory().get("/")
 cls.request.session = {}

 def test_adding(self):
 self.request.session["foo"] = 1
 self.assertEqual(self.request.session, {"foo": 1})

 def test_looking(self):
 self.assertEqual(self.request.session, {})
 }}}

 Leading to:

 {{{
 test_adding (test_regression.ExampleTests.test_adding) ... ok
 test_looking (test_regression.ExampleTests.test_looking) ... FAIL

 ==
 FAIL: test_looking (test_regression.ExampleTests.test_looking)
 --
 Traceback (most recent call last):
   File "/Users/chainz/Documents/Projects/django/tests/test_regression.py",
 line 16, in test_looking
 self.assertEqual(self.request.session, {})
 AssertionError: {'foo': 1} != {}
 - {'foo': 1}
 + {}
 }}}

 (Simplified from a real test suite.)

 Bisected to #29186 / 6220c445c40a6a7f4d442de8bde2628346153963, using these
 commands to run the above test case:

 {{{
 git bisect start facc153af7 ff8e5eacda
 git bisect run sh -c 'cd tests && ./runtests.py test_regression -v 2'
 }}}

 I see #34482 was also just opened as a regression from that same ticket.

--

-- 
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/0107018770c86b41-ede4f44d-4cdb-425c-8c92-78dcab8a5118-00%40eu-central-1.amazonses.com.


[Django] #34484: HttpRequest.__deepcopy__ doesn't deepcopy attributes

2023-04-11 Thread Django
#34484: HttpRequest.__deepcopy__ doesn't deepcopy attributes
---+
   Reporter:  Adam Johnson |  Owner:  nobody
   Type:  Bug  | Status:  new
  Component:  HTTP handling|Version:  4.2
   Severity:  Release blocker  |   Keywords:
   Triage Stage:  Unreviewed   |  Has patch:  0
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
  UI/UX:  0|
---+
 Regression in Django 4.2. Deepcopying a HttpRequest no longer deepcopies
 its attributes, including attached ones like `session`.

 Leads to test pollution where a request is created in setUpTestData, for
 example:

 {{{
 from django.test import TestCase
 from django.test import RequestFactory


 class ExampleTests(TestCase):
 @classmethod
 def setUpTestData(cls):
 cls.request = RequestFactory().get("/")
 cls.request.session = {}

 def test_adding(self):
 self.request.session["foo"] = 1
 self.assertEqual(self.request.session, {"foo": 1})

 def test_looking(self):
 self.assertEqual(self.request.session, {})
 }}}

 (Simplified from a real test suite.)

 Bisected to #29186 / 6220c445c40a6a7f4d442de8bde2628346153963, using these
 commands to run the above test case:

 {{{
 git bisect start facc153af7 ff8e5eacda
 git bisect run sh -c 'cd tests && ./runtests.py test_regression -v 2'
 }}}

 I see #34482 was also just opened as a regression from that same ticket.

-- 
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/0107018770b57f5c-e1da0687-bb2a-4403-bf0d-ed8df82985b3-00%40eu-central-1.amazonses.com.


[Django] #34483: Negative result of django.utils.timesince.timesince

2023-04-11 Thread Django
#34483: Negative result of django.utils.timesince.timesince
+---
   Reporter:  Lorenzo Peña  |  Owner:  nobody
   Type:  Bug   | Status:  new
  Component:  Utilities |Version:  4.2
   Severity:  Normal|   Keywords:  timesince
   Triage Stage:  Unreviewed|  Has patch:  0
Needs documentation:  0 |Needs tests:  0
Patch needs improvement:  0 |  Easy pickings:  0
  UI/UX:  0 |
+---
 Reproducible example:

 {{{
 import zoneinfo
 import datetime as _dt
 from django.utils.timesince import timesince
 import django.utils.timezone as _timezone

 
timesince(_timezone.now().astimezone(zoneinfo.ZoneInfo(key='Europe/Berlin'))-_dt.timedelta(seconds=1))

 >>> '-1\xa0Year, 11\xa0Months'
 }}}

-- 
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/01070187707d6da1-229ad429-d90d-4752-ad14-a586cf0525ff-00%40eu-central-1.amazonses.com.


Re: [Django] #34482: Unable to access "non-picklable" attributes of empty HttpRequest and HttpResponse objects after shallow copy. (was: Unable to access non-picklable attributes of HttpRequest and Ht

2023-04-11 Thread Django
#34482: Unable to access "non-picklable" attributes of empty HttpRequest and
HttpResponse objects after shallow copy.
-+-
 Reporter:  Anvesh Mishra|Owner:  Anvesh Mishra
 Type:  Bug  |   Status:  assigned
Component:  HTTP handling|  Version:  4.2
 Severity:  Release blocker  |   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 Mariusz Felisiak):

 * severity:  Normal => Release blocker
 * stage:  Unreviewed => Accepted


Comment:

 Regressions in d7f5bfd241666c0a76e90208da1e9ef81aec44db and
 6220c445c40a6a7f4d442de8bde2628346153963.

 Thanks Márton Salomváry for the report.

-- 
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/01070187704a250d-9dfb6d55-0d2e-42c9-bd24-3b1506d67187-00%40eu-central-1.amazonses.com.


[Django] #34482: Unable to access non-picklable attributes of HttpRequest and HttpResponse objects after shallow copy.

2023-04-11 Thread Django
#34482: Unable to access non-picklable attributes of HttpRequest and 
HttpResponse
objects after shallow copy.
-+---
   Reporter:  Anvesh Mishra  |  Owner:  Anvesh Mishra
   Type:  Bug| Status:  assigned
  Component:  HTTP handling  |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  |
-+---
 Trying to access the non-picklable attributes of `HttpRequest` object
 after shallow copy leads to an `AttributeError`.
 Example:

 {{{
 request = HttpRequest()
 request_copy = copy(request)
 match = request_copy.resolver_match

 AttributeError: 'WSGIRequest' object has no attribute 'resolver_match'
 }}}

-- 
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/010701876ff8fd32-b562d964-343d-4a3b-a9e4-53f158cb0b2d-00%40eu-central-1.amazonses.com.


Re: [Django] #34473: StepValueValidator does not take into account min_value

2023-04-11 Thread Django
#34473: StepValueValidator does not take into account min_value
--+--
 Reporter:  James Meakin  |Owner:  Jacob Rief
 Type:  Bug   |   Status:  assigned
Component:  Forms |  Version:  4.1
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  1
  Needs tests:  0 |  Patch needs improvement:  1
Easy pickings:  0 |UI/UX:  0
--+--
Changes (by Mariusz Felisiak):

 * needs_better_patch:  0 => 1
 * needs_docs:  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/010701876f6246c6-a94ad0d5-63ef-48c7-9919-64e0b9b1ab8b-00%40eu-central-1.amazonses.com.


Re: [Django] #16055: Filtering over generic relations with TextField/CharField object_id breaks in postgres

2023-04-11 Thread Django
#16055: Filtering over generic relations with TextField/CharField object_id 
breaks
in postgres
-+-
 Reporter:  anonymous|Owner:  David
 |  Wobrock
 Type:  Bug  |   Status:  assigned
Component:   |  Version:  3.2
  contrib.contenttypes   |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  1|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * needs_better_patch:  0 => 1
 * needs_tests:  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/010701876f483e84-0b398ffc-3877-4fbe-9d8f-be0ea5e4fb8a-00%40eu-central-1.amazonses.com.


Re: [Django] #34394: ASGIRequest doesn't respect settings.FORCE_SCRIPT_NAME.

2023-04-11 Thread Django
#34394: ASGIRequest doesn't respect settings.FORCE_SCRIPT_NAME.
-+-
 Reporter:  julyzergcn   |Owner:  Sarah
 |  Boyce
 Type:  Bug  |   Status:  assigned
Component:  HTTP handling|  Version:  4.1
 Severity:  Normal   |   Resolution:
 Keywords:  asgi SCRIPT_NAME | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * 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/010701876f0e21b6-dfd920ba-ce3c-4583-925a-9503d0955dc1-00%40eu-central-1.amazonses.com.