The configured `cursor_factory` is being passed to `get_new_connection` as
`conn_params["cursor_factory"]`. `get_new_connection` should leave that
alone if it’s set. (And if it’s not, it might also be cleaner for to pass
the default `cursor_factory` via a keyword argument to
`psycopg[2].connect` too, rather than mutating it later.)
--
Ticket URL: <https://code.djangoproject.com/ticket/34466>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* owner: nobody => Anders Kaseorg
* status: new => assigned
* has_patch: 0 => 1
Comment:
Submitted a patch at https://github.com/django/django/pull/16736.
--
Ticket URL: <https://code.djangoproject.com/ticket/34466#comment:1>
* needs_tests: 0 => 1
* stage: Unreviewed => Accepted
Comment:
Sounds like a legit request, we didn't limit this functionality on purpose
but rather by accident.
Assuming we fix this we should also make it more pythonic (and I guess I
am at fault for it being like it is now) and not check for `is True` but
only truthiness. Either way, a test ensuring that we do not regress here
would be good.
--
Ticket URL: <https://code.djangoproject.com/ticket/34466#comment:2>
Comment (by Anders Kaseorg):
Removed `is True` and added a test.
--
Ticket URL: <https://code.djangoproject.com/ticket/34466#comment:3>
* needs_tests: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/34466#comment:4>
* needs_better_patch: 0 => 1
* severity: Normal => Release blocker
* needs_docs: 0 => 1
Comment:
Replying to [comment:2 Florian Apolloner]:
> Assuming we fix this we should also make it more pythonic (and I guess I
am at fault for it being like it is now) and not check for `is True` but
only truthiness.
We use `is True` intentionally, to avoid errors when passing wrong truthy
values, e.g.`"server_side_binding": os.environ.get("USE_SSB")` (where
`os.environ.get("USE_SSB")` returns `"False"`).
--
Ticket URL: <https://code.djangoproject.com/ticket/34466#comment:5>
* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin
* needs_docs: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/34466#comment:6>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"73cbb372baa45d1fdafd571e2f430a980831f722" 73cbb372]:
{{{
#!CommitTicketReference repository=""
revision="73cbb372baa45d1fdafd571e2f430a980831f722"
Fixed #34466 -- Reallowed setting cursor_factory in DATABASES["options"]
on PostgreSQL.
Regression in 09ffc5c1212d4ced58b708cbbf3dfbfb77b782ca.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/34466#comment:7>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"0bc2bbf041df40a6ecb6262b2e5f3bb659dd8da8" 0bc2bbf]:
{{{
#!CommitTicketReference repository=""
revision="0bc2bbf041df40a6ecb6262b2e5f3bb659dd8da8"
[4.2.x] Fixed #34466 -- Reallowed setting cursor_factory in
DATABASES["options"] on PostgreSQL.
Regression in 09ffc5c1212d4ced58b708cbbf3dfbfb77b782ca.
Backport of 73cbb372baa45d1fdafd571e2f430a980831f722 from main
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/34466#comment:8>