[Django] #32687: database client runshell doesn't respect os.environ values in some cases

16 views
Skip to first unread message

Django

unread,
Apr 26, 2021, 8:35:00 AM4/26/21
to django-...@googlegroups.com
#32687: database client runshell doesn't respect os.environ values in some cases
-------------------------------------+-------------------------------------
Reporter: | Owner: Konstantin Alekseev
Konstantin Alekseev |
Type: Bug | Status: assigned
Component: Core | Version: 3.2
(Management commands) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 1
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
postgresql client returns empty dict instead of None for env
as a result os.environ is not used and empty env passed
to subprocess.
Bug introduced in
https://github.com/django/django/commit/bbe6fbb8768e8fb1aecb96d51c049d7ceaf802d3
#diff-
e98866ed4d445fbc94bb60bedffd5d8cf07af55dca6e8ffa4945931486efc3eeR23-R26

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

Django

unread,
Apr 26, 2021, 8:40:37 AM4/26/21
to django-...@googlegroups.com
#32687: database client runshell doesn't respect os.environ values in some cases
-------------------------------------+-------------------------------------
Reporter: Konstantin Alekseev | Owner:

| Konstantin Alekseev
Type: Bug | Status: assigned
Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Konstantin Alekseev:

Old description:

> postgresql client returns empty dict instead of None for env
> as a result os.environ is not used and empty env passed
> to subprocess.
> Bug introduced in
> https://github.com/django/django/commit/bbe6fbb8768e8fb1aecb96d51c049d7ceaf802d3
> #diff-
> e98866ed4d445fbc94bb60bedffd5d8cf07af55dca6e8ffa4945931486efc3eeR23-R26

New description:

postgresql client returns empty dict instead of None for env
as a result os.environ is not used and empty env passed
to subprocess.
Bug introduced in
https://github.com/django/django/commit/bbe6fbb8768e8fb1aecb96d51c049d7ceaf802d3
#diff-
e98866ed4d445fbc94bb60bedffd5d8cf07af55dca6e8ffa4945931486efc3eeR23-R26

PR https://github.com/django/django/pull/14315

--

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

Django

unread,
Apr 26, 2021, 9:10:44 AM4/26/21
to django-...@googlegroups.com
#32687: database client runshell doesn't respect os.environ values in some cases
-------------------------------------+-------------------------------------
Reporter: Konstantin Alekseev | Owner:

| Konstantin Alekseev
Type: Bug | Status: assigned
Component: Core (Management | Version: 3.2
commands) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage:
| Someday/Maybe
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Nick Pope):

* stage: Unreviewed => Someday/Maybe
* needs_tests: 0 => 1
* easy: 0 => 1
* severity: Normal => Release blocker


Comment:

Agreed, this is a regression in bbe6fbb8768e8fb1aecb96d51c049d7ceaf802d3.

Please can you add a test and a release note for 3.2.1?

[https://github.com/django/django/pull/14315 PR]

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

Django

unread,
Apr 26, 2021, 9:16:29 AM4/26/21
to django-...@googlegroups.com
#32687: database client runshell doesn't respect os.environ values in some cases
-------------------------------------+-------------------------------------
Reporter: Konstantin Alekseev | Owner:

| Konstantin Alekseev
Type: Bug | Status: assigned
Component: Core (Management | Version: 3.2
commands) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Nick Pope):

* stage: Someday/Maybe => Accepted


Comment:

(Oops, my mistake.)

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

Django

unread,
Apr 26, 2021, 5:08:53 PM4/26/21
to django-...@googlegroups.com
#32687: database client runshell doesn't respect os.environ values in some cases
-------------------------------------+-------------------------------------
Reporter: Konstantin Alekseev | Owner:

| Konstantin Alekseev
Type: Bug | Status: assigned
Component: Core (Management | Version: 3.2
commands) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Nick Pope):

* needs_better_patch: 0 => 1
* needs_tests: 1 => 0


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

Django

unread,
Apr 27, 2021, 3:19:42 AM4/27/21
to django-...@googlegroups.com
#32687: database client runshell doesn't respect os.environ values in some cases
-------------------------------------+-------------------------------------
Reporter: Konstantin Alekseev | Owner:

| Konstantin Alekseev
Type: Bug | Status: assigned
Component: Core (Management | Version: 3.2
commands) |
Severity: Release blocker | 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 Mariusz Felisiak):

* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin


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

Django

unread,
Apr 27, 2021, 6:01:52 AM4/27/21
to django-...@googlegroups.com
#32687: database client runshell doesn't respect os.environ values in some cases
-------------------------------------+-------------------------------------
Reporter: Konstantin Alekseev | Owner:
| Konstantin Alekseev
Type: Bug | Status: closed

Component: Core (Management | Version: 3.2
commands) |
Severity: Release blocker | 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 Mariusz Felisiak <felisiak.mariusz@…>):

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


Comment:

In [changeset:"6e742dabc95b00ba896434293556adeb4dbaee8a" 6e742dab]:
{{{
#!CommitTicketReference repository=""
revision="6e742dabc95b00ba896434293556adeb4dbaee8a"
Fixed #32687 -- Restored passing process’ environment to underlying tool
in dbshell on PostgreSQL.

Regression in bbe6fbb8768e8fb1aecb96d51c049d7ceaf802d3.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32687#comment:6>

Django

unread,
Apr 27, 2021, 6:04:38 AM4/27/21
to django-...@googlegroups.com
#32687: database client runshell doesn't respect os.environ values in some cases
-------------------------------------+-------------------------------------
Reporter: Konstantin Alekseev | Owner:
| Konstantin Alekseev

Type: Bug | Status: closed
Component: Core (Management | Version: 3.2
commands) |
Severity: Release blocker | 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
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"55cb3c8ac186f7664b38d66fb4c7e678fe524741" 55cb3c8a]:
{{{
#!CommitTicketReference repository=""
revision="55cb3c8ac186f7664b38d66fb4c7e678fe524741"
[3.2.x] Fixed #32687 -- Restored passing process’ environment to


underlying tool in dbshell on PostgreSQL.

Regression in bbe6fbb8768e8fb1aecb96d51c049d7ceaf802d3.

Backport of 6e742dabc95b00ba896434293556adeb4dbaee8a from main.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32687#comment:7>

Reply all
Reply to author
Forward
0 new messages