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

Fixes #6929 #6937

Merged
merged 1 commit into from
Jun 15, 2022
Merged

Fixes #6929 #6937

merged 1 commit into from
Jun 15, 2022

Conversation

drew2a
Copy link
Collaborator

@drew2a drew2a commented Jun 15, 2022

This PR fixes #6929

@kozlovsky:

I debugged the problem and found the reason for the error. It is in this line of CoreManager:

self.core_process.start(sys.executable, core_args)

There is a difference in arguments between a python script and a compiled executable. For script, arguments can look like

["myscript.py", "arg1", "arg2"]

and sys.executable is something like C:/Python39/python.exe.

For the same code in the compiled executable, arguments will be

["myscript.exe", "arg1", "arg2"]

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:

tribler.exe tribler.exe some.torrent --core

@drew2a drew2a requested a review from kozlovsky June 15, 2022 06:39
@drew2a drew2a changed the base branch from main to release/7.12 June 15, 2022 06:39
@drew2a drew2a marked this pull request as ready for review June 15, 2022 06:40
@drew2a drew2a requested a review from a team as a code owner June 15, 2022 06:40
@drew2a drew2a merged commit ec023e6 into Tribler:release/7.12 Jun 15, 2022
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

Successfully merging this pull request may close these issues.

[Ubuntu, 7.12-RC1] Can't open torrent file from browser
2 participants