0
votes

I have a serious problem in updating GAE from Python 2.5 to Python 2.7 for the application found at glowscript.org. I'm currently testing locally on Windows with GAE Launcher 1.7.6.

Users can create folders with names that contain spaces, and the app converts spaces to '%20' to form a key for the datastore; similarly for file names inside these folders. There exists at glowscript.org a sizable number of users whose data depends on such keys.

In trying to debug locally some odd problems in the Python 2.7 version, it has become clear that there has been a major change in the GAE datastore machinery. Suppose the user creates a folder named 'Test Cases'. Consistent with glowscript.org, this folder name is converted to 'Test%20Cases' and used as the key in a PUT operation:

folder = 'Test%20Cases' f = Folder( parent = username, key_name = folder, public=True ) # Folder inherits from db.Model f.put()

What I see in the log when running with Python 2.7 and launcher 1.7.6 is that the '%20' has been converted back to a space:

"PUT /api/user/test0324k/folder/Test Cases HTTP/1.1" 200 -

When I do the same operations (locally) with Python 2.5 and GAE Launcher 1.7.2, this is what I see in the log:

"PUT /api/user/test0324k/folder/Test%20Cases HTTP/1.1" 200 -

If I deploy to the web, users will get errors because their data has keys that contain '%20', and there now would be no way to reach those keys. I can't stay with the Python 2.5 version, because it is already deprecated and will soon disappear. What can I do to move forward, without destroying many people's work?

1
Why don't you replace spaces in your Folder model? Just before put-ing it.Ilia Frenkel
Those log messages have nothing to do with datastore. They're logging HTTP PUT requests.Peter McKenzie

1 Answers

0
votes

"I can't stay with the Python 2.5 version, because it is already deprecated and will soon disappear."

We announced the deprecation of Python 2.5 on March 8, 2013 in a blog post, which cited our Deprecation Policy (Section 7.2 of https://developers.google.com/appengine/terms). I suggest reading it. That section is short and to the point.

Any unexpected change you see between our Python 2.5 and 2.7 stacks is worth reporting. Please submit a report via the normal channels. (You can pretty much copy/paste what you've written here.)

That said (and this is my personal opinion, not Google's) making a key with a %20 in it, and then putting that into a url without escaping it is skating very thin ice.