Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.011 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'attribute': 0.07; 'subject:posting': 0.09; 'subject:using': 0.09; 'subject:question': 0.10; 'dictionary,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'multipart': 0.16; 'tuple': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'aug': 0.22; 'saying': 0.22; 'error': 0.23; '15,': 0.26; 'header:In-Reply- To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'but': 0.35; 'received:google.com': 0.35; 'subject:data': 0.36; 'should': 0.36; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'providing': 0.61; "you're": 0.61; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Lrb0czrNeY5wbBzEyq9PD5gVFEDhbJn2hJIy8RkT3kA=; b=O6muBkg8ZtdnNvcu3DzAaoPewB/aNnlWkLMKyq6fjvmOyti3f1KEXp8q2b1iDbNP32 gBDcDGStp3D4K95FVjj+akUfVhkHNBL88M7aIt2KnZA9SS/xQTphbf3Vh1e7mxU78zE2 dADx229wpvv2GJehVg42QAFG6PfeOqlMqsVWr3/v7+HnDMskgwf5PmJ7Mo1fL8AzV1i9 gNT2gokNvvGhGJutSrf+nbGdOYHQ+oT7G486QAC9AjOiinSTvexF78wTSqy0u2YKCAhP QBm9j5J9/M7pNY9naB0USj/D6UGkrf2HDTXUEutTJj/kDSjs8sCNY2MBgU8WtvNixnZC 8nZQ== MIME-Version: 1.0 X-Received: by 10.220.110.202 with SMTP id o10mr16527616vcp.1.1376613903686; Thu, 15 Aug 2013 17:45:03 -0700 (PDT) In-Reply-To: <3c256548-5fed-446a-8683-b66abc0e301f@googlegroups.com> References: <3c256548-5fed-446a-8683-b66abc0e301f@googlegroups.com> Date: Fri, 16 Aug 2013 01:45:03 +0100 Subject: Re: question about posting data using MultipartPostHandler From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1376613911 news.xs4all.nl 15991 [2001:888:2000:d::a6]:36081 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:52571 On Thu, Aug 15, 2013 at 7:12 PM, cerr wrote: > multipart = ({"data":data}, {"fname":fname}, {"f":f}) > > but I get an error saying "'tuple' object has no attribute 'items'"... how do I do this correctly? You're no longer providing a dictionary, but a tuple of dictionaries. What you want to do is use a single dictionary: multipart = {"data":data, "fname":fname, "f":f} That should achieve what you want. ChrisA