daily pastebin goal
69%
SHARE
TWEET

Untitled

a guest Jul 19th, 2018 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --- dev_appserver.py.orig       2011-01-10 00:17:28.000000000 +0900
  2. +++ dev_appserver.py    2011-01-10 00:42:43.000000000 +0900
  3. @@ -948,6 +948,11 @@
  4.    return [os.path.join(*p) + s for s, m, t in suffixes]
  5.  
  6.  
  7. +def py_file(file):
  8. +  if (file.endswith(".pyc") or file.endswith(".pyo")):
  9. +    file = file[:-1]
  10. +  return file
  11. +
  12.  class FakeFile(file):
  13.    """File sub-class that enforces the security restrictions of the production
  14.    environment.
  15. @@ -960,10 +965,10 @@
  16.                        if os.path.isfile(filename))
  17.  
  18.    ALLOWED_DIRS = set([
  19. -      os.path.normcase(os.path.realpath(os.path.dirname(os.__file__))),
  20. -      os.path.normcase(os.path.abspath(os.path.dirname(os.__file__))),
  21. -      os.path.normcase(os.path.dirname(os.path.realpath(os.__file__))),
  22. -      os.path.normcase(os.path.dirname(os.path.abspath(os.__file__))),
  23. +      os.path.normcase(os.path.realpath(os.path.dirname(py_file(os.__file__)))),
  24. +      os.path.normcase(os.path.abspath(os.path.dirname(py_file(os.__file__)))),
  25. +      os.path.normcase(os.path.dirname(os.path.realpath(py_file(os.__file__)))),
  26. +      os.path.normcase(os.path.dirname(os.path.abspath(py_file(os.__file__)))),
  27.    ])
  28.  
  29.    NOT_ALLOWED_DIRS = set([
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top