mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-19 21:17:54 +00:00
idlib: make failures much clearer when encountering unicode
while investigating fuse related stuff, I spent quite a while staring at very cryptic explosions I got from idlib. it turns out that unicode objects and str objects have .translate() methods with differing signatures. to save anyone else the headache, this makes it very clear if you accidentally try to pass a unicode object in to a2b() etc.
This commit is contained in:
parent
09bfa3bea2
commit
ca41693162
@ -181,6 +181,7 @@ s5 = init_s5()
|
||||
def could_be_base32_encoded(s, s8=s8, tr=string.translate, identitytranstable=identitytranstable, chars=chars):
|
||||
if s == '':
|
||||
return True
|
||||
precondition(not isinstance(s, unicode), s)
|
||||
return s8[len(s)%8][ord(s[-1])] and not tr(s, identitytranstable, chars)
|
||||
|
||||
def could_be_base32_encoded_l(s, lengthinbits, s5=s5, tr=string.translate, identitytranstable=identitytranstable, chars=chars):
|
||||
|
Loading…
Reference in New Issue
Block a user