[contestms] CMS with Python3

  • From: Gary Conway <gconway@xxxxxxxxxxxxxxxx>
  • To: contestms@xxxxxxxxxxxxx
  • Date: Fri, 19 Feb 2016 11:01:32 +0000


Hi,

I have converted my cms to use Python3 as instructed in cms/grading/__init__.py:

py_command = ["/usr/bin/python3", "-m", "py_compile", source_filenames[0]]
mv_command = ["/bin/mv", "__pycache__/%s.*.pyc" % os.path.splitext(os.path.basename(source_filenames[0]))[0], executable_filename]

and re-installed.

but when I submit a python3 solution, compilation fails with:
/bin/mv: cannot stat ‘__pycache__/p1.*.pyc’: No such file or directory

cmsLogService reports:
2016/02/19 10:44:29 - WARNING [Worker,1] Couldn't delete sandbox.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/cms-1.1.0-py2.7.egg/cms/grading/TaskType.py", line 80, in delete_sandbox
    sandbox.delete()
File "/usr/local/lib/python2.7/dist-packages/cms-1.1.0-py2.7.egg/cms/grading/Sandbox.py", line 1246, in delete
    rmtree(self.outer_temp_dir)
File "/usr/local/lib/python2.7/dist-packages/cms-1.1.0-py2.7.egg/cms/io/GeventUtils.py", line 228, in rmtree
    rmtree(fullname, ignore_errors, onerror)
File "/usr/local/lib/python2.7/dist-packages/cms-1.1.0-py2.7.egg/cms/io/GeventUtils.py", line 228, in rmtree
    rmtree(fullname, ignore_errors, onerror)
File "/usr/local/lib/python2.7/dist-packages/cms-1.1.0-py2.7.egg/cms/io/GeventUtils.py", line 234, in rmtree
    onerror(os.remove, fullname, sys.exc_info())
File "/usr/local/lib/python2.7/dist-packages/cms-1.1.0-py2.7.egg/cms/io/GeventUtils.py", line 232, in rmtree
    os.remove(fullname)
OSError: [Errno 13] Permission denied: '/tmp/tmpq8a_bD/tmp/__pycache__/p1.cpython-34.pyc'

This pyc file has unknown id:
localadm@aipo-cms3:~$ lsl /tmp/tmpq8a_bD/tmp/__pycache__/p1.cpython-34.pyc
-rw-r--r-- 1 60020 60020 542 Feb 19 10:44 /tmp/tmpq8a_bD/tmp/__pycache__/p1.cpython-34.pyc
localadm@aipo-cms3:~$ id cmsuser
uid=999(cmsuser) gid=999(cmsuser) groups=999(cmsuser)
localadm@aipo-cms3:~$ id 60020
id: 60020: no such user

Please advice!!





Other related posts: