[py-configparser-devel] missing files treatment

Erik Huelsmann e.huelsmann at gmx.net
Sat Jun 14 11:42:36 UTC 2008


On Sat, Jun 14, 2008 at 1:40 PM, Erik Huelsmann <e.huelsmann at gmx.net> wrote:
> On Fri, Jun 13, 2008 at 6:24 PM, Erik Huelsmann <ehuels at gmail.com> wrote:
>> On 6/13/08, Ury Marshak <urym at two-bytes.com> wrote:
>>> Hi,
>>>
>>> It seems at the moment (version 1.0.2) if I specify some files that are
>>> not present I get an error in (read-files). Python's docs at
>>> http://docs.python.org/lib/RawConfigParser-objects.html state that "If a
>>> file named in filenames cannot be opened, that file will be ignored",
>>> which actually is very useful behavior. So, maybe I'll be possible to
>>> make a change in this, something like:
>>>
>>> diff -u -r py-configparser-1.0.2-orig/parser.lisp
>>> py-configparser-1.0.2/parser.lisp
>>> --- py-configparser-1.0.2-orig/parser.lisp    2008-03-16
>>> 01:05:40.000000000 +0200
>>> +++ py-configparser-1.0.2/parser.lisp    2008-06-03 15:53:01.406250000 +0300
>>> @@ -190,7 +190,7 @@
>>>
>>>  Returns as values the configuration and the list of files actually read."
>>>   (let (files-read)
>>> -    (dolist (filename (mapcar #'probe-file filenames)
>>> +    (dolist (filename (remove-if-not #'probe-file filenames)
>>>              (values config files-read))
>>>       (with-open-file (s filename
>>>                          :direction :input
>>
>>
>> Hi!
>>
>> I'd say this is indeed the intended behaviour. The code which is
>> currently there just seems broken to me. I'll commit your change later
>> tonight and release a new version. (Unless you have more
>> bugs/improvements to report, in which case it's probably better to
>> release all of it at once...)

Well, I committed the change to trunk, so unless you have additional
changes (or anyone else for that matter), all that remains is creating
a new release.

Bye,

Erik.



More information about the py-configparser-devel mailing list