In Python, what is a string sequence? (or glib error?)

I know that the question may look silly, but I really am not able to figure it out. I am naive though a string sequence is a list of strings. However, this fails:

(pid, stdin, stdout, stderr) = glib.spawn_async(
    argv=["foo", "bar"],
    envp=None,
    flags=glib.SPAWN_SEARCH_PATH + glib.SPAWN_CHILD_INHERITS_STDIN,
    standard_input=True,
    standard_output=True,
    standard_error=True)

Cannot execute this error:

TypeError: glib.spawn_async: first argument must be a sequence of strings

I tried with a tuple that gives nothing.

What is a string sequence if not a list? I’m even talking about a possible Python-Glib error, although I don’t believe that such an error really exists. I found a mention of a similar message on the Internet, but I do not know if this is this error, which is an error, or the appearance of this error, which is one.

- change -

Using this even shorter pattern ends with the same:

(pid, stdin, stdout, stderr) = glib.spawn_async(argv=["foo", "bar"])

According to poster requests, here is the full trace:

Traceback (most recent call last):
  File "<...>/test.py", line 92, in <module>
    run()
  File "<...>/test.py", line 62, in run
    standard_error=True)
TypeError: glib.spawn_async: first argument must be a sequence of strings
+4
1

:

  • unicode. Python 3 from __future__ import unicode_literals, b"foo".
  • envp, , . None. /, .
+1

Source: https://habr.com/ru/post/1527047/


All Articles