【发布时间】:2013-05-28 11:11:45
【问题描述】:
我已经成功地在谷歌应用引擎中部署了我的 python 和瓶子框架应用程序,但是,我遇到了最奇怪的错误之一。
每当我尝试打开文件进行写入时,我都会收到错误消息,
Error: 500 Internal Server Error
Sorry, the requested URL 'http://issamcodemate.appspot.com/' caused an error:
Internal Server Error
当我在服务器端执行以下任何语句时,会发生这种情况,
f = open("Files/currentFile.txt",'r+')
f = open("Files/currentFile.txt",'w')
f = open("Files/currentFile.txt",'a')
奇怪的是,当我执行这段代码时它工作正常,
f = open("Files/currentFile.txt",'r')
但这只是为了阅读......
提前谢谢..
【问题讨论】:
-
您是否有权以写入模式打开该文件?
-
我猜它的权限,但这将如何解决?自托管
-
我没用过GAE,但是试试看:os.chmod
-
单独执行os.chmod也会出现同样的错误,可能还需要权限才能更改权限:)。它必须在设置中的某个位置才能为代码提供完全的管理员访问权限
标签: python google-app-engine web bottle