Fix incorrect read/write handling in "object_store.py".
authorRisto Kankkunen <risto.kankkunen@iki.fi>
Wed, 18 Jan 2012 16:11:54 +0000 (18:11 +0200)
committerRisto Kankkunen <risto.kankkunen@iki.fi>
Wed, 18 Jan 2012 16:11:54 +0000 (18:11 +0200)
commit0553f7723be3a1a0c8f58816056eaa3c357fb1dd
tree93c50f4948d456bd8d65dc580c7a05520f0e4953
parent5d774e512beee1041647cf608f9acd7ef95c07f0
Fix incorrect read/write handling in "object_store.py".

When using C stdio library, the stream must be flushed or repositioned before
switching from write operations to read operations or vv. This applies to
CPython as well since "File objects are implemented using C’s stdio package".
http://docs.python.org/library/stdtypes.html#file-objects

See also http://bugs.python.org/issue3207.

DiskObjectStore._complete_thin_pack() didn't follow these rules which made the
test

  dulwich.tests.test_object_store.DiskObjectStoreTests:test_add_thin_pack

fail with

  IOError: [Errno 0] Error

on Windows.
dulwich/object_store.py