question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

termios.error: (25, 'Inappropriate ioctl for device')

See original GitHub issue

Greetings!

When I try to run the program below, It gives Error as in the title. Image is here: http://imgur.com/9no96dh

import readchar

while True:
    print "Press 'A' to Start the recording"
    print "      'Z' to Stop the recording"
    print "      'Enter' to quit the program..."

    # Read a key
    key = readchar.readkey()
    if(key == 'A'):
        print "Started Recording..."
    elif(key == 'Z'):
        print "Stopped Recording..."
    elif(key == '\r'):
        print "Exiting..."
        break
    else:
        print "Please Use only allowed keys: A, Z, Enter!" 

I tried to do just run readchar.readkey() in python console, It worked fine there. But when I tried to do it as above, this error occurred. Any help will be greatly appreciated.

Note: I’m on Ubuntu Gnome x86_64. Kernel: 3.19.* v. Using Python 2.7.

Thanks & Regards, inblueswithu

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:17 (6 by maintainers)

github_iconTop GitHub Comments

10reactions
mehditlilicommented, Jun 1, 2018

This would be useful if it works in IDE, trying to debug some code using the IDE’s debugger but this error won’t let me do it.

2reactions
magmaxcommented, Oct 27, 2015

I’m afraid yes. Maybe you can use pty or https://github.com/pexpect/ptyprocess in order to make it work in a non-terminal environment.

Thank you anyways.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pycharm 2019 termios.error: (25, 'Inappropriate ioctl for device')
I'm getting the following error on Pycharm 2019.1.1. OS ubuntu 16.04. Steps to reproduce: ``` # test.py import sysfrom termios import...
Read more >
pipenv shell in Jenkins return the issue termios.error
python - pipenv shell in Jenkins return the issue termios. error: (25, 'Inappropriate ioctl for device') - Stack Overflow. Stack Overflow for ...
Read more >
Error: (25, 'Inappropriate ioctl for device') - PlatformIO Core
It seems the combination “platformio device monitor” in background + stdout redirection is not supported on Linux (tested on Ubuntu 20.04).
Read more >
Inappropriate ioctl for device - Tooling Issues
I get this error: ... in cbreak save_mode = termios.tcgetattr(self.keyboard_fd) termios.error: (25, 'Inappropriate ioctl for device').
Read more >
Issue with termios and pipes : r/learnpython - Reddit
The exact error I'm getting is old_settings = self.termios.tcgetattr(fd) termios.error: (25, 'Inappropriate ioctl for device').
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found