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

Handle corupted pieces in a handle status #7982

Merged
merged 2 commits into from
Apr 22, 2024
Merged

Conversation

drew2a
Copy link
Collaborator

@drew2a drew2a commented Apr 18, 2024

Fixes #7981

@drew2a drew2a marked this pull request as ready for review April 19, 2024 08:38
@drew2a drew2a requested a review from a team as a code owner April 19, 2024 08:38
@drew2a drew2a requested review from xoriole and removed request for a team April 19, 2024 08:38
Introduced a helper function to improve the readability of tests in the libtorrent component. This function converts bitarray representations into base64, making it easier to understand and verify the expected results. The changes are applied in tests that check if correct pieces bitmask is returned when requested.
Adjusted the method for generating a base64 encoded bitmask of downloaded pieces. Now, it includes a try-except block to handle potential ValueError exceptions that could occur if the list of pieces is corrupted. This change ensures that an empty string is returned instead of allowing the exception to propagate. Additionally, a corresponding test case has been added to verify this new behavior when dealing with corrupted piece lists.
@drew2a drew2a merged commit 37e8bb9 into Tribler:main Apr 22, 2024
20 checks passed
@drew2a drew2a deleted the fix/7981 branch April 22, 2024 09:55
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.

[7.13.3] ValueError: bit must be 0 or 1, got 4
2 participants