Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!tudelft.nl!txtfeed1.tudelft.nl!multikabel.net!newsfeed20.multikabel.net!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.041 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; '(instead': 0.07; 'seemed': 0.07; 'conf': 0.09; 'parsing': 0.09; '12:59': 0.16; 'anymore.': 0.16; 'pity': 0.16; 'wrote:': 0.18; 'seems': 0.20; 'checked': 0.21; 'header:In-Reply-To:1': 0.22; "shouldn't": 0.23; 'library.': 0.24; 'import': 0.27; 'alternatives': 0.29; 'example': 0.29; 'worked': 0.29; 'pm,': 0.29; 'ago': 0.31; 'message-id:@gmail.com': 0.31; 'quite': 0.31; 'actually': 0.31; "can't": 0.33; 'header :User-Agent:1': 0.33; 'to:addr:python-list': 0.35; 'received:209.85.214': 0.36; 'to:name:python-list': 0.37; 'received:10.0.0': 0.37; 'but': 0.37; 'received:google.com': 0.37; 'using': 0.37; 'received:209.85': 0.38; 'fail': 0.39; 'received:209': 0.39; 'to:addr:python.org': 0.40; 'type': 0.61; 'simple': 0.61; 'validation': 0.73; 'dead': 0.77; '10)': 0.84; 'andrea': 0.84; 'ps.': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=H13EQL/R0zLLPee+t2rmKXRSxd6yswBqaY0aMG+POgU=; b=t5SyD00MxSFNjPPETbwfpUWXhAbWf2bW20jmJP5cAqZxn0fQP/X6V4TKaqvr+HL/+U 98jvlyAiH1ZWR9+ac2nVK5jl4O2560KV7fuiUcWjMBOnIGUJJanypmPUMgJLAvByAhAm SSGc8QK066fXGgi3kFVhNpfokZ9jH6zm3+R1ouxFfYWrtwbs8yJcBJOlH2RMP5HV/9G7 7jmROqLSNhl3p6Grvc9Oajc93MLfOMcrMy/f8D8OEcPZhq1GgWAX8Em2eJ8R9MQ7B+04 9/RVrx9cCjURkv9+r8S7XUV7JasnH0oEh3PHMKTgs/X64UMH7NdUG8z/KZaVzVtqIC0L AU1w== Date: Mon, 19 Mar 2012 14:44:21 +0000 From: Andrea Crotti User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.2) Gecko/20120217 Thunderbird/10.0.2 MIME-Version: 1.0 To: python-list Subject: Re: configobj validation References: <4F672DBF.5060506@gmail.com> In-Reply-To: <4F672DBF.5060506@gmail.com> 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.12 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: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1332168266 news.xs4all.nl 6886 [2001:888:2000:d::a6]:33768 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:21901 On 03/19/2012 12:59 PM, Andrea Crotti wrote: > I seemed to remember that type validation and type conversion worked > out of the box, but now > I can't get it working anymore. > > Shouldn't this simple example actually fail the parsing (instead it > parses perfectly port to a string)? > > sample.py: > from configobj import ConfigObj > > conf = ConfigObj('sample.conf', configspec='sample.spec') > > sample.conf: > port = some_string > > sample.spec: > port = integer(0, 10) > > PS. using configobj 4.7.2 I now checked the repo and configobj seems also quite dead (2 years ago last version), it's a pity because it's a really nice library. Any other alternatives for validation/configuration systems otherwise?