Fri, 17 Jan 2003
Locking files (or not) the win98 way, part 3...

James Kew was kind enough to try out the revised portalocker code on both win98 and winnt. The code itself had an error due to my cut-n-paste. Unfortunately, it also still doesn't work so he's going to try a hybrid of the "old" code and the Seila King code.

Fingers crossed...

path: /python | permanent link |
SpamBayes finally out!

Anthony has packaged up a pre-release bundle of the first version of the SpamBayes project.

SpamBayes will attempt to classify incoming email messages as 'spam', 'ham' (good, non-spam email) or 'unsure'. This means you can have spam or unsure messages automatically filed away in a different mail folder, where it won't interrupt your email reading.

w00t!

path: /python | permanent link |
The future of PyPI...

Well, people have started actively noticing my PyPI efforts. And commenting, in generally positive ways. No killer bugs yet.

Some people (hi, Hans, Uche, Jarno and Garth) have started talking about the possibilities of building a Python CPAN-alike. Just thought I'd let people know where I stand on the issue :)

My aim with the initial version of PyPI was to simply get the thing moving. As mentioned in the PEP, I deliberately limited the scope of work to something that I felt I could reasonably achieve with the time available and have accepted by the community.

Once Python 2.3 is out, and the world starts using the python.org repository, then I hope that others will integrate PyPI into their pypan or similar projects.

I'm also hoping that people will volunteer to write things like the trove "discovery" display that'll let people drill down through the classifiers to find stuff they're interested in...

The project code is on sourceforge and I welcome contributors :)

path: /python | permanent link |
Locking files (or not) the win98 way, part 2...

Oliver Rutherfurd sent me an email saying that he got portalocker working on win98 using the following nt-specific code:

if os.name == 'nt':
    def lock(file, flags):
        hfile = win32file._get_osfhandle(file.fileno())
        #win32file.LockFileEx(hfile, flags, 0, 0xffff0000, __overlapped)
        win32file.LockFileEx(hfile, 0, 0, 0xffff0000,0)

    def unlock(file):
        hfile = win32file._get_osfhandle(file.fileno())
        #win32file.UnlockFileEx(hfile, 0, 0xffff0000, __overlapped)
        win32file.UnlockFileEx(hfile, 0, 0, 0xffff0000,0)

The commented-out bits are the original code. When I last looked into this, people were saying that win98 doesn't even have the LockFileEx or UnLockFileEx methods, but that I'd have to use the non-Ex versions. It looks like the reality is just that last __overlapped argument. Huh.

Well, I've put out a call to win98 and winnt users to try out the altered portalocker.py code and hopefully it'll work on both and I can get Roundup 0.5.5 out. To test the code on your system, just run it twice. The second invocation should wait (indefinitely) until you hit enter in the first.

path: /python | permanent link |