python / cpython

The Python programming language
https://www.python.org/
Other
59.98k stars 29.03k forks source link

readline update #50083

Closed 9176eee0-c74f-45d3-9537-b8d5227af1c4 closed 9 years ago

9176eee0-c74f-45d3-9537-b8d5227af1c4 commented 15 years ago
BPO 5833
Nosy @terryjreedy, @doko42, @pitrou, @sandrotosi
Files
  • Python.patch
  • python-2.6-readline.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields: ```python assignee = None closed_at = created_at = labels = ['extension-modules', 'type-bug'] title = 'readline update' updated_at = user = 'https://bugs.python.org/jrevans1' ``` bugs.python.org fields: ```python activity = actor = 'terry.reedy' assignee = 'none' closed = True closed_date = closer = 'terry.reedy' components = ['Extension Modules'] creation = creator = 'jrevans1' dependencies = [] files = ['13760', '14599'] hgrepos = [] issue_num = 5833 keywords = ['patch'] message_count = 14.0 messages = ['86432', '90978', '90981', '90996', '91066', '94248', '94560', '95476', '95479', '128229', '128306', '128319', '224189', '226086'] nosy_count = 7.0 nosy_names = ['terry.reedy', 'doko', 'pitrou', 'spatz', 'jrevans1', 'sandro.tosi', 'BreamoreBoy'] pr_nums = [] priority = 'normal' resolution = 'fixed' stage = 'resolved' status = 'closed' superseder = None type = 'behavior' url = 'https://bugs.python.org/issue5833' versions = ['Python 2.6', 'Python 3.1', 'Python 2.7', 'Python 3.2'] ```

    9176eee0-c74f-45d3-9537-b8d5227af1c4 commented 15 years ago

    Attached is a patch file that will update the readline functionality of python in the following ways: -- makes the tab-expand module be compatible with readline v6.x (fixes the annoying extra-space bug) -- removes '\~$-/' from the completer chars list to make the next item work -- adds filename completion to the completer, this is useful whenever a filename/path is used -- allows expansion to work properly on ClassType objects

    306c085f-6e48-4f09-8ef9-e58315464cbd commented 14 years ago

    This bug was reported in Arch (http://bugs.archlinux.org/task/15548) and Gentoo (https://bugs.gentoo.org/show_bug.cgi?id=279234)

    pitrou commented 14 years ago

    The patch should be broken into several, one for each bug fix or enhancement.

    Remarks and questions:

    9176eee0-c74f-45d3-9537-b8d5227af1c4 commented 14 years ago

    Some clarification about the rest of the patch:

    -- We tested the readline fix with version 5.2 and it seemed to work, we did not do a thorough test with it, or with any other version.

    -- When I supplied the patch I supplied the patch that we use when building python, which also included some enhancements/bug fixes (depending on how you look at it). By removing the '\~$-/' characters from the completer list it allows the user to perform file name completion (with the provided file name completion code). The file name completion code has been very rigorously tested. We have been using it at our company for the past 10 years with >100 users and have had no problems with it.

    -- We put this here since it never really seemed to be an advanced feature since readline completion will complete file names on the command-line as well. This seemed like a relatively low-level fix that makes the python tab-expansion facility fully usable instead of just partly usable.

    If you would like me to resubmit the patch as smaller components I can do that as well.

    306c085f-6e48-4f09-8ef9-e58315464cbd commented 14 years ago

    Arch Linux devs have split the patch and applied only the extra-space fix, which is what I'm attaching now. I've compiled Python 2.6.2 on Gentoo with this patch and can report it works well (I tested with ipython).

    pitrou commented 14 years ago

    I've committed the readline 6.0 fix to trunk, py3k and 3.1. I'll commit it to 2.6 when the branch is unfrozen.

    pitrou commented 14 years ago

    Now backported to py3k in r75747.

    doko42 commented 14 years ago

    msg94560 should read "backported to the 2.6 branch". can we close the report?

    pitrou commented 14 years ago

    Can we close the report?

    Well there's something else in the original patch, although I don't care about it.

    sandrotosi commented 13 years ago

    How should we move forward with this issue? J Evens: are you willing to split the patch in smaller ones that can be more easily managed/reviewed/applied? Antoine: do you think it's worth the effort?

    I can also try to split the patch, but what branch should I target: py3k?

    pitrou commented 13 years ago

    Antoine: do you think it's worth the effort?

    As mentioned above, the readline 6 compatibility code was checked in. The ClassType expansion is 2.x-only, so probably can't go in since it's a feature request. What remains is the filename expansion. However, the problem is that it seems to rely on removing '\~$-/' from the word break characters, which is IMO wrong (at least '-', '/' and '\~' are all Python operators which should be considered word break characters).

    9176eee0-c74f-45d3-9537-b8d5227af1c4 commented 13 years ago

    I have no problem splitting the patch into multiple files. When I do so, do I place them here or open separate tickets for each component?

    Or if you guys want to just close out the ticket since the actual bug was fixed, I am okay with that too. We will probably continue to use the patched version of tabexpand for our users since the filename expansion is used quite heavily. And since we will not be transitioning to py3k anytime in the next several years, we have no issue with what is (or is not) implemented there.

    83d2e70e-e599-4a04-b820-3814bbdb9bef commented 9 years ago

    Looking at msg128306 and msg128319 I believe this can be closed.

    terryjreedy commented 9 years ago

    Bug was fixed. Enhancements are out of date for 2.x and OP will not pursue for 3.x, and should be a separate issue anyway.