problems with re in binary files

Chris Barker chrishbarker at
Fri Sep 21 19:18:58 CEST 2001

"Steven D. Arnold" wrote:

> When I opened it in "rb" mode, it started
> working.  The manual seems to suggest this is only an issue on some
> operating systems, such as Windows.

yep , that's "b" for "binary", if you want a binary file open it as a
binary file. As it happens, this makes no difference on *nix systems, as
Python's internal line separater happens to be the same as *nix's, but
it's still a good idea to put the b there: for portability and clarity.


Christopher Barker,
ChrisHBarker at                 ---           ---           --- ---@@       -----@@       -----@@
                                   ------@@@     ------@@@     ------@@@
Oil Spill Modeling                ------   @    ------   @   ------   @
Water Resources Engineering       -------      ---------     --------    
Coastal and Fluvial Hydrodynamics --------------------------------------

More information about the Python-list mailing list