Compare commits

...

4 Commits

Author SHA1 Message Date
Ilya Etingof 3ca5bcc3cb fixed crash on unknown PDU reporting 2017-03-22 01:50:45 +01:00
Ilya Etingof 36feb0ea55 note TextualConvention in changelog 2017-03-18 22:02:45 +01:00
Ilya Etingof 5341a7b1ff another fix to TextualConversion infinite recursion 2017-03-18 21:59:41 +01:00
Ilya Etingof ed5d607ec3 fix to infinite recursion in TextualConvention.prettyIn()
Also, TextualConvention is now a new-style class
2017-03-18 14:17:23 +01:00
3 changed files with 8 additions and 7 deletions

View File

@ -6,6 +6,10 @@ Revision 4.3.5, released 2017-0X-XX
now support ignoreNonIncreasingOid option.
- Fix to accidentally reset error-status when building confirmed class
SNMPv1 PDU
- Fix to possible infinite recursion in TextualConvention.prettyIn()
- TextualConvention is now a new-style class
- Fixed crash when attempting to report unsupported request/notification
PDU back to sender
Revision 4.3.4, released 2017-03-01
-----------------------------------

View File

@ -361,8 +361,6 @@ class MsgAndPduDispatcher(object):
debug.logger & debug.flagDsp and debug.logger('receiveMessage: unhandled PDU type')
# XXX fails on unknown PDU
try:
(destTransportDomain,
destTransportAddress,
@ -374,7 +372,7 @@ class MsgAndPduDispatcher(object):
statusInformation
)
except error.StatusInformation:
except (error.StatusInformation, error.ProtocolError):
debug.logger & debug.flagDsp and debug.logger(
'receiveMessage: report failed, statusInformation %s' % sys.exc_info()[1])
return restOfWholeMsg

View File

@ -29,8 +29,7 @@ Counter32, Unsigned32, TimeTicks, Counter64 = mibBuilder.importSymbols(
)
# XXX keep this old-style class till pyasn1 types becomes new-style
class TextualConvention:
class TextualConvention(object):
displayHint = ''
status = 'current'
description = ''
@ -184,7 +183,7 @@ class TextualConvention:
return outputValue
for base in inspect.getmro(self.__class__):
if base != self.__class__ and issubclass(base, Asn1Item):
if not issubclass(base, TextualConvention) and issubclass(base, Asn1Item):
return base.prettyOut(self, value)
raise SmiError('TEXTUAL-CONVENTION has no underlying SNMP base type')
@ -200,7 +199,7 @@ class TextualConvention:
input meaning `unicode` (Py2) or `str` (Py3).
"""
for base in inspect.getmro(self.__class__):
if base != self.__class__ and issubclass(base, Asn1Item):
if not issubclass(base, TextualConvention) and issubclass(base, Asn1Item):
break
else:
raise SmiError('TEXTUAL-CONVENTION has no underlying SNMP base type')