Re: [Django] #9990: Management shell autocomplete breaks PYTHONSTARTUP autocomplete

18 views
Skip to first unread message

Django

unread,
Jul 4, 2011, 4:33:54 AM7/4/11
to django-...@googlegroups.com
#9990: Management shell autocomplete breaks PYTHONSTARTUP autocomplete
-------------------------------------+-------------------------------------
Reporter: bruno | Owner: nobody
Type: Bug | Status: new
Milestone: | Component: Core (Management
Version: SVN | commands)
Resolution: | Severity: Normal
Triage Stage: Design | Keywords: management shell
decision needed | command
Needs documentation: 0 | Has patch: 1
Patch needs improvement: 0 | Needs tests: 0
UI/UX: 0 | Easy pickings: 0
-------------------------------------+-------------------------------------
Changes (by bruno.desthuilliers@…):

* ui_ux: => 0
* component: Core (Other) => Core (Management commands)
* easy: => 0


Comment:

2 years later and we (my whole team) are still manually patching shell.py
release after release :-/

Attached is a patch against r15506 (django 1.3) which still works against
the trunk as of r16500.

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

Django

unread,
Jul 4, 2011, 5:29:10 AM7/4/11
to django-...@googlegroups.com
#9990: Management shell autocomplete breaks PYTHONSTARTUP autocomplete
-------------------------------------+-------------------------------------
Reporter: bruno | Owner: nobody
Type: Bug | Status: new
Milestone: | Component: Core (Management
Version: SVN | commands)
Resolution: | Severity: Normal
Triage Stage: Accepted | Keywords: management shell
Needs documentation: 0 | command
Patch needs improvement: 1 | Has patch: 1
UI/UX: 0 | Needs tests: 0
| Easy pickings: 0
-------------------------------------+-------------------------------------
Changes (by jezdez):

* needs_better_patch: 0 => 1
* stage: Design decision needed => Accepted


Comment:

Seems like a good idea in general, but the patch definitely needs a
cleanup, what's with the `'# XXX'` and `'# BD-WSB'`?

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

Django

unread,
Jul 4, 2011, 6:17:09 AM7/4/11
to django-...@googlegroups.com
#9990: Management shell autocomplete breaks PYTHONSTARTUP autocomplete
-------------------------------------+-------------------------------------
Reporter: bruno | Owner: nobody
Type: Bug | Status: new
Milestone: | Component: Core (Management
Version: SVN | commands)
Resolution: | Severity: Normal
Triage Stage: Accepted | Keywords: management shell
Needs documentation: 0 | command
Patch needs improvement: 1 | Has patch: 1
UI/UX: 0 | Needs tests: 0
| Easy pickings: 0
-------------------------------------+-------------------------------------

Comment (by bruno desthuilliers <bruno.desthuilliers@…>):

Replying to [comment:4 jezdez]:

> Seems like a good idea in general, but the patch definitely needs a
cleanup, what's with the `'# XXX'` and `'# BD-WSB'`?

New patch with cleaned-up comments and better handling of the "use-plain"
option.

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

Django

unread,
Sep 11, 2012, 5:22:49 AM9/11/12
to django-...@googlegroups.com
#9990: Management shell autocomplete breaks PYTHONSTARTUP autocomplete
-------------------------------------+-------------------------------------
Reporter: bruno | Owner: nobody
Type: Bug | Status: new
Component: Core (Management | Version: master

commands) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: management shell | Needs documentation: 0
command | Patch needs improvement: 1
Has patch: 1 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by bruno.desthuilliers@…):

4 years (yes : '''four years''') later and we (my whole team) are


'''still''' manually patching shell.py release after release :-/

Should I express how I feel about this ?

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

Django

unread,
Sep 11, 2012, 9:36:12 PM9/11/12
to django-...@googlegroups.com
#9990: Management shell autocomplete breaks PYTHONSTARTUP autocomplete
-------------------------------------+-------------------------------------
Reporter: bruno | Owner: nobody
Type: Bug | Status: new
Component: Core (Management | Version: master
commands) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: management shell | Needs documentation: 0
command | Patch needs improvement: 1
Has patch: 1 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by russellm):

Feel free to express whatever sentiments you like. That won't get your
ticket into trunk any faster.

What *will* make things progress faster?

Look at the meta data for this ticket. The patch is currently listed as
"Needs improvement". That means it's not going to hit anyone's radar to be
reviewed for trunk. If this ticket is so critical to the operation of your
team, you might want to consider spending a moment to either (1) address
the problems that mean it isn't ready for trunk, or (2) update the
metadata so that the ticket isn't misleading.

And to counter the next argument -- just flicking the "needs improvement"
switch doesn't mean a bunch of people will jump to review it. This is a
community of volunteers. Your ticket is one of almost 2000 that are
currently open. The fact that this ticket has been open for 4 years, and
the only comments on this ticket are from yourself and core developers
pretty much indicates that the set of people affected by this problem is
pretty small. Just because you're affected by this bug 99% of the time,
doesn't mean 99% of people are affected by this bug.

If this is a problem that is critical to you, you're going to need to
convince someone to pay attention to it. This may mean you need to spend
some time working on someone else's problem first. Scratch someone else's
back, and they might scratch yours.

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

Django

unread,
Feb 27, 2024, 3:52:19 PM2/27/24
to django-...@googlegroups.com
#9990: Management shell autocomplete breaks PYTHONSTARTUP autocomplete
-------------------------------------+-------------------------------------
Reporter: bruno | Owner: nobody
Type: Bug | Status: new
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: management shell | Triage Stage: Accepted
command |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Adam Zapletal):

* cc: Adam Zapletal (added)
* needs_better_patch: 1 => 0

Comment:

I looked into this and tested for a while, and I don't think the issue
exists any longer:

1. Loading locals from a `PYTHONSTARTUP` file works fine in a Django shell
2. Having a `PYTHONSTARTUP` file does not break autocomplete for the
Django shell
3. It seems to be expected behavior that the the autocomplete function
from a `PYTHONSTARTUP` file does not work in the Django shell since
`readline` can have one completer function. The completer function in the
Django shell is the one it set itself, which overwrites one set up by a
`PYTHONSTARTUP` file.
https://docs.python.org/3/library/readline.html#readline.set_completer

I believe this was fixed by a combination of
1f6b2e7a658594e6ae9507c5f98eb429d19c0c9d and
1bbb98d9a4b7d83e422b14ae2429cb368eff5a13. This comment on GitHub may help
to explain the fix:
https://github.com/django/django/pull/13911#issuecomment-862764723

I can do more investigation on this if needed.
--
Ticket URL: <https://code.djangoproject.com/ticket/9990#comment:8>

Django

unread,
Feb 28, 2024, 12:04:00 AM2/28/24
to django-...@googlegroups.com
#9990: Management shell autocomplete breaks PYTHONSTARTUP autocomplete
-------------------------------------+-------------------------------------
Reporter: bruno | Owner: nobody
Type: Bug | Status: new
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: management shell | Triage Stage: Accepted
command |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* has_patch: 1 => 0

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

Django

unread,
Feb 28, 2024, 2:34:53 AM2/28/24
to django-...@googlegroups.com
#9990: Management shell autocomplete breaks PYTHONSTARTUP autocomplete
-------------------------------------+-------------------------------------
Reporter: bruno | Owner: nobody
Type: Bug | Status: closed
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution: fixed
Keywords: management shell | Triage Stage: Accepted
command |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

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

Comment:

> I believe this was fixed by a combination of
1f6b2e7a658594e6ae9507c5f98eb429d19c0c9d and
1bbb98d9a4b7d83e422b14ae2429cb368eff5a13. This comment on GitHub may help
to explain the fix:
https://github.com/django/django/pull/13911#issuecomment-862764723

Thanks Adam, agreed let's close it.
--
Ticket URL: <https://code.djangoproject.com/ticket/9990#comment:10>
Reply all
Reply to author
Forward
0 new messages