# This module is just too important for development.
# The second part of this hack is in runserver.py which adds
# important environment variables like PATH etc.
- if not on_production_server:
+ if not on_production_server:
from google.appengine.api.mail_stub import subprocess
sys.modules['subprocess'] = subprocess
+ # subprocess in Python 2.5 on Linux and OS X uses the buffer()
+ # builtin which unfortunately gets removed by the GAE SDK, so
+ # we have to get it back with this ugly hack
+ sys.modules['subprocess'].buffer = inspect.currentframe().f_back.f_back.f_back.f_locals['old_builtin']['buffer']
logging.warn('Could not add the subprocess module to the sandbox.')