Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eweka.nl!lightspeed.eweka.nl!194.109.133.87.MISMATCH!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.025 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'username,': 0.07; 'feature.': 0.09; 'subject:script': 0.09; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'hostname': 0.16; 'inclined': 0.16; 'notation': 0.16; 'password,': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'shell': 0.22; "aren't": 0.24; 'pass': 0.26; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'username': 0.31; 'stuff': 0.32; 'used,': 0.33; 'actual': 0.34; 'skip:d 20': 0.34; "i'd": 0.34; 'problem': 0.35; 'received:google.com': 0.35; 'so,': 0.37; 'clear': 0.37; 'to:addr:python-list': 0.38; 'fact': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'break': 0.61; 'worth': 0.66; 'fact,': 0.69; 'directly.': 0.95; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=nipiGYVahDrhU+f6pydqr2ZzyA0LBuzxx5vtSe1yRjY=; b=WgoJFiGKNL32WMp5dB3IKzj0ipqG6dTUbGCSdZUhLod0UEw9daI5yQaJ+wRDxnxafr YObJxJY9HkIYr/ikIpIwxkbcHQdr8f2cz8jfFdnqWk3ktTxI2aKvihjYPwGBa5vtYqai NTvdwaEBufxJD5ugeJlb4+RTyxgptURnN5MUrHj8AvLtnUV+futZzyvyfMJxytexxS4v Ou+Nz0zDslxD2qArgudTKNbBaeKbMNIRKQbOBCl7P82GinZM4ewLDnogj8of1UNUaLki bx0NgSAb6rWSYayl7xwc2QAKTr9nE9naxCUDbRFx0u0ZLOHhxLoOXgwMvX2ULz4TFeOS 5lUA== MIME-Version: 1.0 X-Received: by 10.52.37.109 with SMTP id x13mr6508701vdj.10.1367878348374; Mon, 06 May 2013 15:12:28 -0700 (PDT) In-Reply-To: References: Date: Tue, 7 May 2013 08:12:28 +1000 Subject: Re: python backup script 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: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1367878356 news.xs4all.nl 15865 [2001:888:2000:d::a6]:41897 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:44856 On Tue, May 7, 2013 at 5:01 AM, MMZ wrote: > username = config.get('client', 'mmz') > password = config.get('client', 'pass1') > hostname = config.get('client', 'localhost') Are 'mmz', 'pass1', and 'localhost' the actual values you want for username, password, and hostname? If so, don't pass them through config.get() at all - just use them directly. In fact, I'd be inclined to just stuff them straight into the Database_list_command literal; that way, it's clear how they're used, and the fact that you aren't escaping them in any way isn't going to be a problem (tip: an apostrophe in your password would currently break your script). It's also worth noting that the ~/ notation is a shell feature. You may or may not be able to use it in config.read(). ChrisA