title: HTTP error 302 on GAE
body: <p>I write a script for automatically posting status to social network from rss. For posting I use just <code>urllib</code> and <code>urllib2</code> and if I run my script from command line - it's work. But when I upload it to GAE server and go to it's url I have: <code>HTTP Error 302: The HTTP server returned a redirect error that would lead to an infinite loop.</code></p>
  
  <p>So what's the problem here? Why the result of running is different?</p>
  
  <p>Code is now something like this:</p>
  
  <pre><code>def get_page(url, post = None, cookies = None, referer = None):
      if post != None:
          post = urllib.urlencode(post)
  
      opener = urllib2.build_opener()
  
      request = urllib2.Request(url, post)
      if referer != None:
          request.add_header('Referer', referer)
      request.add_header('User-Agent', 'Chrome/12.0.742.112')
      if cookies != None:
          request.add_header('Cookie', cookies)
  
      try:
          handle = opener.open(request)
      except URLError, details:
          print 'URL error: ', details
          return ''
      data = handle.read()
      handle.close()
  
      return data
  </code></pre>