Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #30889

Re: write binary with struct.pack_into

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.readnews.com!transit4.readnews.com!panix!not-for-mail
From Grant Edwards <invalid@invalid.invalid>
Newsgroups comp.lang.python
Subject Re: write binary with struct.pack_into
Date Sat, 6 Oct 2012 13:26:44 +0000 (UTC)
Organization PANIX Public Access Internet and UNIX, NYC
Lines 16
Message-ID <k4pbik$6qf$1@reader1.panix.com> (permalink)
References <1349494056881-4991234.post@n6.nabble.com> <mailman.1891.1349499136.27098.python-list@python.org>
NNTP-Posting-Host c-24-118-110-103.hsd1.mn.comcast.net
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
X-Trace reader1.panix.com 1349530004 6991 24.118.110.103 (6 Oct 2012 13:26:44 GMT)
X-Complaints-To abuse@panix.com
NNTP-Posting-Date Sat, 6 Oct 2012 13:26:44 +0000 (UTC)
User-Agent slrn/0.9.9p1 (Linux)
Xref csiph.com comp.lang.python:30889

Show key headers only | View raw


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 | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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