termios.tcgetattr(fd) error: (22, 'Invalid argument')

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Petr Jakes

    termios.tcgetattr(fd) error: (22, 'Invalid argument')

    On my box (Fedora Core4, Python 2.4.1) I am getting following error:[color=blue][color=green][color=darkred]
    >>> import termios, sys
    >>> fd = sys.stdin.filen o()
    >>> oldSettings = termios.tcgetat tr(fd)[/color][/color][/color]
    Traceback (innermost last):
    File "<stdin>", line 1, in ?
    error: (22, 'Invalid argument')

    Thanks for your comments.
    Petr Jakes

  • Petr Jakes

    #2
    Re: termios.tcgetat tr(fd) error: (22, 'Invalid argument')

    To provide some feedback:
    As Grant Edwards posted in this list, I was running my code inside of
    IDE that replaces sys.stdin with some other. While running the program
    from a shell prompt, everything goes fine.
    Petr Jakes

    Comment

    • Petr Jakes

      #3
      Re: termios.tcgetat tr(fd) error: (22, 'Invalid argument')

      To provide some feedback:
      As Grant Edwards posted in this list, I was running my code inside of
      IDE that replaces sys.stdin with some other. While running the program
      from a shell prompt, everything goes fine.
      Petr Jakes

      Comment

      • Sinan Nalkaya

        #4
        Re: termios.tcgetat tr(fd) error: (22, 'Invalid argument')

        Petr Jakes wrote:
        [color=blue]
        >To provide some feedback:
        >As Grant Edwards posted in this list, I was running my code inside of
        >IDE that replaces sys.stdin with some other. While running the program
        >from a shell prompt, everything goes fine.
        >Petr Jakes
        >
        >
        >[/color]
        have you tried it with root account ?

        Comment

        • Sinan Nalkaya

          #5
          Re: termios.tcgetat tr(fd) error: (22, 'Invalid argument')

          Petr Jakes wrote:
          [color=blue]
          >To provide some feedback:
          >As Grant Edwards posted in this list, I was running my code inside of
          >IDE that replaces sys.stdin with some other. While running the program
          >from a shell prompt, everything goes fine.
          >Petr Jakes
          >
          >
          >[/color]
          have you tried it with root account ?

          Comment

          • Petr

            #6
            Re[2]: termios.tcgetat tr(fd) error: (22, 'Invalid argument')

            >>To provide some feedback:[color=blue][color=green]
            >>As Grant Edwards posted in this list, I was running my code inside of
            >>IDE that replaces sys.stdin with some other. While running the program
            >>from a shell prompt, everything goes fine.
            >>Petr Jakes
            >>
            >>
            >>[/color][/color]
            SN> have you tried it with root account ?
            Yes, I did. The problem was the IDE. Without IDE the filedescriptor
            and its flags settings are working flawlessly.

            Comment

            Working...