[issue2204] document ConfigParser behaviour when a file has same section multiple times

2010-08-03 Thread Éric Araujo

Changes by Éric Araujo :


--
resolution:  -> duplicate
stage: needs patch -> committed/rejected
status: open -> closed
superseder:  -> configparser support for reading from strings and dictionaries

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2204] document ConfigParser behaviour when a file has same section multiple times

2010-08-03 Thread Łukasz Langa

Łukasz Langa  added the comment:

This bug is superseded by #9452 where the patch includes a `strict=` argument 
to __init__ which enables checking for section duplicates when reading from a 
single source.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2204] document ConfigParser behaviour when a file has same section multiple times

2010-07-25 Thread Mark Lawrence

Mark Lawrence  added the comment:

@Łukasz: could you provide a patch that clarifies the default behaviour.

--
assignee: georg.brandl -> d...@python
nosy: +BreamoreBoy, d...@python
stage: unit test needed -> needs patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2204] document ConfigParser behaviour when a file has same section multiple times

2010-07-23 Thread Łukasz Langa

Łukasz Langa  added the comment:

I personally would keep the current behaviour so that:
- creating a duplicate section programatically invokes an error
- reading a file which has duplicate sections causes an implicit merge without 
any exceptions

This is quite understandable, more so when you consider how ConfigParser merges 
configuration from multiple sources as well.

Brett, the only thing I guess we could do here is to adjust the documentation 
so it's more clear on the default behaviour.

--
nosy: +lukasz.langa

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2204] document ConfigParser behaviour when a file has same section multiple times

2009-12-28 Thread honesthacker

Changes by honesthacker :


--
nosy: +honesthacker

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2204] document ConfigParser behaviour when a file has same section multiple times

2009-08-28 Thread trash80

trash80  added the comment:

I am using configparser after combining 3 or so ini files, I would like
to merge similar sections rather than throwing an exception.  Right now
I have to make sure the ini files all have unique sections, but I would
like to able to use same section names, then combine the files and have
the sections merged.  Even merging the variables within sections would
be nice.

Throwing an exception, imho, is no the right direction.  Even in same
name sections are in the same file, the variables where introduced for a
reason.

Or maybe a trigger option ie action=merge or action=flag.

--
nosy: +trash80
versions: +Python 3.0 -Python 2.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2204] document ConfigParser behaviour when a file has same section multiple times

2009-04-22 Thread Daniel Diniz

Changes by Daniel Diniz :


--
components: +Library (Lib)
keywords: +easy
priority:  -> normal
stage:  -> test needed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2204] document ConfigParser behaviour when a file has same section multiple times

2009-02-10 Thread Raghuram Devarakonda

Raghuram Devarakonda  added the comment:

> The attached patch is a proof of concept for throwing an exception.

If it is not too much of a problem, can you upload the patch to
http://codereview.appspot.com? Reviewing there is simpler. Also, you
will have to include some test cases in the patch.

> As discussed on the mailing list [1], it has some shortcomings that
> should be addressed before it is merged.

I think that the builder interface already has correct behaviour in
that duplicate sections are not allowed. So you can have
'unique_sections' control only parser interface and can set it to
False by default (to be compatible with current behaviour).

> [1]: http://mail.python.org/pipermail/python-dev/2009-

Correct discussion link:
http://mail.python.org/pipermail/python-dev/2009-February/085838.html

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2204] document ConfigParser behaviour when a file has same section multiple times

2009-02-04 Thread Yannick Gingras

Yannick Gingras  added the comment:

The attached patch is a proof of concept for throwing an exception.

As discussed on the mailing list [1], it has some shortcomings that
should be addressed before it is merged.

[1]: http://mail.python.org/pipermail/python-dev/2009-

--
keywords: +patch
nosy: +ygingras
Added file: http://bugs.python.org/file12938/no-dups-configparser.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2204] document ConfigParser behaviour when a file has same section multiple times

2008-02-29 Thread Raghuram Devarakonda

Raghuram Devarakonda added the comment:

>  Should this 'undesirable' behavior be documented? My thoughts are

Document should definitely reflect the code whether the behaviour is
desirable or not.

>  a) All the key,value pairs in the named section be retrived from entire
>  file. Just appending the dict.

Isn't this what is happening now unless I am not following you?

>  Otherwise,
>  b) An Exception can be thrown if it encounters an invalid Configfile
>  having multiple same sections which can cause problem, but I cannot
>  readily think of one such case.

I have no problem with throwing an exception in case of duplicate
sections but I don't think that can be done by default (it may break
some programs).

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2204] document ConfigParser behaviour when a file has same section multiple times

2008-02-28 Thread Senthil

Senthil added the comment:

Should this 'undesirable' behavior be documented? My thoughts are
a) All the key,value pairs in the named section be retrived from entire
file. Just appending the dict.
Otherwise, 
b) An Exception can be thrown if it encounters an invalid Configfile
having multiple same sections which can cause problem, but I cannot
readily think of one such case.

What do others think?

Thanks,
Senthil

--
nosy: +orsenthil

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2204] document ConfigParser behaviour when a file has same section multiple times

2008-02-28 Thread Raghuram Devarakonda

New submission from Raghuram Devarakonda:

ConfigParser.add_section() raises DuplicateSectionError if add_section()
is called with the name of a section that is already present. How ever,
if a section is present multiple times in a file, readfp() does not
raise any exception. Instead, the sections are "combined" with values in
latter sections overwriting previous values (if any). This should be
documented in readfp(). I tried few alternatives but the sentences don't
look right. I am creating the issue in the hope that some one else may
give it a try while I continue to come up with a doc patch.

--
assignee: georg.brandl
components: Documentation
messages: 63109
nosy: draghuram, georg.brandl
severity: normal
status: open
title: document ConfigParser behaviour when a file has same section multiple 
times
type: behavior
versions: Python 2.6

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com