Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!ecngs!feeder2.ecngs.de!81.171.88.16.MISMATCH!hq-usenetpeers.eweka.nl!hq-usenetpeers.eweka.nl!xlned.com!feeder3.xlned.com!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:error': 0.03; 'error:': 0.07; 'advice.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'worked,': 0.09; 'chrome,': 0.16; 'expert,': 0.16; 'loop.': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-ipconnect.de': 0.16; 'recognise': 0.16; 'header :User-Agent:1': 0.23; 'sort': 0.25; 'gets': 0.27; 'header:X -Complaints-To:1': 0.27; 'tried': 0.27; "doesn't": 0.30; "i'm": 0.30; "d'aprano": 0.31; 'fault': 0.31; 'steven': 0.31; 'writes:': 0.31; 'could': 0.34; 'but': 0.35; 'charset:us-ascii': 0.36; 'server': 0.38; 'ends': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'received:217': 0.63; 'analysis': 0.75; 'end.': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: dieter Subject: Re: urllib2 redirect error Date: Wed, 03 Sep 2014 08:29:44 +0200 References: <540571b8$0$29876$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Gmane-NNTP-Posting-Host: pd9e0876c.dip0.t-ipconnect.de User-Agent: Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.22 (linux) Cancel-Lock: sha1:syX7m9Ji0KnmXJ9rvEsflchQGPI= 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: 1409725798 news.xs4all.nl 2900 [2001:888:2000:d::a6]:59376 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 3051 X-Received-Body-CRC: 3793884536 Xref: csiph.com comp.lang.python:77467 Steven D'Aprano writes: > ... > I'm not an expert, but that sounds like a fault at the server end. I just > tried it in Chrome, and it worked, and then with wget, and I get the same > sort of error: > ... > Sounds like if the server doesn't recognise the browser, it gets > confused and ends up in a redirect loop. > > You could try setting the user-agent and see if that helps: Excellent analysis and advice.