[Django] #29534: Use rlwrap if available for oracle backend dbshell

10 views
Skip to first unread message

Django

unread,
Jun 28, 2018, 11:43:03 PM6/28/18
to django-...@googlegroups.com
#29534: Use rlwrap if available for oracle backend dbshell
-------------------------------------+-------------------------------------
Reporter: Dan Davis | Owner: nobody
Type: New | Status: new
feature |
Component: Core | Version: 1.11
(Management commands) |
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 |
-------------------------------------+-------------------------------------
PROBLEM

Oracle's SQL utility, sqlplus, is proprietary and closed source. On *NIX
systems, it is not linked with GNU readline. So, using it in that
environment is quite hard -- unless you use rlwrap. It is trivial to
use rlwrap via an alias, but to get Django's manage.py dbshell to work
properly requires changes to the backend.

DESIRED BEHAVIOR

The Oracle backend.client should look for rlwrap, and wrap sqlplus in
rlwrap when rlwrap is available. If rlwrap is not available, then we
will assume that's what there is.

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

Django

unread,
Jun 28, 2018, 11:43:45 PM6/28/18
to django-...@googlegroups.com
#29534: Use rlwrap if available for oracle backend dbshell
-------------------------------------+-------------------------------------
Reporter: Dan Davis | Owner: Dan Davis
Type: New feature | Status: assigned
Component: Core (Management | Version: 1.11
commands) |
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 Dan Davis):

* status: new => assigned
* owner: nobody => Dan Davis


Comment:

I think I can at least get as far as a pull request, but unit tests for
Oracle may be tougher.

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

Django

unread,
Jun 29, 2018, 12:24:25 AM6/29/18
to django-...@googlegroups.com
#29534: Use rlwrap if available for oracle backend dbshell
-------------------------------------+-------------------------------------
Reporter: Dan Davis | Owner: Dan Davis
Type: New feature | Status: assigned
Component: Core (Management | Version: 1.11
commands) |
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
-------------------------------------+-------------------------------------

Comment (by Dan Davis):

Having worked on this briefly, I'm not really sure whether it is a good
idea to support calling rlwrap if it is installed by hand - in that case,
you can subclass the backend.

Both on CentOS 6, CentOS 7, and Ubuntu 16.04, the path to rlwrap is
/usr/bin/rlwrap if it has been installed as a package.

So, the question is whether it is better to look for it in the path with
shutil.which('rlwrap'), or whether it is better to only do this when it is
"properly" installed in /usr/bin/rlwrap. I guess I should then check OS
X, because there it may go elsewhere.

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

Django

unread,
Jul 9, 2018, 3:49:43 AM7/9/18
to django-...@googlegroups.com
#29534: Use rlwrap if available for oracle backend dbshell
-------------------------------------+-------------------------------------
Reporter: Dan Davis | Owner: Dan Davis
Type: New feature | Status: assigned
Component: Core (Management | Version: master
commands) |
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 Carlton Gibson):

* version: 1.11 => master
* stage: Unreviewed => Accepted


Comment:

Hi Dan.

This seems a reasonable addition. (At least pending the work on the PR!
:-)

Thanks for the input!

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

Django

unread,
Jul 9, 2018, 3:50:04 AM7/9/18
to django-...@googlegroups.com
#29534: Use rlwrap if available for oracle backend dbshell
-------------------------------------+-------------------------------------
Reporter: Dan Davis | Owner: Dan Davis
Type: | Status: assigned
Cleanup/optimization |

Component: Core (Management | Version: master
commands) |
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 Carlton Gibson):

* type: New feature => Cleanup/optimization


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

Django

unread,
Aug 23, 2018, 12:04:02 PM8/23/18
to django-...@googlegroups.com
#29534: Use rlwrap if available for oracle backend dbshell
-------------------------------------+-------------------------------------
Reporter: Dan Davis | Owner: Dan Davis
Type: | Status: assigned
Cleanup/optimization |
Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* has_patch: 0 => 1


Comment:

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

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

Django

unread,
Aug 28, 2018, 12:11:09 PM8/28/18
to django-...@googlegroups.com
#29534: Use rlwrap if available for oracle backend dbshell
-------------------------------------+-------------------------------------
Reporter: Dan Davis | Owner: Dan Davis
Type: | Status: assigned
Cleanup/optimization |
Component: Core (Management | Version: master
commands) |
Severity: Normal | 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 felixxm):

* cc: felixxm (added)
* needs_better_patch: 0 => 1


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

Django

unread,
Oct 24, 2018, 4:08:58 PM10/24/18
to django-...@googlegroups.com
#29534: Use rlwrap if available for oracle backend dbshell
-------------------------------------+-------------------------------------
Reporter: Dan Davis | Owner: Dan Davis
Type: | Status: assigned
Cleanup/optimization |
Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* needs_better_patch: 1 => 0


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

Django

unread,
Oct 25, 2018, 11:42:58 AM10/25/18
to django-...@googlegroups.com
#29534: Use rlwrap if available for oracle backend dbshell
-------------------------------------+-------------------------------------
Reporter: Dan Davis | Owner: Dan Davis
Type: | Status: assigned
Cleanup/optimization |
Component: Core (Management | Version: master
commands) |
Severity: Normal | 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 Tim Graham):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/29534#comment:8>

Django

unread,
Oct 25, 2018, 7:40:07 PM10/25/18
to django-...@googlegroups.com
#29534: Use rlwrap if available for oracle backend dbshell
-------------------------------------+-------------------------------------
Reporter: Dan Davis | Owner: Dan Davis
Type: | Status: closed

Cleanup/optimization |
Component: Core (Management | Version: master
commands) |
Severity: Normal | 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 Tim Graham <timograham@…>):

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


Comment:

In [changeset:"c6525bea9ec3d1d1e73585ca6e3116bb55afb336" c6525bea]:
{{{
#!CommitTicketReference repository=""
revision="c6525bea9ec3d1d1e73585ca6e3116bb55afb336"
Fixed #29534 -- Made dbshell use rlwrap on Oracle if available.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29534#comment:9>

Reply all
Reply to author
Forward
0 new messages