Re: [Zope] windos and linux

2007-05-27 Thread Andreas Jung



--On 27. Mai 2007 20:45:18 +0200 Einar Næss Jensen 
[EMAIL PROTECTED] 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




This code is pretty much worthless without knowing the code for
the ProfilPicture implementation. Likely your image can't be read
under Windows (for whatever reason). You should use pdb and debug
the related code on Windows.

-aj

pgpqw1S0sbGWr.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] windos and linux

2007-05-27 Thread Martijn Pieters

On 5/27/07, Einar Næss Jensen [EMAIL PROTECTED] 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
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )