Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- dev_appserver.py.orig 2011-01-10 00:17:28.000000000 +0900
- +++ dev_appserver.py 2011-01-10 00:42:43.000000000 +0900
- @@ -948,6 +948,11 @@
- return [os.path.join(*p) + s for s, m, t in suffixes]
- +def py_file(file):
- + if (file.endswith(".pyc") or file.endswith(".pyo")):
- + file = file[:-1]
- + return file
- +
- class FakeFile(file):
- """File sub-class that enforces the security restrictions of the production
- environment.
- @@ -960,10 +965,10 @@
- if os.path.isfile(filename))
- ALLOWED_DIRS = set([
- - os.path.normcase(os.path.realpath(os.path.dirname(os.__file__))),
- - os.path.normcase(os.path.abspath(os.path.dirname(os.__file__))),
- - os.path.normcase(os.path.dirname(os.path.realpath(os.__file__))),
- - os.path.normcase(os.path.dirname(os.path.abspath(os.__file__))),
- + os.path.normcase(os.path.realpath(os.path.dirname(py_file(os.__file__)))),
- + os.path.normcase(os.path.abspath(os.path.dirname(py_file(os.__file__)))),
- + os.path.normcase(os.path.dirname(os.path.realpath(py_file(os.__file__)))),
- + os.path.normcase(os.path.dirname(os.path.abspath(py_file(os.__file__)))),
- ])
- NOT_ALLOWED_DIRS = set([
Add Comment
Please, Sign In to add comment