Does Python mess with CRLFs?

John Machin sjmachin at
Wed Nov 12 12:38:56 CET 2008

On Nov 12, 10:04 pm, Gilles Ganault <nos... at> wrote:
> Hello
> I'm stuck at understanding why Python can't extract some bit from an
> HTML file using regexes, although I can find it just fine with
> UltraEdit.
> I wonder if Python rewrites CRLFs when reading a text file with
> open/read?

Don't wonder; do some very elementary debugging and find out for

> Here's the code:
> ==========
> f = open("content.html", "r")
> content =
> f.close()

Consider inserting
   print repr(content)

More information about the Python-list mailing list