[Sugar-devel] help wanted answering a dsobject.set_file_path question
walter.bender at gmail.com
Sat Dec 10 22:49:35 EST 2011
On Sat, Dec 10, 2011 at 8:09 PM, Gary Martin <garycmartin at googlemail.com> wrote:
> Hi Walter,
> On 10 Dec 2011, at 22:03, Walter Bender wrote:
>> I've been pulling my hair out over this one all day:
> Hmmm, very likely making a dumb suggestion here, but just had a quick look. I can't see a closing of the file handle – perhaps the csv module does some magic? The examples at http://docs.python.org/library/csv.html don't seem to show explicitly closing the file handle (though they are all using a 'with' statement which likely tears things down correctly when it exits).
Will report back.
>> I create a file and a new datastore object and then use set_file_path
>> to associate the file with the object (something I have done
>> repeatedly in many activities. But for some reason, the file in the
>> dsobject is empty. Any clues as to what I may be doing wrong?
>> See http://git.sugarlabs.org/measure/mainline/blobs/master/measure.py
>> beginning on line 338.
>> The temporary file is "dataful" as expected and the other place I copy
>> the same data to in the Journal works as expected.
>> Walter Bender
>> Sugar Labs
>> Sugar-devel mailing list
>> Sugar-devel at lists.sugarlabs.org
More information about the Sugar-devel