old_contents: import base64
  from moban.extensions import JinjaFilter
  
  
  @JinjaFilter('base64encode')
  def base64_encode(string):
      return base64.b64encode(string)
  
new_contents: import sys
  import base64
  from moban.extensions import JinjaFilter
  
  
  @JinjaFilter('base64encode')
  def base64_encode(string):
      if sys.version_info[0] > 2:
          content = base64.b64encode(string.encode('utf-8'))
          content = content.decode('utf-8')
      else:
          content = base64.b64encode(string)
      return content
  
subject: fix filter for python 3