Skip to content

importing rlcompleter module writes a control sequence in stdout #57373

Closed

Description

@valva
mannequin
BPO 13164
Nosy @merwok, @bitdancer
Superseder
  • bpo-19884: Importing readline produces erroneous output
  • 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 = None
    closed_at = <Date 2015-04-14.21:32:54.782>
    created_at = <Date 2011-10-13.12:35:20.371>
    labels = ['type-bug']
    title = 'importing rlcompleter module writes a control sequence in stdout'
    updated_at = <Date 2015-04-14.21:32:54.780>
    user = 'https://bugs.python.org/valva'

    bugs.python.org fields:

    activity = <Date 2015-04-14.21:32:54.780>
    actor = 'r.david.murray'
    assignee = 'none'
    closed = True
    closed_date = <Date 2015-04-14.21:32:54.782>
    closer = 'r.david.murray'
    components = []
    creation = <Date 2011-10-13.12:35:20.371>
    creator = 'valva'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 13164
    keywords = []
    message_count = 3.0
    messages = ['145452', '145960', '241034']
    nosy_count = 3.0
    nosy_names = ['eric.araujo', 'r.david.murray', 'valva']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '19884'
    type = 'behavior'
    url = 'https://bugs.python.org/issue13164'
    versions = ['Python 2.7', 'Python 3.2', 'Python 3.3']

    Activity

    1. valva commented on Oct 13, 2011

      valvamannequin
      MannequinAuthor

      When you import the module rlcompleter in a python script in Centos 6 (x86_64), the control sequence \033[?1034h is printed in stdout. The problem is that these sequence is not visible by the user and cause a lot of confusion.

      In my case I compared the output of a python script (the integer 6) in bash and I got:

      test: 6: integer expression expected

      How to reproduce:

      =============================
      BASH SCRIPT that calls test.py
      =============================
      id=$(./test.py)
      echo $id|sed -n l
      if test ${id} -eq 0;then
      fi

      =========
      test.py
      =========

       #!/usr/bin/python
       import rlcompleter
       a=2
       print a

      ========
      OUTPUT
      ========
      [valva@wn009 ~]$ bash p.sh
      \033[?1034h2$
      p.sh: line 3: test: 2: integer expression expected

      This only has happened to me in Centos 6 (python 2.6.5) I've tested in Centos 5, debian and Ubuntu and it does not happen.

    2. added
      type-bug
      on Oct 13, 2011
    3. merwok commented on Oct 19, 2011

      @merwok
      Member

      Can you give a simpler script (maybe in Python :) to reproduce this? Also, 2.6 only gets security fixes now, so please use 2.7, 3.2 or 3.3.

    4. bitdancer commented on Apr 14, 2015

      @bitdancer
      Member

      Duplicate of 19884.

    5. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      type-bug

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions