File-writing not working in Windows?

jay graves jaywgraves at gmail.com
Fri Jun 6 14:58:03 EDT 2008


On Jun 6, 1:22 pm, tda... at gmail.com wrote:
> I am thinking that the "g.open(tempFileName, 'a')" command is the
> issue.  Is there anything different about opening a file in Windows?
> Does Windows understand "append", or would I have to do control checks
> for seeing if the file is created and then appending?

Does your file have embedded nulls?
Try opening it in binary mode.

g.open(tempFileName,'ab')

Note that this will turn off Universal newline support.

Barring that, can you distill the problem down by writing a script
that exhibits the behavior without the rest of your program?

...
Jay



More information about the Python-list mailing list