Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #88392 > unrolled thread

Re: Lockfile hanling

Started byErvin Hegedüs <airween@gmail.com>
First post2015-03-31 17:56 +0200
Last post2015-03-31 17:56 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Lockfile hanling Ervin Hegedüs <airween@gmail.com> - 2015-03-31 17:56 +0200

#88392 — Re: Lockfile hanling

FromErvin Hegedüs <airween@gmail.com>
Date2015-03-31 17:56 +0200
SubjectRe: Lockfile hanling
Message-ID<mailman.379.1427817358.10327.python-list@python.org>
Hi Skip,

On Tue, Mar 31, 2015 at 10:19:27AM -0500, Skip Montanaro wrote:
> > sorry - at the end of the function there is a close() method to a
> > file, after the thread passes the modifications:
> >
> >     try:
> >         os.remove(self.lockfile)
> >     except:
> >         syslog.syslog(syslog.LOG_DEBUG, "Sync error: " + str(sys.exc_info()[1]))
> 
> Hmmm... Still not seeing os.close(fl)...
> 
> > And I think, the "(deleted)" info near the filename in proc/PID/fd
> > means the lockfile had been deleted.
> 
> os.remove() will remove the lockfile name from the directory. It
> doesn't automatically close the file.

ah, well, many-many-many thanks - that was what I misses...

> >> You might consider the pylockfile module...
> 
> > sounds good, thanks - what's the minimal version of Python? I've
> > only 2.5 on that server...
> 
> When I was still maintaining it, it worked with 2.5, and I distributed
> a patch you could apply to get it to work with 2.4. I'm not sure if
> the current maintainers have changed that. You'd have to look. If
> worse comes to worst, I believe 0.9.1 (the last version I released)
> should still work with 2.5.

thanks for the info - now it works as very well.


a.
 

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web