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


Groups > comp.lang.python > #88392

Re: Lockfile hanling

Path csiph.com!usenet.pasdenom.info!bete-des-vosges.org!news.redatomik.org!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <airween@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.033
X-Spam-Evidence '*H*': 0.93; '*S*': 0.00; 'error:': 0.07; 'think,': 0.07; 'except:': 0.09; 'filename': 0.09; 'try:': 0.09; 'worse': 0.09; 'cc:addr:python-list': 0.11; 'thread': 0.14; 'ah,': 0.16; 'maintainers': 0.16; 'wrote:': 0.18; 'file,': 0.19; '(the': 0.22; 'python?': 0.22; 'cc:addr:python.org': 0.22; 'header:User- Agent:1': 0.23; '31,': 0.24; 'deleted.': 0.24; 'directory.': 0.24; 'passes': 0.24; 'skip': 0.24; 'file.': 0.24; 'cc:2**0': 0.24; "i've": 0.25; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'patch': 0.29; "doesn't": 0.30; "i'm": 0.30; 'that.': 0.31; 'maintaining': 0.32; 'worked': 0.33; 'minimal': 0.33; 'could': 0.34; 'info': 0.35; 'skip:s 30': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'version': 0.36; 'method': 0.36; 'thanks': 0.36; 'should': 0.36; 'skip:o 20': 0.38; 'sure': 0.39; 'changed': 0.39; 'remove': 0.60; 'from:charset:utf-8': 0.61; 'content- disposition:inline': 0.62; 'name': 0.63; 'to:addr:gmail.com': 0.65; 'close': 0.67; 'believe': 0.68; 'mar': 0.68; '2.5.': 0.84; '2015': 0.84; 'look.': 0.84; 'good,': 0.91; 'received:86': 0.91; 'received:hu': 0.93
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=3J4G8fpYcW7qeI2z3Fg4+4Oyv7PaYB/o2wxSjjjdUko=; b=Zh/tmiQjNNT7MBqEG9NnUD2Wv84zcXA3JA96XYQygLZC8NlrXJf8E5hyZ8lXdecrVg XowIFJ02x1Cbl19u1xA2gaXu6V3eYa6oRwKTo2q28plkZibT8tUWDgwWKFZ2QTFnoQrH +cNvtWqAv39dLp5bEGqHUvj78wMucRmTViV4rCqVfNXGZjc77nUWY3qG4BlhvAHZKsfj PTCPKzuejZtxTLQUV5+d0KiKKh3YbXuusLLCdninr+Gjkk4j+u5jy5AYC/51I2x42OhX GFnryy9TZkZFT3sid2apLHj4PFFPqgD6Fu/U4f+05IKJk1t5sEeOlpDYltUsj/FWSziG Y3pw==
X-Received by 10.194.90.7 with SMTP id bs7mr73511124wjb.7.1427817350090; Tue, 31 Mar 2015 08:55:50 -0700 (PDT)
Date Tue, 31 Mar 2015 17:56:26 +0200
From Ervin Hegedüs <airween@gmail.com>
To Skip Montanaro <skip.montanaro@gmail.com>
Cc Python <python-list@python.org>
Subject Re: Lockfile hanling
References <20150331145012.GA4460@arxnet.hu> <CANc-5Uxa9BZhx2uNMr=ERs7TALCsnKH58YSPW0fVMws9WHJ_+w@mail.gmail.com> <20150331150656.GA4740@arxnet.hu> <CANc-5Uw3A+1csn-w7B=ZP7UCTO9vpjCvKgH8-q23FT3OytvfBA@mail.gmail.com>
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Disposition inline
In-Reply-To <CANc-5Uw3A+1csn-w7B=ZP7UCTO9vpjCvKgH8-q23FT3OytvfBA@mail.gmail.com>
User-Agent Mutt/1.5.21 (2010-09-15)
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.19
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.379.1427817358.10327.python-list@python.org> (permalink)
Lines 37
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1427817358 news.xs4all.nl 2867 [2001:888:2000:d::a6]:35038
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:88392

Show key headers only | View raw


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.
 

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web