summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.txt3
-rw-r--r--pysnmp/proto/api/v1.py7
-rw-r--r--pysnmp/proto/api/v2c.py3
3 files changed, 10 insertions, 3 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 3c9a1ddd..8ed4fe9b 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -107,6 +107,9 @@ Revision 4.4.10, released 2019-04-XX
- Fixed asyncore main loop to respect non-default timer resolution
- Fixed `.setTimerResolution()` behaviour of abstract main loop dispatcher
to update call intervals of the existing periodic dispatcher jobs
+- Fixed `var-bindings` initialization to prevent pyasn1 encoder failures
+ with newer pyasn1 versions where `SequenceOf` type looses its default
+ initializer.
Revision 4.4.9, released 2019-02-09
-----------------------------------
diff --git a/pysnmp/proto/api/v1.py b/pysnmp/proto/api/v1.py
index f13920e7..e8641deb 100644
--- a/pysnmp/proto/api/v1.py
+++ b/pysnmp/proto/api/v1.py
@@ -80,7 +80,9 @@ class PDUAPI(object):
2, self._errorIndex, verifyConstraints=False, matchTags=False,
matchConstraints=False)
- pdu.setComponentByPosition(3)
+ varBindList = pdu.setComponentByPosition(3).getComponentByPosition(3)
+ varBindList.clear()
+
@staticmethod
def getRequestID(pdu):
@@ -217,7 +219,8 @@ class TrapPDUAPI(object):
4, self._zeroTime, verifyConstraints=False, matchTags=False,
matchConstraints=False)
- pdu.setComponentByPosition(5)
+ varBindList = pdu.setComponentByPosition(5).getComponentByPosition(5)
+ varBindList.clear()
@staticmethod
def getEnterprise(pdu):
diff --git a/pysnmp/proto/api/v2c.py b/pysnmp/proto/api/v2c.py
index c415ca9a..0470fafd 100644
--- a/pysnmp/proto/api/v2c.py
+++ b/pysnmp/proto/api/v2c.py
@@ -119,7 +119,8 @@ class BulkPDUAPI(PDUAPI):
2, self._maxRepetitions, verifyConstraints=False, matchTags=False,
matchConstraints=False)
- pdu.setComponentByPosition(3)
+ varBindList = pdu.setComponentByPosition(3).getComponentByPosition(3)
+ varBindList.clear()
@staticmethod
def getNonRepeaters(pdu):