quentinsf / icsv2ledger

Interactive importing of CSV files to Ledger
196 stars 70 forks source link

Using libedit on Mac OS X breaks raw_input prompt #30

Closed afh closed 12 years ago

afh commented 12 years ago

Hi guys, I've been using icsv2ledger some more and noticed that on my workstation running Mac OS X the prompts from raw_input are not presented when I pass in csv data via stdin.

easy_installing readline support fixes the problem. It seems the libedit that Apple ships by default is inferior to the official readline. Do any of you also use Mac OS X? And can you verify the problem? if yes I think the README should include a little note on the issue.

Here's a little test script I used

 #! /usr/bin/env python
 #  when readline or rlcomleter are imported the prompt given to raw_input does not show
 # on a Mac OS X system that by default ships with libedit.
 # % easy_install readline
 # fixes the problem

import sys
import readline
import rlcompleter

def main():
  message = sys.stdin.readlines()
  sys.stdin = open('/dev/tty')
  foo = raw_input('prompt> ')

if __name__ == "__main__":
      main()
petdr commented 12 years ago

On 20 October 2012 05:44, Alexis Hildebrandt notifications@github.comwrote:

Hi guys, I've been using icsv2ledger some more and noticed that on my workstation running Mac OS X the prompts from raw_input are not presented when I pass in csv data via stdin.

easy_installing readline support fixes the problem. It seems the libedit that Apple ships by default is inferior to the official readline. Do any of you also use Mac OS X? And can you verify the problem? if yes I think the README should include a little note on the issue.

Sorry I don't use macosx, but if you've noticed the problem please add a note to the README file.