Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #30889
| From | Grant Edwards <invalid@invalid.invalid> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: write binary with struct.pack_into |
| Date | 2012-10-06 13:26 +0000 |
| Organization | PANIX Public Access Internet and UNIX, NYC |
| Message-ID | <k4pbik$6qf$1@reader1.panix.com> (permalink) |
| References | <1349494056881-4991234.post@n6.nabble.com> <mailman.1891.1349499136.27098.python-list@python.org> |
On 2012-10-06, Dennis Lee Bieber <wlfraed@ix.netcom.com> wrote:
> On Fri, 5 Oct 2012 20:27:36 -0700 (PDT), palmeira <palmeira@gmail.com>
> declaimed the following in gmane.comp.python.general:
>
>>
>> #WRITE
>> fb=open('testOUT.bin')
>
> Unless you specify otherwise, open() defaults to read-only
It also defaults to 'text' mode which does cr/lf translaction. That
will break both reads and writes on any binary file containing 0x0a
and 0x0d bytes.
--
Grant
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: write binary with struct.pack_into Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-10-06 00:52 -0400
Re: write binary with struct.pack_into Grant Edwards <invalid@invalid.invalid> - 2012-10-06 13:26 +0000
Re: write binary with struct.pack_into Chris Angelico <rosuav@gmail.com> - 2012-10-06 23:52 +1000
csiph-web