gettext crazy question

Martin v. Löwis martin at v.loewis.de
Sat Nov 22 07:17:44 EST 2003


ulysses_dm at yahoo.com.cn (ulysses) writes:

> So I debug gettext module. I find following interest question.
> -=gettext line 154=-
>   buf = fp.read()
> 
> I sure fp(file object) has open.
> 
> It can't read all binary code.  buf 's lengh smaller than real file.
> exp ,whole file 1000 byte. gettext only read 187 .  

It looks like the file is opened in text mode, not in binary mode.

Did you, by chance, open the file yourself? You should use binary
mode, then.

Regards,
Martin




More information about the Python-list mailing list