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


Groups > comp.lang.python > #52094

Re: HTTP post with urllib2

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.037
X-Spam-Evidence '*H*': 0.93; '*S*': 0.00; 'mrab': 0.05; 'here?': 0.09; 'req': 0.09; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'posted,': 0.16; 'subject:post': 0.16; 'timeout)': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'aug': 0.22; 'skip:" 30': 0.26; 'header:In-Reply-To:1': 0.27; 'message- id:@mail.gmail.com': 0.30; "skip:' 10": 0.31; '13,': 0.31; 'file': 0.32; 'figure': 0.32; 'open': 0.33; '(most': 0.33; 'actual': 0.34; 'skip:_ 10': 0.34; 'subject:with': 0.35; 'skip:u 20': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'data,': 0.36; 'error.': 0.37; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'recent': 0.39; 'to:addr:python.org': 0.39; "you've": 0.63; 'more': 0.64; 'future,': 0.83; 'mistake': 0.91; '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=VeGHKnzAGUrL6U0ZljKFR9aIvGCTMqBZWXWhRb77QOA=; b=r8nmFUWUsIB1iJDPN7B11U3WPuq5K4lXVNjQbYz0TJUuXE3/gyFleblGJikbrkuPiq UqpwKERAhu9i5EqSWbxpyLXkrs48NZB0usW6EG7QBdrOzp19WxXd2CujB9TzDdiAxTUl 08wVrIew8dp//HRB9s24sAw+/AjUxKFJZPq88jIzHj5Fut3IIQ8XtVwOfB8hbZBg3xPc K3mVYRXDl//2psfpt/tJueqc4Zruejo26xQHuPZtaPqvsR9rzvvDIdixebZazE3V+QH8 yIy59W4rTt8nQhxE8JMMKhb2+DTRMK+OBzEwImdJbPdKMXj7jCP46zexyCy/9zM/G+nQ gf2Q==
MIME-Version 1.0
X-Received by 10.58.249.236 with SMTP id yx12mr235647vec.25.1375835304546; Tue, 06 Aug 2013 17:28:24 -0700 (PDT)
In-Reply-To <2e3c176d-6cb9-42f9-91a9-6bf0832a69cb@googlegroups.com>
References <2e3c176d-6cb9-42f9-91a9-6bf0832a69cb@googlegroups.com>
Date Wed, 7 Aug 2013 01:28:24 +0100
Subject Re: HTTP post with urllib2
From Chris Angelico <rosuav@gmail.com>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.290.1375835312.1251.python-list@python.org> (permalink)
Lines 21
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1375835312 news.xs4all.nl 15960 [2001:888:2000:d::a6]:37773
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:52094

Show key headers only | View raw


On Tue, Aug 6, 2013 at 11:52 PM, cerr <ron.eggler@gmail.com> wrote:
> ./post.py
> Traceback (most recent call last):
>   File "./post.py", line 13, in <module>
>     response = urllib2.urlopen(req, 120)
>   File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
>     return _opener.open(url, data, timeout)
>   File "/usr/lib/python2.7/urllib2.py", line 398, in open
>     req = meth(req)
>   File "/usr/lib/python2.7/urllib2.py", line 1116, in do_request_
>     'Content-length', '%d' % len(data))
>
>
> I don't get it, what's going on here?
>

You've given a traceback without the actual error. MRAB happened to
figure out the mistake just from what you posted, but in future, do
try to copy a bit more down :)

ChrisA

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


Thread

HTTP post with urllib2 cerr <ron.eggler@gmail.com> - 2013-08-06 15:52 -0700
  Re: HTTP post with urllib2 Joel Goldstick <joel.goldstick@gmail.com> - 2013-08-06 19:08 -0400
    Re: HTTP post with urllib2 cerr <ron.eggler@gmail.com> - 2013-08-06 16:35 -0700
      Re: HTTP post with urllib2 Joel Goldstick <joel.goldstick@gmail.com> - 2013-08-06 19:48 -0400
  Re: HTTP post with urllib2 MRAB <python@mrabarnett.plus.com> - 2013-08-07 01:14 +0100
    Re: HTTP post with urllib2 cerr <ron.eggler@gmail.com> - 2013-08-07 09:20 -0700
  Re: HTTP post with urllib2 Chris Angelico <rosuav@gmail.com> - 2013-08-07 01:28 +0100

csiph-web