Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes #6929
@kozlovsky:
I debugged the problem and found the reason for the error. It is in this line of CoreManager:
There is a difference in arguments between a python script and a compiled executable. For script, arguments can look like
and sys.executable is something like C:/Python39/python.exe.
For the same code in the compiled executable, arguments will be
and sys.executable is myscript.exe.
That means that when Tribler executes self.core_process.start(sys.executable, core_args) from the compiled binary, it runs tribler.exe with arguments ["tribler.exe", "some.torrent", "--core"], because tribler.exe comes both from sys.executable and from sys.argv[0]. The proper fix, in my opinion, is to remove duplicate "tribler.exe" from the argument list when running a code from compiled binary.
So, the reason for the error is that when compiled, GUI runs Core with arguments: