[Sugar-devel] help wanted answering a dsobject.set_file_path question

Gary Martin garycmartin at googlemail.com
Sat Dec 10 20:09:28 EST 2011


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).

--G

> 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
> -- 
> Walter Bender
> Sugar Labs
> http://www.sugarlabs.org
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel



More information about the Sugar-devel mailing list