Note that there are some explanatory texts on larger screens.

plurals
  1. POError Python 2.7 on Google App Engine - Threadsafe cannot be enabled with CGI handler
    primarykey
    data
    text
    <p>I have tried to move to Python 2.7 from Python 2.5 but I keep getting the same error everytime.</p> <p>I have made a very simple test in Python 2.5 working with the app.yaml file and just one script main.py and it works fine. The script it just a Hello World type to check everythin works fine.</p> <p>app.yaml</p> <pre><code>application: sparepartsfinder version: 1 runtime: python api_version: 1 handlers: - url: /blog script: main.py - url: /blog/new_entry script: main.py </code></pre> <p>main.py</p> <pre><code>from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app class MainPage(webapp.RequestHandler): def get(self): self.response.headers['Content-Type'] = 'text/plain' self.response.out.write('Hello, webapp World!') application = webapp.WSGIApplication( [('/', MainPage), ('/blog', MainPage), ('/blog/new_entry',MainPage), ('/blog/archive/.*',MainPage)], debug=True) def main(): run_wsgi_app(application) if __name__ == "__main__": main() </code></pre> <p>When I change to Python 2.7 I follow the documents on the <a href="https://developers.google.com/appengine/docs/python/python27/using27#Configuring_the_Application" rel="noreferrer">Google App Engine</a> to the letter making the changes in both the app.yaml and main.py script. </p> <p>app.yaml</p> <pre><code>application: sparepartsfinder version: 1 runtime: python27 api_version: 1 threadsafe: true handlers: - url: /blog script: main.py - url: /blog/new_entry script: main.py - url: /blog/archive/.* script: main.py - url: .* script: main.py </code></pre> <p>main.py</p> <pre><code>import webapp2 class MainPage(webapp2.RequestHandler): def get(self): self.response.out.write('Hello prueba!') app = webapp2.WSGIApplication([('/', MainPage), ('/blog', MainPage), ('/blog/new_entry',MainPage), ('/blog/archive/.*',MainPage)], debug=True) </code></pre> <p>Unfortunately it doesn't work either in local or when I try to upload the new configuration to the Google App Engine. ( I get always the same mistake).</p> <p>I may understand the problem in my machine ( I have both Python 2.5 and 2.7 ) on a Windows XP, but not when I upload.</p> <p>This is the error:</p> <blockquote> <p>2012-05-04 13:02:07 Running command: "[u'C:\Python25\python2.5.exe', '-u', 'C:\Archivos >de programa\Google\google_appengine\appcfg.py', '--no_cookies', u'--email=salvador.sanjuan@gmail.com', '--passin', 'update', 'C:\Documents and Settings\SSanjuan\Mis documentos\Dropbox\Dropbox\Python\SpareParts']" Error parsing yaml file: Invalid object: threadsafe cannot be enabled with CGI handler: main.py in "C:\Documents and Settings\SSanjuan\Mis documentos\Dropbox\Dropbox\Python\SpareParts\app.yaml", line 27, column 1 2012-05-04 13:02:31 (Process exited with code 1)</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload