Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!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.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'debug': 0.07; 'http': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:skip:a 10': 0.09; '(note:': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'request)': 0.16; 'username.': 0.16; 'appropriate': 0.16; 'trying': 0.19; 'machine': 0.22; 'header:User-Agent:1': 0.23; 'header': 0.24; 'login': 0.25; 'second': 0.26; 'pass': 0.26; 'header:X-Complaints-To:1': 0.27; 'host': 0.29; 'correct': 0.29; 'correctly.': 0.31; 'skip:q 20': 0.31; 'writes:': 0.31; 'file': 0.32; 'subject:with': 0.35; 'connection': 0.35; 'created': 0.35; 'hi,': 0.36; 'should': 0.36; 'being': 0.38; 'message-id:@gmail.com': 0.38; 'to:addr:python- list': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'read': 0.60; 'establish': 0.61; 'name': 0.63; 'saw': 0.77; 'received:89': 0.85 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Akira Li <4kir4.1i@gmail.com> Subject: Re: httplib with NETRC authentication Date: Wed, 14 May 2014 20:47:22 +0400 References: Mime-Version: 1.0 Content-Type: text/plain X-Gmane-NNTP-Posting-Host: 89.169.229.68 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:xF0JCiCC3MopYrFruXJ8N12BC/I= 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: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1400086056 news.xs4all.nl 2941 [2001:888:2000:d::a6]:49580 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:71569 pratibha natani writes: > Hi, > > I am trying to establish http connection to a gerrit host using netrc authentication. I have a netrc file created with following entries: > machine host1.com login name password pass > > I did a debug and saw that my netrc file is being read correctly. Also in the connection object(after sending request) a header got created with appropriate credentials: > 'headers': {'Authorization': 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ='} > It should be QWxhZGRpbjpvcGVuIHNlc2FtZQ== (note: the second '=') Also, make sure that you use the correct case for the username. Userids might be case sensitive. -- akira