python - “make”命令权限被拒绝
问题描述
我有一个 Django 应用程序,它有一个我命名的自定义文件夹codefiles
。在其中,有许多随机名称的子文件夹。此外,在每个文件夹中,都有一个 Makefile。我目前很困惑为什么OSError: [Errno 13] Permission denied
当我调用以下代码时它会说:
p = subprocess.Popen(["make", "-f", os.path.join(directory, "Makefile")], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True, shell=True)
这里可能有什么问题?
编辑:即使调用下面的代码也会导致 Permission denied 错误:
current_directory = os.getcwd()
logging.debug("current_dir: " + str(current_directory));
EDIT2:这越来越奇怪了。即使是评论也会导致 Permission denied 错误。这是错误日志:
File "./src/tasks/views.py", line 1178, in test_run_code
# create the make file
File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
raise child_exception
OSError: [Errno 13] Permission denied
解决方案
推荐阅读
- c# - 最大长度验证阻止我在 mvc6 中编写超过最大长度的内容
- python - 在 FTP 发送/接收软件的 while 循环中尝试/排除块
- aframe - AR.js 场景中可点击对象的位置错误
- python - 为什么我不能总结熊猫的价值?
- mysql - Sequelize 模型导出函数
- c# - 认知服务语音产生空文件
- objective-c - IOS-FreeRDP--ios 源无法运行 ENABLE_BITCODE=YES 设置不起作用
- c++ - MFC 图标没有变化
- mongodb - MongoDB查询以获取与具有多个值的键匹配的所有文档
- html - 如何制作嵌套的 ngFor?[角度和离子]