0

I get an error in my python app on GAE (in my localhost) saying:

variable xyz in line 23 expects string.... bool given --- SUPPOSE

Now, to fix that error i remove the entire line 23 and, thus, there is no variable called xyz in my script anymore. (I used ctrl+F to find xyz and i ensured there is no xyz in my script).

Then i hit refresh on the browser and even then i get the exactly same error again.

variable xyz in line 23 expects string.... bool given --- meaning the code changes from my editor have not taken any effect in the GAE runtime, i suppose.

I refreshed the page several times... I gave the chrome browser some time... I refreshed the page again... no luck. Then I noticed that the code changes took effect ONLY WHEN I stopped and re-ran the python app from the GAE launcher.

Now, having to do this every time i updated the code is a pain. How do i fix this literal chaos? GAE just got updated on my Mac OS X 10.7.5 a few days ago.

Rakib
  • 12,376
  • 16
  • 77
  • 113
  • please try restarting the server, sometimes it doesn't catches the changes. – Ashwini Chaudhary Nov 11 '12 at 13:36
  • 1
    Possible duplicate of [App Engine Development Server Does Not Reload Code When Changed](http://stackoverflow.com/q/5508637), perhaps? – Martijn Pieters Nov 11 '12 at 13:37
  • @MartijnPieters, the answer given in the possible duplicate is related to importing a library or something for structured directories... i have a flat structure with no directories... just learning python now... it didn't address my problem... thanks for the reference though – Rakib Nov 11 '12 at 14:17
  • @AshwiniChaudhary, isn't restarting the server same as stopping and re-running the python app from the GAE launcher? – Rakib Nov 11 '12 at 14:17
  • alright, i noticed something here..... after fixing some indentation issues, my problem was fixed... VERY weird... shouldn't the browser output have reported the matter? – Rakib Nov 11 '12 at 14:18

1 Answers1

1

If you're seeing this with 1.7.3 and not with 1.7.2, you're likely running into http://code.google.com/p/googleappengine/issues/detail?id=8383

The proposed solution (although not a fix, i guess) as given in the link above is to edit the file at $(GAE_SDK_ROOT)/google/appengine/tools/dev_appserver.py. Open the file and find the procedure definition of def AreModuleFilesModified(self). Then inside that procedure definition, place this line self._dirty = True as the FIRST line after the docstring and BEFORE the for-loop begins.

Note that there are 2 dev_appserver.py files in GAE

  1. $(GAE_SDK_ROOT)/dev_appserver.py
  2. $(GAE_SDK_ROOT)/google/appengine/tools/dev_appserver.py

We want to edit the file no. 2 and not the file no. 1

Rakib
  • 12,376
  • 16
  • 77
  • 113
Anand Mistry
  • 512
  • 2
  • 4