[Django] #30173: Use subprocess.run and PGPASSWORD for client in postgres backend

16 views
Skip to first unread message

Django

unread,
Feb 10, 2019, 8:15:51 PM2/10/19
to django-...@googlegroups.com
#30173: Use subprocess.run and PGPASSWORD for client in postgres backend
------------------------------------------+--------------------------
Reporter: Daniel Bowring | Owner: nobody
Type: Uncategorized | Status: assigned
Component: Uncategorized | Version: 2.1
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 |
------------------------------------------+--------------------------
[https://docs.python.org/3/library/subprocess.html#subprocess.run
subprocess.run] was added in python 3.5 (which is the minimum version
since Django 2.1). This function allows you to pass a custom environment
for the subprocess.

Using this in django.db.backends.postgres.client to set PGPASSWORD
simplifies the code and makes it more reliable.

--
Ticket URL: <https://code.djangoproject.com/ticket/30173>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Feb 10, 2019, 8:20:45 PM2/10/19
to django-...@googlegroups.com
#30173: Use subprocess.run and PGPASSWORD for client in postgres backend
--------------------------------+--------------------------------------

Reporter: Daniel Bowring | Owner: nobody
Type: Uncategorized | Status: assigned
Component: Uncategorized | Version: 2.1
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 Daniel Bowring):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/30173#comment:1>

Django

unread,
Feb 10, 2019, 8:21:09 PM2/10/19
to django-...@googlegroups.com
#30173: Use subprocess.run and PGPASSWORD for client in postgres backend
--------------------------------+--------------------------------------

Reporter: Daniel Bowring | Owner: nobody
Type: Uncategorized | Status: assigned
Component: Uncategorized | Version: 2.1
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
--------------------------------+--------------------------------------

Comment (by Daniel Bowring):

[https://github.com/django/django/pull/10973 Github PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/30173#comment:2>

Django

unread,
Feb 11, 2019, 10:47:46 AM2/11/19
to django-...@googlegroups.com
#30173: Use subprocess.run and PGPASSWORD for client in postgres backend
-------------------------------------+-------------------------------------

Reporter: Daniel Bowring | Owner: nobody
Type: | Status: assigned
Cleanup/optimization |
Component: Database layer | Version: 2.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* component: Uncategorized => Database layer (models, ORM)
* needs_better_patch: 0 => 1
* type: Uncategorized => Cleanup/optimization
* easy: 1 => 0
* stage: Unreviewed => Accepted


Comment:

Some test failures need to be addressed.

--
Ticket URL: <https://code.djangoproject.com/ticket/30173#comment:3>

Django

unread,
Feb 12, 2019, 4:07:05 AM2/12/19
to django-...@googlegroups.com
#30173: Use subprocess.run and PGPASSWORD for client in postgres backend
-------------------------------------+-------------------------------------

Reporter: Daniel Bowring | Owner: nobody
Type: | Status: assigned
Cleanup/optimization |
Component: Database layer | Version: 2.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Daniel Bowring):

I've updated the PR to fix the tests.

--
Ticket URL: <https://code.djangoproject.com/ticket/30173#comment:4>

Django

unread,
Feb 13, 2019, 5:31:09 PM2/13/19
to django-...@googlegroups.com
#30173: Use subprocess.run and PGPASSWORD for client in postgres backend
-------------------------------------+-------------------------------------

Reporter: Daniel Bowring | Owner: nobody
Type: | Status: closed

Cleanup/optimization |
Component: Database layer | Version: 2.1
(models, ORM) |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

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


Comment:

In [changeset:"cf826c9a91015c8da2ad4910b12e2ed83e2fb20f" cf826c9a]:
{{{
#!CommitTicketReference repository=""
revision="cf826c9a91015c8da2ad4910b12e2ed83e2fb20f"
Fixed #30173 -- Simplified db.backends.postgresql.client.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30173#comment:5>

Reply all
Reply to author
Forward
0 new messages