April
8th 2008
Tags: Bug, Google, Google App Engine, Patch, Python
There’s a bug in the way the windows version of the Google App Engine SDK handles static directory handling. Basically, the way the SDK figures out the request URL and path to map it to don’t handle the backslashes properly. Single backslashes are left in the variable that is later used in a regular expression match. Here’s what you can do to modify the code to escape the path and make the SDK work on windows:
Open up this file in your favorite editor: C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py
Search for this code block: (line 2369)
regex = os.path.join(re.escape(regex), '(.*)') path = os.path.join(path, '\\1')
Replace it with these lines:
# urls should always have forward slashes regex = re.escape(regex) + '/(.*)' # be careful turning paths into regex strings path = re.escape(path + os.sep) + '\\1'