I try to parse file like:
[account]
User = first
[account]
User = second
I use ConfigParser in Python, but when i read file:
Unfortunately, the format of the provided ini file is not correct according standards. A section's name must be unique in the document.
If you can change the file-format (I already read that you cannot, but for completeness...), then a solution like this would be appropriate:
[accounts]
keys= account1, account2
[account1]
User = first
[account2]
User = second
If you really can't alternate the file's format, then I fear that your only option is to parse manually the configuration file.