"rbt" wrote:
> I'm using 'rb' in a situation where all files on the drive are opened. I'm
> not checking how the
> file is encoded before opening it (text, unicode, jpeg, etc.) That's why I
> though 'rb' would be
> safest.
if "safest way to open files" meant "safest way to open binary files",
Fredrik Lundh wrote:
"rbt" wrote:
I believe that this is the safest way to open files on Windows, Linux, Mac and Unix, but I wanted
to ask here just to be sure:
fp = file('filename', 'rb')
The 'b' on the end being the most important ingredient (especially on Windows as a simple 'r' on a
binary
"rbt" wrote:
>I believe that this is the safest way to open files on Windows, Linux, Mac and
>Unix, but I wanted
>to ask here just to be sure:
>
> fp = file('filename', 'rb')
>
> The 'b' on the end being the most important ingredient (especially on Windows
> as a simple 'r' on a
> binary file
I believe that this is the safest way to open files on Windows, Linux,
Mac and Unix, but I wanted to ask here just to be sure:
fp = file('filename', 'rb')
The 'b' on the end being the most important ingredient (especially on
Windows as a simple 'r' on a binary file might cause some sort of
corr