title: how to snmpset string or integer value with python?
body: <p>I'm trying to set value with snmpset via python.</p>
  
  <pre><code>import netsnmp
  snmpcfgfile=netsnmp.Varbind(".1.3.6.1.4.1.171.12.1.2.18.1.1.5.3", 
                              "switch.cfg","STRING")
  netsnmp.snmpset(snmpcfgfile, Version=2, DestHost="10.0.112.4", Community="public")`
  </code></pre>
  
  <p>(2 second later i see an error): TypeError: expected string or Unicode object, NoneType found</p>
  
  <p>And value is not changed. </p>
  
  <p>What do I do wrong? how should I make it correct?</p>
  
  <p>trace (please help to understand what it means):</p>
  
  <pre><code>--Call--
  &gt; /usr/lib/python2.7/dist-packages/netsnmp/client.py(185)set()
  -&gt; def set(self, varlist):
  (Pdb)
  &gt; /usr/lib/python2.7/dist-packages/netsnmp/client.py(186)set()
  -&gt; res = client_intf.set(self, varlist)
  (Pdb)
  --Call--
  &gt; /usr/lib/python2.7/dist-packages/netsnmp/client.py(94)__iter__()
  -&gt; def __iter__(self):
  (Pdb)
  &gt; /usr/lib/python2.7/dist-packages/netsnmp/client.py(95)__iter__()
  -&gt; return iter(self.varbinds)
  (Pdb)
  --Return--
  &gt; /usr/lib/python2.7/dist-packages/netsnmp/client.py(95)__iter__()-&gt;&lt;listite...c8096490&gt;
  -&gt; return iter(self.varbinds)
  (Pdb)
  Traceback (most recent call last):
    File "./snmp-set.py", line 7, in &lt;module&gt;
      netsnmp.snmpset(snmpcfgfile, Version=2, DestHost="10.0.112.4", Community="public")
    File "/usr/lib/python2.7/dist-packages/netsnmp/client.py", line 228, in snmpset
      res = sess.set(var_list)
    File "/usr/lib/python2.7/dist-packages/netsnmp/client.py", line 187, in set
      return res
    File "/usr/lib/python2.7/dist-packages/netsnmp/client.py", line 187, in set
      return res
    File "/usr/lib/python2.7/bdb.py", line 49, in trace_dispatch
      return self.dispatch_line(frame)
    File "/usr/lib/python2.7/bdb.py", line 67, in dispatch_line
      self.user_line(frame)
    File "/usr/lib/python2.7/pdb.py", line 157, in user_line
      if self.bp_commands(frame):
    File "/usr/lib/python2.7/pdb.py", line 167, in bp_commands
      if getattr(self, "currentbp", False) and \
  TypeError: expected string or Unicode object, NoneType found    
  </code></pre>