Looks like you need to either change stderr to sys.stderr, or to add at
the beginning:
from sys import stderr
Either change will get you to use a defined variable (which represents
the error chanel).
--- Omer
On Wed, 2010-06-30 at 22:35 +0800, jessinio liang wrote:
> hi, every body.
>
> when I using net-snmp python binding, I found a bug:
>
> my test code:
>
> 1 import netsnmp
> 2 import sys
> 3 import os
> 4
> 5 o = netsnmp.Varbind("sysDescr")
> 6 netsnmp.snmpwalk( NotInList = o, Version = 2,
> DestHost="localhost", Community="public")
>
> when I run the code, python complain:
>
> Traceback (most recent call last):
> File "/tmp/test_netsnmp.py", line 6, in <module>
> netsnmp.snmpwalk( NotInList = o, Version = 2,
> DestHost="localhost", Community="public")
> File
> "/usr/local/python2.6/lib/python2.6/site-packages/netsnmp_python-1.0a1-py2.6-linux-x86_64.egg/netsnmp/client.py",
> line 228, in snmpwalk
> sess = Session(**kargs)
> File
> "/usr/local/python2.6/lib/python2.6/site-packages/netsnmp_python-1.0a1-py2.6-linux-x86_64.egg/netsnmp/client.py",
> line 123, in __init__
> sess_args = _parse_session_args(args)
> File
> "/usr/local/python2.6/lib/python2.6/site-packages/netsnmp_python-1.0a1-py2.6-linux-x86_64.egg/netsnmp/client.py",
> line 38, in _parse_session_args
> print stderr, "ERROR: unknown key", key
> NameError: global name 'stderr' is not defined
--
Palestinians did not firmly and vocally and strongly denounce the
Hannover attack
(http://www.huffingtonpost.com/2010/06/24/german-youths-attack-jewi_n_623922.html)
but rather supported the attack, even though it is yet another proof why Jews
need their own country in which they can live safely.
My own blog is at http://www.zak.co.il/tddpirate/
My opinions, as expressed in this E-mail message, are mine alone.
They do not represent the official policy of any organization with which
I may be affiliated in any way.
WARNING TO SPAMMERS: at http://www.zak.co.il/spamwarning.html
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users