Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!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.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'username,': 0.07; 'feature.': 0.09; 'idea?': 0.09; 'spelling': 0.09; 'subject:script': 0.09; '(remember': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'hostname': 0.16; 'inclined': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'nameerror:': 0.16; 'notation': 0.16; 'password,': 0.16; 'received:84.93': 0.16; 'received:84.93.230': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'shell': 0.22; 'header:User-Agent:1': 0.23; 'error': 0.23; "aren't": 0.24; 'right.': 0.26; 'pass': 0.26; 'defined': 0.27; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'username': 0.31; 'file': 0.32; 'stuff': 0.32; '(most': 0.33; 'monday,': 0.33; 'used,': 0.33; 'actual': 0.34; 'skip:d 20': 0.34; "i'd": 0.34; 'problem': 0.35; 'received:84': 0.35; 'thanks': 0.36; 'so,': 0.37; 'clear': 0.37; 'to:addr:python- list': 0.38; 'fact': 0.38; 'recent': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'break': 0.61; 'new': 0.61; 'name': 0.63; 'worth': 0.66; 'header:Reply-To:1': 0.67; 'fact,': 0.69; 'reply- to:no real name:2**0': 0.71; 'reply-to:addr:python.org': 0.84; 'directly.': 0.95; '2013': 0.98 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=JsTI8qIC c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=0Bzu9jTXAAAA:8 a=7AxPfEIvyrUA:10 a=ihvODaAuJD4A:10 a=OUOv7kDek9cA:10 a=8nJEP1OIZ-IA:10 a=EBOSESyhAAAA:8 a=8AHkEIZyAAAA:8 a=ytLhUI_Y_LYA:10 a=pGLkceISAAAA:8 a=X3vMQriGQ_tNs7TycREA:9 a=wPNLvfGTeEIA:10 a=MSl-tDqOz04A:10 X-AUTH: mrabarnett:2500 Date: Mon, 06 May 2013 23:52:53 +0100 From: MRAB User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: python-list@python.org Subject: Re: python backup script References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: python-list@python.org 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: 47 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1367880770 news.xs4all.nl 15999 [2001:888:2000:d::a6]:35853 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:44863 On 06/05/2013 23:40, MMZ wrote: > On Monday, May 6, 2013 6:12:28 PM UTC-4, Chris Angelico wrote: >> 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 > > Thanks Chris. you are right. > So I used them directly and removed configParser. The new error is: > > Traceback (most recent call last): > File "./bbk.py", line 11, in ? > for database in os.popen(database_list_command).readlines(): > NameError: name 'database_list_command' is not defined > > any idea? > Check the spelling (remember that the name is case-sensitive).