Bugs item #1367814, was opened at 2005-11-27 17:31
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1367814&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Chris Fuller (cfuller)
Assigned to: Nobody/Anonymous (nobody)
Summary: loogger module locks

Initial Comment:
I have an application that uses the logger
functionality, and the RotatingFileHandler class. If my
application is running, and another instance is
launched, it fails at the rollover step. I don't want
multiple instances running at once, so this is fine,
and even general, since the rollover must occur if an
instance is already running.

Rather than checking for a generic I/O error, however,
I'd like to use some sort of locking mechanism that is
less opaque. The locking provided won't work, since it
is blocking only: the application deadlocks if one ias
runnning already. Why doesn't it work like a normal
Lock() instance and take a blocking parameter?

I could use locking via the portalocker module from the
python cookbook (hmm, portable file locking would be a
nice thing to have in the standard library, the logger
module already does it anyway!) but I can't find anyway
to access the file descriptor!

Sure, I could workaround that. I could create a
RotatingFileHandler instance, roll over, close it, open
the file, pass it to StreamHandler, but python is way
more elegant than that.

For now, I'll just trap the rollover. Still very cool
stuff!


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1367814&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to