79302841

Date: 2024-12-23 10:53:16
Score: 1
Natty:
Report link

You have to make fp global variable. What you get is fp descriptor is lost after subroutine ended, file closes, lock gets freed.

def lockFile(lockfile):
    global fp
    fp = open(lockfile, 'w') # create a new one
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Дмитрий Лапчик