exhuma / puresnmp

Pure Python SNMPv2 Library
MIT License
79 stars 22 forks source link

string length calculation confusion #35

Closed remdragon closed 6 years ago

remdragon commented 6 years ago

puresnmp.x690.types.OctetString.init() converts value to ascii, but then calculates length on the original possibly unicode input value.

now, since it's converting to ascii, any multi-byte character would just throw a unicode error anyway, but it feels wrong to be calculating the length on the wrong value.

Please feel free to just close this as me being pedantic, but the I posted this is because I was already typing this issue report before I realized it wasn't a bug and it could cause others confusion in the future.

exhuma commented 6 years ago

No you're correct. I like this type of pedantic. I'm in the same camp. I will leave this open!