durusmail: durus-users: Durus 3.7 and Windows
Durus 3.7 and Windows
2007-08-08
2007-08-08
2007-08-08
2007-08-13
2007-08-14
2007-08-14
2007-08-14
2007-08-14
2007-08-15
2007-08-15
2007-08-15
2007-08-15
2007-08-15
Durus 3.7 and Windows
Matthew Scott
2007-08-15
Here are some fixes for durus.file to get it to work right on Windows.

I haven't yet tested the rest of Durus, but utest_file passes now, and
it didn't before :-)  I'll post a more general report soon.

Rather than post the diff here, I'll post an URL to a changeset on the
Schevo Trac: http://schevo.org/changeset/3468

Changes to durus.file:

 * On Windows, call flush() on the wrapped file object after a write
operation to prevent garbage output from future read() operations.

 * Attach read(n) and tell() instance methods from the wrapped file
object directly to a new File instance.  As their behavior is not
extended, attaching them directly to the File instance will perform
better than using wrapper methods.

 * Define platform-dependent methods during class creation, rather
than determining execution paths during method calls.

Changes to utest_file.py:

 * On Windows, check for pywintypes.error instead of IOError when
checking for proper file locking.

 * On Windows, close files before unlinking them, to prevent unwanted
lock errors.

--
Matthew R. Scott
If my mail is terse, see http://five.sentenc.es/
reply