Migrating to Python 2.7

78 views
Skip to first unread message

Kim Jae

unread,
Aug 29, 2013, 10:35:57 AM8/29/13
to google-a...@googlegroups.com
I found an interesting tutorial here and followed it.


http://eixerits.wordpress.com/2013/07/20/python-2-7-migration-demystified/

however, I have encountered some problems.

I tried to deploy the my app and I got an error message:

2013-08-29 21:29:28 Running command: “['C:\\Python27\\pythonw.exe', '-u', 'C:\\Program Files\\Google\\google_appengine\\appcfg.py', '--no_cookies', u'--email=bus...@gmail.com', '--passin', 'update', u'C:\\Users\\xplore\\Documents\\shitty shit\\cs']”
09:29 PM Host: appengine.google.com
Error parsing yaml file:
while scanning a simple key
in “C:\Users\xplore\Documents\shitty shit\cs\app.yaml”, line 10, column 1
could not found expected ‘:’
in “C:\Users\xplore\Documents\shitty shit\cs\app.yaml”, line 11, column 1
2013-08-29 21:29:44 (Process exited with code 1)

You can close this window now.


I tried to check my .yaml file and this is what it says: 

application: yourapp

version: 2
runtime: python27
api_version: 1
threadsafe:true
handlers:
- url: /images
static_dir: images
- url: /
script: main.app
login: admin
- url: /getvalue
script: main.app
login: optional
- url: /setvalue
script: main.app
login: optional
- url: /sendemail
script: main.app
login: optional
builtins:
- datastore_admin: on


I have no idea what went wrong with the code. I'm kinda new to Python so it's impossible for me to figure out what I need to change in lines 10 and 11 based on the yaml file. Please enlighten me on the possible solutions.


Your response is appreciated.

Vinny P

unread,
Aug 29, 2013, 12:12:25 PM8/29/13
to google-a...@googlegroups.com
Are you indenting your YAML lines correctly? Based on the file you pasted, I don't see any indentation.

YAML is similar to Python in that it requires developers to indent lists/properties. Use spaces when indenting, not tabs. See http://yaml.org/spec/1.2/2009-07-21/spec.html#id2576668

 
-----------------
-Vinny P
Technology & Media Advisor
Chicago, IL

App Engine Code Samples: http://www.learntogoogleit.com
 
 


On Thu, Aug 29, 2013 at 9:35 AM, Kim Jae <butte...@gmail.com> wrote:

I tried to deploy the my app and I got an error message:

in “C:\Users\xplore\Documents\shitty shit\cs\app.yaml”, line 10, column 1


could not found expected ‘:’
in “C:\Users\xplore\Documents\shitty shit\cs\app.yaml”, line 11, column 1
2013-08-29 21:29:44 (Process exited with code 1)

Kim Jae

unread,
Aug 29, 2013, 8:51:16 PM8/29/13
to google-a...@googlegroups.com
Hello! thank you for your response. I don't think spacing is the problem because I was able to successfully deploy the previous yaml file. I just added a few words and changed some.  attached is the original notepad for your reference.


--
You received this message because you are subscribed to a topic in the Google Groups "Google App Engine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine/MAwh5SBAuyU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.

app.yaml

timh

unread,
Aug 29, 2013, 9:05:54 PM8/29/13
to google-a...@googlegroups.com
The errors you reported are pretty specific. It's a problem with you app.yaml

I would look at the line immediately preceeding line 10.

Vinny P

unread,
Aug 29, 2013, 9:30:40 PM8/29/13
to google-a...@googlegroups.com
OK, I think I have it. Add a space between threadsafe: and true so it looks like this: threadsafe: true (space is after the colon ":" )

I tested your app.yaml file on a PHP application I had, and it worked when I added a space (and edited the script names, of course!). Just to explain what happened, here is a picture of your app.yaml that I annotated: http://imgur.com/Y79j1XX There are extra blank lines, so the 10th and 11th lines are actually the 6th line of text.

For future reference, see this page of the YAML spec: http://www.yaml.org/spec/1.2/spec.html#id2759963
TLDR: Keys and values must be separated by a colon and space (i.e. Key: Value)

Kim Jae

unread,
Aug 30, 2013, 11:10:34 PM8/30/13
to google-a...@googlegroups.com
Thanks for the info! would you mind taking a look at the revised yaml file I made? I tried to deploy it but am still getting Process exited with code 1 error. attached is the file for your reference.


app.yaml

Vinny P

unread,
Aug 31, 2013, 12:09:13 AM8/31/13
to google-a...@googlegroups.com
On Fri, Aug 30, 2013 at 10:10 PM, Kim Jae <butte...@gmail.com> wrote:
Thanks for the info! would you mind taking a look at the revised yaml file I made? I tried to deploy it but am still getting Process exited with code 1 error. attached is the file for your reference.



Great, I see you removed all the blank lines. It looks much neater now!

Also, did the error message change? Does it cite a different line number where it encountered the error? If not, try this: remove all the handler statements except for the root handler (url: /), and try re-uploading the application. If it succeeds, then add in another handler statement, then re-upload. Rinse and repeat until you hit the handler that's causing the error.

Kim Jae

unread,
Sep 2, 2013, 8:58:43 PM9/2/13
to google-a...@googlegroups.com
Thank you for your suggestion! I tried it and it works! :)


Reply all
Reply to author
Forward
0 new messages