vmess2json icon indicating copy to clipboard operation
vmess2json copied to clipboard

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

Open libook opened this issue 3 years ago • 2 comments

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.

libook avatar Jul 02 '21 10:07 libook

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

alamia442 avatar Sep 19 '21 05:09 alamia442

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

20NE avatar Dec 28 '21 05:12 20NE