Skip to content

Allowing get_pre_input_hook from Readline #48752

Closed

Description

@ConradIrwin
BPO 4502
Nosy @CuriousLearner
Files
  • readline.c.diff: A diff of the changes
  • 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:

    assignee = 'https://github.com/CuriousLearner'
    closed_at = None
    created_at = <Date 2008-12-03.01:49:36.329>
    labels = ['extension-modules', 'type-feature', '3.8']
    title = 'Allowing get_pre_input_hook from Readline'
    updated_at = <Date 2019-02-23.18:15:43.909>
    user = 'https://bugs.python.org/ConradIrwin'

    bugs.python.org fields:

    activity = <Date 2019-02-23.18:15:43.909>
    actor = 'CuriousLearner'
    assignee = 'CuriousLearner'
    closed = False
    closed_date = None
    closer = None
    components = ['Extension Modules']
    creation = <Date 2008-12-03.01:49:36.329>
    creator = 'Conrad.Irwin'
    dependencies = []
    files = ['12207']
    hgrepos = []
    issue_num = 4502
    keywords = ['patch']
    message_count = 3.0
    messages = ['76808', '76809', '336396']
    nosy_count = 2.0
    nosy_names = ['Conrad.Irwin', 'CuriousLearner']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'test needed'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue4502'
    versions = ['Python 3.8']

    Linked PRs

    Activity

    1. ConradIrwin commented on Dec 3, 2008

      ConradIrwinmannequin
      MannequinAuthor

      At the moment there is no way of getting the current pre_input_hook out
      of the readline module, so applications cannot set_pre_input_hook
      without possibly over-writing users settings (or other parts of the
      applications settings) I have attached a patch that implements this
      functionality.

      It is probably not very useful in many situations, but I am now using it
      to maintain my normal custom auto-indenting python prompt in a library
      that allows me to edit arbitrary strings using readline. A better way to
      implement this might be to

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-featureA feature request or enhancement
      on Dec 3, 2008
    3. ConradIrwin commented on Dec 3, 2008

      ConradIrwinmannequin
      MannequinAuthor

      ...wrap the current readline in a pure python module

    4. added and removed
      stdlibStandard Library Python modules in the Lib/ directory
      on Nov 29, 2011
    5. CuriousLearner commented on Feb 23, 2019

      @CuriousLearner
      Member

      I'm working on applying this patch cleanly and writing a test for this.

      However, it seems I'm unable to import readline in compiled version of Python. I'm trying to provide a path to the installation of readline in my system using LDFLAGS, and then reconfiguring and recompiling, but seems like it didn't work.

      Can someone provide me a pointer here, please?

    6. transferred this issue fromon Apr 10, 2022
    7. added 2 commits that reference this issue on Nov 15, 2025
    8. added 3 commits that reference this issue on Nov 30, 2025
    9. added a commit that references this issue on Dec 5, 2025
    10. added a commit that references this issue on Dec 6, 2025
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Labels

    extension-modulesC modules in the Modules dirtype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions