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


Groups > comp.lang.python > #92799

Re: Posting gzip'd image file - server says Malformed Upload?

Date 2015-06-17 19:10 -0600
From Michael Torrie <torriem@gmail.com>
Subject Re: Posting gzip'd image file - server says Malformed Upload?
References <59756062-6632-46b4-a92c-aa3a260718a7@googlegroups.com> <mailman.575.1434587009.13271.python-list@python.org> <0dd32144-8969-4e15-9e78-4c9698fb9d8c@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.576.1434589824.13271.python-list@python.org> (permalink)

Show all headers | View raw


On 06/17/2015 06:45 PM, Paul Hubert wrote:
> On Wednesday, June 17, 2015 at 8:24:17 PM UTC-4, Chris Angelico wrote:
> 
>> Are you sure you want iteration and writelines() here? I would be
>> inclined to avoid those for any situation that isn't plain text. If
>> the file isn't too big, I'd just read it all in a single blob and then
>> write it all out at once.
>>
>> ChrisA
> 
> Do you think that would fix my issue? 

I recommend you try it and see.  That's the only way to know.  We don't
know any details of your program or situation really, so we can only guess.

> Could you give me an example?

Instead of writelines(), just write() the data.  There are examples in
the official python docs I'm sure.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Posting gzip'd image file - server says Malformed Upload? Paul Hubert <phbrt25@gmail.com> - 2015-06-17 14:55 -0700
  Re: Posting gzip'd image file - server says Malformed Upload? Chris Angelico <rosuav@gmail.com> - 2015-06-18 10:23 +1000
    Re: Posting gzip'd image file - server says Malformed Upload? Paul Hubert <phbrt25@gmail.com> - 2015-06-17 17:45 -0700
      Re: Posting gzip'd image file - server says Malformed Upload? Michael Torrie <torriem@gmail.com> - 2015-06-17 19:10 -0600
      Re: Posting gzip'd image file - server says Malformed Upload? Chris Angelico <rosuav@gmail.com> - 2015-06-18 11:46 +1000
        Re: Posting gzip'd image file - server says Malformed Upload? Paul Hubert <phbrt25@gmail.com> - 2015-06-17 20:48 -0700
          Re: Posting gzip'd image file - server says Malformed Upload? Chris Angelico <rosuav@gmail.com> - 2015-06-18 13:56 +1000
          Re: Posting gzip'd image file - server says Malformed Upload? Michael Torrie <torriem@gmail.com> - 2015-06-17 21:59 -0600
          Re: Posting gzip'd image file - server says Malformed Upload? Laura Creighton <lac@openend.se> - 2015-06-18 23:44 +0200
  Re: Posting gzip'd image file - server says Malformed Upload? random832@fastmail.us - 2015-06-18 08:38 -0400
  Re: Posting gzip'd image file - server says Malformed Upload? Chris Angelico <rosuav@gmail.com> - 2015-06-18 22:42 +1000

csiph-web