Re: [pysnmp-dev] [PATCH] fix for loading compiled (*.{pyc, pyo}) mib files
Brought to you by:
elie
From: Ilya E. <il...@gl...> - 2012-12-20 12:37:53
|
Hi Jacek, That piece of code has been radically reworked in 4.2.4 branch. Could you please try out this tarball: http://sourceforge.net/projects/pysnmp/files/pysnmp/4.2.4/pysnmp-4.2.4rc5.tar.gz/download and alert me in case of any issues. thanks, Ilya > In the PLD Linux distribution Python 2.x modules are distributed in > compiled form only (*.{pyc,pyo}, no *.py), this is also done for the MIB > modules included in pysnmp. PySNMP does include code to handle that, > but it is broken in the 4.2.3 release: > > DBG: loadModules: trying SNMPv2-MIB at DirMibSource('/usr/share/python2.7/site-packages/pysnmp/smi/mibs') > DBG: bad magic in SNMPv2-MIB.pyc > DBG: file SNMPv2-MIB.pyc mtime -1 > DBG: file SNMPv2-MIB.py mtime -1 > > The magic bytes are valid in the file, but they get destroyed by the _getData() > method before the test in read() method. > > The patch below fixes the problem. |