Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

always require tty while thiere sys.stdin.isatty() is False #12

Open
libook opened this issue Jul 2, 2021 · 2 comments
Open

always require tty while thiere sys.stdin.isatty() is False #12

libook opened this issue Jul 2, 2021 · 2 comments

Comments

@libook
Copy link

libook commented Jul 2, 2021

Execute vmess2json.py in non-tty environment with a single vmess URL.

There is an error from select_multiple function:

No such device or address: '/dev/tty'

In line 741:

if len(option.subscribe) > 0:

The value of option.subscribe is '-'.

In line 684-687:

    if sys.stdin.isatty():
        return None
    stdindata = sys.stdin.read()
    option.subscribe = "-"

When isatty returns False. It will continue run option.subscribe = "-".

I don't know about Python. Is this a bug? Hope these information may help you.

@alamia442
Copy link

same here
Traceback (most recent call last):
File "./vmess2json.py", line 746, in
select_multiple(stdin_data)
File "./vmess2json.py", line 663, in select_multiple
sys.stdin = open('/dev/tty', 'r')
OSError: [Errno 6] No such device or address: '/dev/tty'

use python3 vmess2json.py or ./vmess2json.py sama error

@20NE
Copy link

20NE commented Dec 28, 2021

and when vmess2json.py in bash script, like:
yes n | ScriptWithVmess2json
causes system hang.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants