string reading bug in ActiveState Python 2.2 ?
Max M
maxm at mxm.dk
Tue Sep 3 04:58:58 EDT 2002
Axel Kowald wrote:
> I'm using ActiveStates Python 2.2.1 under win2000 to read in the
> attached text file and it seems that python is only reading part of the
> string. After
>
> fp = open("bla.txt")
> z = fp.read()
> print len(z), z
>
> I see that only 11 of the 15 characters have been read. I know they are
> non-printable characters, but that shouldn't matter, should it ? Using
> another python on one of our unix machines everything works as expected
> and all 15 chars are read in. Is that there something special about
> windows that I should know, or is this a bug in ActiveStates Python ?
Probably you should open it as a binary file:
fp = open("bla.txt","b")
regards max M
More information about the Python-list
mailing list