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

Fix the issue of passing the URL in bytes to the get_metainfo function. #7848

Merged
merged 1 commit into from
Jan 25, 2024

Conversation

drew2a
Copy link
Contributor

@drew2a drew2a commented Jan 24, 2024

This PR fixes #7823

The actual fix is encapsulated in the following line:

url = response.decode("utf-8")

The remainder of the PR focuses on testing the new change and simplifying the get_torrent_info function, which was also part of the testing process.

@drew2a drew2a marked this pull request as ready for review January 24, 2024 06:49
@drew2a drew2a requested review from a team and xoriole and removed request for a team January 24, 2024 06:49
- Refactored the `get_metainfo` function in `DownloadManager` class to change the type of the `url` parameter from `Optional[Union[str, bytes]]` to `Optional[str]`.
- Added a new test case `test_get_torrentinfo_get_metainfo_from_downloaded_magnet` in the file `test_torrentinfo_endpoint.py`. This test case checks if the correct arguments are passed to the `get_metainfo` function when retrieving metainfo from a downloaded magnet.
@drew2a drew2a merged commit ed1d03b into Tribler:main Jan 25, 2024
20 checks passed
@drew2a drew2a deleted the fix/7823 branch January 25, 2024 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

DownloadManager. get_metainfo() receives an URL in bytes
2 participants