Binary data handling ?

Bill Loren lorenb2 at bezeqint.net
Thu Aug 28 10:01:20 EDT 2003


Hello ppl,

I'm having difficulties to accomplish some simple chores with binary data.
I'm having a string (?) which I received via an HTTP transactions which is a
binary file.
Problem is the webserver I'm communicating with injected a \x0D before every
\x0A,
and I need to remove those 0x0D characters from my buffer before saving it
to disk.

any ideas ?

I tried the following without any success:
string.replace("%c%c" % (13,10), "%c" % (10))
string.replace("\x0d\x0a", "\0x0a")

thx
~B






More information about the Python-list mailing list