-
Notifications
You must be signed in to change notification settings - Fork 23
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
How to use types when set string value #60
Comments
Quick FixYou can set it by creating an
Let me know if this will work and I will close this issue. Python 2 vs Python 3The solution above is for Python 3! If you already use Python 3 you are fine and don't need to worry about byte details! In Python 2, string values without "u" prefix are already considered bytes and you may run into double-encoding errors in the worst case. You have to be 100% certain that the value you encode into "utf8" is an instance of sysDescr is documented to be ASCIIA warning: According to RFC-1213 Section 3.2 the If you want to be safe, and don't want to lose any data, you can use one of the replacement error-handlers for string encoding. For example, I quite like
If you want to use US-ASCII you can just wrap the string-value in puresnmp/puresnmp/x690/types.py Line 367 in 5052752
|
I want to set sysDescr.0 use set,but I don't know how to convert my string it to Type
The text was updated successfully, but these errors were encountered: