#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 <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018dec56e56f-fad931da-815b-4fca-9fbd-63aeb097e105-000000%40eu-central-1.amazonses.com.

Reply via email to