Commits

Shinya Okano committed 398e65a

pickleできない項目は無効化するように変更

Comments (0)

Files changed (1)

apphosting/handler.py

 # coding:utf-8
 # WSGIハンドラ
+import logging
+
 from apphosting.pool import Pool
 from apphosting.router import DomainRouter, UserDomainRouter
 
         else:
             environ['wsgi.input'] = StringIO()
 
+        # 残りのpickle化できない項目は潰す
+        import pickle
+        for k, v in environ.iteritems():
+            try:
+                pickle.dumps(v)
+            except:
+                logging.warn('%s: %s does not pickling.' % (k, v))
+                environ[k] = None
+
         app_name = self.get_app_name(environ)
         if not app_name or not self.pool.has_application(app_name):
             return self.handler404(environ, start_response)