Re: [Python-Dev] Does Python need a file locking module (slightly higher level)?

2007-10-22 Thread skip
>> I'm always daunted by the prospect of trying to implement file >> locking. Barry> If you want something like this, you might start by looking at Barry> Mailman's LockFile.py. If I interpret the Python documentation for os.link correctly, the scheme used by Mailman won't work o

Re: [Python-Dev] Does Python need a file locking module (slightly higher level)?

2007-10-22 Thread Jean-Paul Calderone
On Tue, 23 Oct 2007 01:11:39 +0100, Jon Ribbens <[EMAIL PROTECTED]> wrote: >On Tue, Oct 23, 2007 at 12:29:35PM +1300, Greg Ewing wrote: >> [EMAIL PROTECTED] wrote: >> > Does fcntl.flock work over NFS and SMB and on Windows? >> >> I don't think file locking will ever work over NFS, since >> it's a s

Re: [Python-Dev] Does Python need a file locking module (slightly higher level)?

2007-10-22 Thread Jon Ribbens
On Tue, Oct 23, 2007 at 12:29:35PM +1300, Greg Ewing wrote: > [EMAIL PROTECTED] wrote: > > Does fcntl.flock work over NFS and SMB and on Windows? > > I don't think file locking will ever work over NFS, since > it's a stateless protocol by design, and locking would > require maintaining state on th

Re: [Python-Dev] Does Python need a file locking module (slightly higher level)?

2007-10-22 Thread Jon Ribbens
On Tue, Oct 23, 2007 at 12:16:41PM +1300, Greg Ewing wrote: > [EMAIL PROTECTED] wrote: > > This interface follows the completely stupid semantics of System V and > > IEEE Std 1003.1-1988 (``POSIX.1'') that require that all locks > > associated with a file for a given process are removed

Re: [Python-Dev] Python 2.5.1 ported to z/OS and EBCDIC

2007-10-22 Thread Terry Reedy
"Lauri Alanko" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | All this just shows that treating plain octet sequences as "strings" | simply won't work in the long run. You have to have separate type for | _textual_ data (i.e. Unicode strings, in Python), and encode and decode | bet

Re: [Python-Dev] Python 2.5.1 ported to z/OS and EBCDIC

2007-10-22 Thread Greg Ewing
Lauri Alanko wrote: > In the end, for now, I made protocol 0 textual, That could be a mistake. I believe there are some objects, such as array.array, that use a binary format for pickling even in protocol 0. -- Greg ___ Python-Dev mailing list Python-De

Re: [Python-Dev] Does Python need a file locking module (slightly higher level)?

2007-10-22 Thread Greg Ewing
[EMAIL PROTECTED] wrote: > Does fcntl.flock work over NFS and SMB and on Windows? I don't think file locking will ever work over NFS, since it's a stateless protocol by design, and locking would require maintaining state on the server. -- Greg ___ Pytho

Re: [Python-Dev] Does Python need a file locking module (slightly higher level)?

2007-10-22 Thread Greg Ewing
[EMAIL PROTECTED] wrote: > This interface follows the completely stupid semantics of System V and > IEEE Std 1003.1-1988 (``POSIX.1'') that require that all locks > associated with a file for a given process are removed when any file > descriptor for that file is closed by that proc

[Python-Dev] Patch for adding offset to mmap

2007-10-22 Thread Travis Oliphant
Hi all, I think the latest patch for fixing Issue 708374 (adding offset to mmap) should be committed to SVN. I will do it, if nobody opposes the plan. I think it is a very important addition and greatly increases the capability of the mmap module. Thanks, -Travis Oliphant P.S. Initially sen

Re: [Python-Dev] Does Python need a file locking module (slightly higher level)?

2007-10-22 Thread Benji York
Barry Warsaw wrote: > On Oct 22, 2007, at 8:15 AM, [EMAIL PROTECTED] wrote: > >> I'm always daunted by the prospect of trying to implement file >> locking. > If you want something like this, you might start by looking at > Mailman's LockFile.py. Also related is the very simple zc.lockfile:

Re: [Python-Dev] Does Python need a file locking module (slightly higher level)?

2007-10-22 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Oct 22, 2007, at 8:15 AM, [EMAIL PROTECTED] wrote: > I'm always daunted by the prospect of trying to implement file > locking. > This just came up again in SpamBayes where we have never protected our > pickle files from corruption when multiple p

[Python-Dev] Python 2.5.1 ported to z/OS and EBCDIC

2007-10-22 Thread Lauri Alanko
Hello. Based on Jean-Yves Mengant's work on previous versions, I have ported Python 2.5.1 to z/OS. A patch against current svn head is attached to . The same patch should work with very little changes also against pristine 2.5.1 sources. (The only failing hunk is

[Python-Dev] Does Python need a file locking module (slightly higher level)?

2007-10-22 Thread skip
I'm always daunted by the prospect of trying to implement file locking. This just came up again in SpamBayes where we have never protected our pickle files from corruption when multiple processes access them simultaneously. The presence of networked file systems and platform-independent locks mak