[Zope] windos and linux

Martijn Pieters mj at zopatista.com
Sun May 27 14:54:48 EDT 2007


On 5/27/07, Einar Næss Jensen <einar.nass.jensen at gmail.com> wrote:
> this snippet behaves differently on windows and linux:
> http://zope.pastey.net/42188-1gbl
>
> I would be thankful of any clues to why.
> in linux it copies a gif picture off the filesystem and into the zodb.
> In windows. the object gets created but no gif is present.also no
> errors in the log

Use open(dir, 'rb').read() instead, opening the file in binary mode.
Windows treats textfiles and binary files differently, thus mangling
your GIF file if opened in text mode.

-- 
Martijn Pieters


More information about the Zope mailing list