We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bdbbd68 commit 3488585Copy full SHA for 3488585
bencodex/writer.py
@@ -48,7 +48,7 @@ def is_unicode(k: Union[bytes, str]) -> bool:
48
return True
49
raise TypeError('dictionary key must be a bytes or str')
50
items = [
51
- (u, k.encode('utf-8') if u else k, v)
+ (u, k.encode('utf-8') if u and isinstance(k, str) else k, v)
52
for k, v in value.items()
53
for u in [is_unicode(k)]
54
]
0 commit comments