lockfile.acquire doesn't accept a timeout of 0
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pylockfile |
Fix Released
|
Undecided
|
Davanum Srinivas (DIMS) |
Bug Description
The documentation for lockfile.acquire (http://
LockFile.
Lock the file associated with the LockFile object. If the timeout is omitted or None the caller will block until the file is unlocked by the object currently holding the lock. If the timeout is zero or a negative number the AlreadyLocked exception will be raised if the file is currently locked by another process or thread. If the timeout is positive, the caller will block for that many seconds waiting for the lock to be released. If the lock is not released within that period the LockTimeout exception will be raised.
Indicates that lock.acquire(
timeout = timeout is not None and timeout or self.timeout
when timeout is 0 causes it to default to self.timeout, which by default is None.
Either 0 should be special cased so that the documentation is correct (preferable because users may already expect that to work) or the documentation needs to be updated to indicate a negative number is the only way to indicate that acquire shouldn't block.
Thanks.
Changed in pylockfile: | |
assignee: | nobody → Davanum Srinivas (DIMS) (dims-v) |
status: | New → In Progress |
Changed in pylockfile: | |
milestone: | none → 0.11.0 |
status: | Fix Committed → Fix Released |
Now that I see all of the open issues, I can see that this is effectively a duplicate of https:/ /bugs.launchpad .net/pylockfile /+bug/1419127.