Skip to content

Conversation

@MudDev
Copy link

@MudDev MudDev commented Oct 24, 2025

This pull request introduces a monkey patch to fix a known KeyError bug in the aiobtdht library, specifically in its routing table bucket implementation. The fix ensures that node removal logic correctly unpacks tuple elements, preventing runtime errors. The patch is applied both at module import and before importing DHT, ensuring the fix is always in effect.

Bug fix for aiobtdht routing table:

  • Added src/DHT/aiobtdht_fix.py with a monkey patch for aiobtdht.routing_table.bucket.Bucket.add, resolving a KeyError caused by incorrect tuple unpacking when removing nodes with negative rate.
  • Updated src/DHT/DHTServer.py to apply the patch from aiobtdht_fix.py before importing DHT, guaranteeing the bug fix is active during runtime.

@MudDev MudDev merged commit 1a2d63a into main Oct 24, 2025
3 checks passed
@MudDev MudDev deleted the dht_patch branch October 24, 2025 17:02
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.

2 participants