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

cln: fix the check on the exit code #111

Merged
merged 1 commit into from
Sep 28, 2023

Conversation

vincenzopalazzo
Copy link
Collaborator

@vincenzopalazzo vincenzopalazzo commented Sep 28, 2023

The mystery of why pythons do not fail sometimes
is still open to me, but anyway.

This commit is fixing the check on the exit code,
because the subprocess.run will not return
an exit code when the error happens in the command line.

But it will throw an exception, see this example below

>>> subprocess.run(["l", "-pp"])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.11/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.11/subprocess.py", line 1950, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'l'

Fixes: #110

@vincenzopalazzo vincenzopalazzo added the 🐛 bug 🐛 Something isn't working label Sep 28, 2023
@vincenzopalazzo vincenzopalazzo force-pushed the macros/fix-lightningd-check branch 3 times, most recently from 1529a4c to c8a8fec Compare September 28, 2023 09:33
The mystery of why pythons do not fail sometimes
is still open to me, but anyway.

This commit is fixing the check on the exit code,
because the subprocess.run will not return
an exit code when the error happens in the command line.

But it will throw an exception, see this example below

>>> subprocess.run(["l", "-pp"])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.11/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.11/subprocess.py", line 1950, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'l'

Link: #110
Fixes: 52ec42e9192808cb5952bdd45d7a5c5e186520bb
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
@vincenzopalazzo vincenzopalazzo merged commit a8d4dcf into master Sep 28, 2023
4 checks passed
@vincenzopalazzo vincenzopalazzo deleted the macros/fix-lightningd-check branch September 28, 2023 11:34
vincenzopalazzo added a commit to vincenzopalazzo/lightning that referenced this pull request Sep 28, 2023
Thi commit include the following change in lnprototest:

- cln: fix the check on the exit code (rustyrussell/lnprototest#111)

Link: ElementsProject#6727
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
vincenzopalazzo added a commit to vincenzopalazzo/lightning that referenced this pull request Sep 28, 2023
Thi commit includes the following change in lnprototest:

- cln: fix the check on the exit code (rustyrussell/lnprototest#111)

Link: ElementsProject#6727
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
vincenzopalazzo added a commit to vincenzopalazzo/lightning that referenced this pull request Sep 28, 2023
Thi commit includes the following change in lnprototest:

- cln: fix the check on the exit code (rustyrussell/lnprototest#111)

Link: ElementsProject#6727
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
rustyrussell pushed a commit to ElementsProject/lightning that referenced this pull request Sep 29, 2023
Thi commit includes the following change in lnprototest:

- cln: fix the check on the exit code (rustyrussell/lnprototest#111)

Link: #6727
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug 🐛 Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lnprototest: runtime --developer flag not always work.
1 participant