Python 2.6, File read() problems in Windows Xp

pruebauno at latinmail.com pruebauno at latinmail.com
Fri May 8 09:20:37 EDT 2009


On May 8, 5:08 am, Li Wang <li.wan... at gmail.com> wrote:
> Hi  Dave:
> Thank you very much for you explanation:)
>
> > Chances are you forgot the "b" parameter to open().  Unnecessary in Unix, it
> > tells the library to *not* translate \r\n  to \n upon read, or the inverse
> > on write.  In other words, with the "b" parameter, the file is read in
> > unchanged.
>
> So, if I am using python in Linux, do open('file', 'r') and
> open('file', 'rb') work the same way?
>
> Thanks,
>
> Best regards,
> Li

In old Python up to 2.6, YES.



More information about the Python-list mailing list