title: How to resolve 'str' has no attribute 'maketrans' error in python?
body: <p>I got an error while run python proxy.py</p>
  
  <pre><code>$ python proxy.py 
  INFO - [Sep 28 14:59:19] getting appids from goagent plus common appid pool!
  Traceback (most recent call last):
    File "proxy.py", line 2210, in &lt;module&gt;
      main()
    File "proxy.py", line 2180, in main
      pre_start()
    File "proxy.py", line 2157, in pre_start
      common.set_appids(get_appids())
    File "proxy.py", line 94, in get_appids
      fly = bytes.maketrans(
  AttributeError: type object 'str' has no attribute 'maketrans'
  </code></pre>
  
  <p>The proxy.py file in <a href="https://code.google.com/p/smartladder/" rel="noreferrer">https://code.google.com/p/smartladder/</a>,</p>
  
  <pre><code>def get_appids():
      fly = bytes.maketrans(
          b"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
          b"nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM"
      )
      f = urllib.request.urlopen(url="http://lovejiani.com/v").read().translate(fly)
      d = base64.b64decode(f)
      e = str(d, encoding='ascii').split('\r\n')
      random.shuffle(e)
      return  e
  </code></pre>