summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES3
-rw-r--r--pysnmp/proto/rfc1902.py9
2 files changed, 9 insertions, 3 deletions
diff --git a/CHANGES b/CHANGES
index 99f6926..fe9db58 100644
--- a/CHANGES
+++ b/CHANGES
@@ -54,6 +54,9 @@ Revision 4.2.6rc0
on clone()'ing and subtype()'ing.
- Fix to rfc1902.OctetString & Bits to base them on OctetString class to
make the 'fixed length' property working.
+- Fix to .clone() method of rfc1902.Bits class to make its signature
+ matching the rest of classes. This may broke code which used to pass
+ namedValue parameter positionally rather than binding it by name.
Revision 4.2.5
--------------
diff --git a/pysnmp/proto/rfc1902.py b/pysnmp/proto/rfc1902.py
index 0a7ed02..e1d0205 100644
--- a/pysnmp/proto/rfc1902.py
+++ b/pysnmp/proto/rfc1902.py
@@ -38,7 +38,7 @@ class OctetString(univ.OctetString):
).setFixedLength(self.getFixedLength())
def subtype(self, value=None, implicitTag=None, explicitTag=None,
- subtypeSpec=None):
+ subtypeSpec=None):
return univ.OctetString.subtype(
self, value, implicitTag, explicitTag, subtypeSpec
).setFixedLength(self.getFixedLength())
@@ -163,6 +163,7 @@ class Bits(OctetString):
return ', '.join([ str(x) for x in names ])
def clone(self, value=None, tagSet=None, subtypeSpec=None,
+ encoding=None, binValue=None, hexValue=None,
namedValues=None):
if value is None and tagSet is None and subtypeSpec is None \
and namedValues is None:
@@ -175,7 +176,8 @@ class Bits(OctetString):
subtypeSpec = self._subtypeSpec
if namedValues is None:
namedValues = self.__namedValues
- return self.__class__(value, tagSet, subtypeSpec, namedValues)
+ return self.__class__(value, tagSet, subtypeSpec, encoding,
+ binValue, hexValue, namedValues)
def subtype(self, value=None, implicitTag=None, explicitTag=None,
subtypeSpec=None, namedValues=None):
@@ -195,7 +197,8 @@ class Bits(OctetString):
namedValues = self.__namedValues
else:
namedValues = namedValues + self.__namedValues
- return self.__class__(value, tagSet, subtypeSpec, namedValues)
+ return self.__class__(value, tagSet, subtypeSpec,
+ namedValues=namedValues)
class ObjectName(univ.ObjectIdentifier): pass