title: AttributeError: 'int' object has no attribute 'encode'
body: <p>I have inherited a python script that is throwing the following error:</p>
  
  <pre><code>root        : ERROR    Unexpected exception encountered in application 'ImagesForWeb'
  Traceback (most recent call last):
    File "build/bdist.linux-i686/egg/columbiancommon/scaffolding/consoleapp.py", line 169, in run_safe
      self.run(**kwargs)
    File "/var/scripts/ImagesForWeb/imagesforweb.py", line 102, in run
      gallery = columbiancommon.EllingtonPhotoGallery(configobj = self.cmgr)
    File "build/bdist.linux-i686/egg/columbiancommon/ellington/photogallery.py", line 51, in __init__
      self.Reload()
    File "build/bdist.linux-i686/egg/columbiancommon/ellington/photogallery.py", line 128, in Reload
      self.SetStatus(self.status)
    File "build/bdist.linux-i686/egg/columbiancommon/ellington/photogallery.py", line 68, in SetStatus
      self.SetControl("status", [self.status.encode('utf-8', 'replace')])
  AttributeError: 'int' object has no attribute 'encode'
  </code></pre>
  
  <p>I'm pretty new to Python and haven't quite developed the debugging skills to know how to solve this issue yet.</p>
  
  <p>Here's the code snippet from <code>photogallery.py</code> that is refrenced in the above error:</p>
  
  <pre><code>def SetStatus(self, status):
      """
      Sets the publication status of this photo gallery.
  
      Expects to be set to an integer constant, shortcuts include::
  
          EllingtonPhotoGallery.LIVE
          EllingtonPhotoGallery.DRAFT
          EllingtonPhotoGallery.DELETED
          EllingtonPhotoGallery.UNREVIEWED
  
      """
      if(not isinstance(status, int)):
          raise EllingtonMechanizeException("Unexpected status value.  Please use a status constant.")
      self.status = status
      self.SetControl("status", [self.status.encode('utf-8', 'replace')])
  </code></pre>
  
  <p>This is the SetControl method that is within the scaffolding.py</p>
  
  <pre><code>def SetControl(self, control_name, control_value_unclean):
      """
      Raw access to the mechanize method of setting controls to specific values.
  
      **WARNING** Do not use this unless you have a really good reason to do so-- `EllingtonMechanizeScaffolding.SetControlToValue`
      and `EllingtonMechanizeScaffolding.SetControlToValueSafe` are much more elegant solutions.
  
      :Parameters:
          - `control_name`: The name of the control you're trying to assign a value to.
          - `control_value_unclean`: The value to assign to said control.  Either a boolean value, 
  
      """
      self.browser[control_name] = control_value_unclean
      return True
  </code></pre>
  
  <p>I believe it's the line that says <code>self.SetControl("status", [self.status.encode('utf-8', 'replace')])
  </code> that is throwing the error however I can't tell why the error is ocuring. The code has been working since I inherited it 6 months ago and it has not been altered on my end.</p>
  
  <p>Any help would be appreciated. </p>