Open augurar opened 7 years ago
Here is some C code to reproduce the underlying error:
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/event.h>
#include <sys/time.h>
#include <sys/types.h>
int main(int argc, char **argv) {
int fd = open("/dev/tty", O_RDWR | O_NOCTTY);
if (fd < 0) {
perror("open");
exit(1);
}
int kqfd = kqueue();
if (kqfd < 0) {
perror("kqueue");
exit(1);
}
struct kevent ke;
EV_SET(&ke, fd, EVFILT_READ, EV_ADD, 0, 0, 0);
struct timespec timeout;
timeout.tv_sec = 0;
timeout.tv_nsec = 0;
int result = kevent(kqfd, &ke, 1, NULL, 0, &timeout);
if (result < 0) {
perror("kevent");
exit(1);
}
}
Thanks for report.
You can try monkey_patch(os=False)
for a temporary workaround.
Yes; another workaround is to supply getpass
with the unpatched os
module:
import getpass
getpass.os = eventlet.patcher.original('os')
Yes, that one is much better.
Monkey-patching the
os
module causesgetpass.getpass()
to fail:It appears that
getpass()
is trying to read from/dev/tty
, but thekevent()
syscall being used does not support terminal device files.