You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(5) |
Oct
(2) |
Nov
(18) |
Dec
(26) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(14) |
Feb
(28) |
Mar
(21) |
Apr
(17) |
May
(23) |
Jun
(12) |
Jul
(12) |
Aug
(7) |
Sep
(10) |
Oct
|
Nov
(4) |
Dec
(10) |
| 2007 |
Jan
(5) |
Feb
(8) |
Mar
|
Apr
|
May
(7) |
Jun
(1) |
Jul
(3) |
Aug
(3) |
Sep
(20) |
Oct
(3) |
Nov
(2) |
Dec
(12) |
| 2008 |
Jan
(40) |
Feb
(15) |
Mar
(1) |
Apr
|
May
(6) |
Jun
(19) |
Jul
(2) |
Aug
(17) |
Sep
(13) |
Oct
(7) |
Nov
(16) |
Dec
(5) |
| 2009 |
Jan
(15) |
Feb
(11) |
Mar
(11) |
Apr
(8) |
May
(6) |
Jun
(15) |
Jul
(19) |
Aug
(2) |
Sep
|
Oct
(19) |
Nov
(1) |
Dec
(3) |
| 2010 |
Jan
(12) |
Feb
(25) |
Mar
(45) |
Apr
(4) |
May
(2) |
Jun
(4) |
Jul
(6) |
Aug
(13) |
Sep
(1) |
Oct
(2) |
Nov
(2) |
Dec
(9) |
| 2011 |
Jan
(24) |
Feb
(7) |
Mar
(1) |
Apr
(6) |
May
(3) |
Jun
(3) |
Jul
|
Aug
(13) |
Sep
(9) |
Oct
(7) |
Nov
(17) |
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
(5) |
Apr
(3) |
May
|
Jun
|
Jul
(3) |
Aug
(2) |
Sep
(4) |
Oct
|
Nov
|
Dec
|
| 2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(12) |
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
(4) |
Feb
(3) |
Mar
|
Apr
(17) |
May
|
Jun
|
Jul
|
Aug
(5) |
Sep
(3) |
Oct
(3) |
Nov
|
Dec
|
| 2015 |
Jan
(11) |
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
(2) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
(10) |
Dec
|
| 2017 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Michael F. <fuz...@vo...> - 2008-08-26 17:25:52
|
Antonis Papadopoulos wrote:
> Hello
>
> I have an .ini (settings file) which contains following:
>
> Code:
>
> [section1]
> item1=value
> item2=value
>
> [section2]
> item3=value
>
> I put the "test.ini" and the "configobj.py" files in "E:\".
>
> I then run the following script (iniread.py):
>
> Code:
>
> import sys
> sys.path.append("E:\\")
> import configobj
> from configobj import ConfigObj
>
> config = ConfigObj("test.ini")
>
> section = config['section2']
> value = section['item3']
>
> print 'item3 : ' + value
>
> But I get the following error:
>
> Quote:
> Traceback (most recent call last):
> File "C:\private\2000b1a5\default.py", line 81, in menu_action
> f()
> File "C:\private\2000b1a5\default.py", line 65, in query_and_exec
> execfile(script_list[index][1]. encode('utf-8'), script_namespace. namespace)
> File "C:\python\iniread.py", line 8, in ?
> section = config['section2']
> File "E:\configobj.py", line 580, in __getitem__
> val = dict.__getitem__(self, key)
> KeyError: section2
>
> What am I doing wrong? Why can't I see the value of item3?
> I also want to know how to read a file that is not in the same folder
> as configobj.py I tried with E:\\foldername\test.ini but I got a parse
> error in configobj.py...
>
In the first case you are passing ConfigObj a relative path - so because
the config file 'test.ini' doesn't exist in the current directory
ConfigObj creates a new one.
When you provide the full path the parse error *should* tell you what is
wrong. I think you need spaces around your '=' sign - so that ConfigObj
can tell where your keys end and your values begin.
item1 = value
Try that and either change the current directory to the location
containing the config file or pass in the full path.
Michael Foord
> Thank you
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Configobj-develop mailing list
> Con...@li...
> https://lists.sourceforge.net/lists/listinfo/configobj-develop
>
--
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/
http://www.trypython.org/
http://www.ironpython.info/
http://www.theotherdelia.co.uk/
http://www.resolverhacks.net/
|
|
From: Antonis P. <ant...@gm...> - 2008-08-26 17:18:55
|
Hello
I have an .ini (settings file) which contains following:
Code:
[section1]
item1=value
item2=value
[section2]
item3=value
I put the "test.ini" and the "configobj.py" files in "E:\".
I then run the following script (iniread.py):
Code:
import sys
sys.path.append("E:\\")
import configobj
from configobj import ConfigObj
config = ConfigObj("test.ini")
section = config['section2']
value = section['item3']
print 'item3 : ' + value
But I get the following error:
Quote:
Traceback (most recent call last):
File "C:\private\2000b1a5\default.py", line 81, in menu_action
f()
File "C:\private\2000b1a5\default.py", line 65, in query_and_exec
execfile(script_list[index][1]. encode('utf-8'), script_namespace. namespace)
File "C:\python\iniread.py", line 8, in ?
section = config['section2']
File "E:\configobj.py", line 580, in __getitem__
val = dict.__getitem__(self, key)
KeyError: section2
What am I doing wrong? Why can't I see the value of item3?
I also want to know how to read a file that is not in the same folder
as configobj.py I tried with E:\\foldername\test.ini but I got a parse
error in configobj.py...
Thank you
|
|
From: Michael F. <fuz...@vo...> - 2008-08-26 15:22:19
|
Hello Daniel, I've fixed the problem, plus a couple of warnings in SVN. As there are no code changes I haven't bumped the version number. I can successfully build API docs with Epydoc with this version. Michael Daniel Watkins wrote: > Hi Michael, > > Thanks for such a quick response. :) > > On Thu, 21 Aug 2008 19:55:29 +0300 > "Michael Foord" <fuz...@vo...> wrote: > >> Hmmm... I've managed to view the attachment. Epydoc is complaining >> about the reST syntax - presumably in a docstring. There are various >> possibilities, including the possibility that you are using an old >> version of docutils. I would check if using the latest release helps >> (0.5.0 - the previous release is about 2 years old). >> > I am using the latest docutils. The issue seems to be the use of > '.. caution::' in the docstring of configobj.Section.walk. Despite > some time spent poking around, I couldn't work out anything more than > this. > > >> I can look at this in more detail on my return. >> > Thanks. :) Enjoy the rest of your time in Romania. > > > Dan > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > ------------------------------------------------------------------------ > > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ |
|
From: Michael F. <fuz...@vo...> - 2008-08-22 08:46:48
|
2008/8/21 Daniel Watkins <da...@da...> > Hi Michael, > > Thanks for such a quick response. :) > > On Thu, 21 Aug 2008 19:55:29 +0300 > "Michael Foord" <fuz...@vo...> wrote: > > Hmmm... I've managed to view the attachment. Epydoc is complaining > > about the reST syntax - presumably in a docstring. There are various > > possibilities, including the possibility that you are using an old > > version of docutils. I would check if using the latest release helps > > (0.5.0 - the previous release is about 2 years old). > I am using the latest docutils. The issue seems to be the use of > '.. caution::' in the docstring of configobj.Section.walk. Despite > some time spent poking around, I couldn't work out anything more than > this. If that is the only issue, then replacing it with the following will probably work: .. admonition:: caution (If it still fails, try warning instead of caution.) If it works I'll patch in subversion on my return. Michael > > > > I can look at this in more detail on my return. > Thanks. :) Enjoy the rest of your time in Romania. > > > Dan > > -- > Daniel Watkins (Odd_Bloke) > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ |
|
From: Daniel W. <da...@da...> - 2008-08-21 17:35:14
|
Hi Michael, Thanks for such a quick response. :) On Thu, 21 Aug 2008 19:55:29 +0300 "Michael Foord" <fuz...@vo...> wrote: > Hmmm... I've managed to view the attachment. Epydoc is complaining > about the reST syntax - presumably in a docstring. There are various > possibilities, including the possibility that you are using an old > version of docutils. I would check if using the latest release helps > (0.5.0 - the previous release is about 2 years old). I am using the latest docutils. The issue seems to be the use of '.. caution::' in the docstring of configobj.Section.walk. Despite some time spent poking around, I couldn't work out anything more than this. > I can look at this in more detail on my return. Thanks. :) Enjoy the rest of your time in Romania. Dan -- Daniel Watkins (Odd_Bloke) |
|
From: Michael F. <fuz...@vo...> - 2008-08-21 16:55:37
|
Hmmm... I've managed to view the attachment. Epydoc is complaining about the reST syntax - presumably in a docstring. There are various possibilities, including the possibility that you are using an old version of docutils. I would check if using the latest release helps (0.5.0 - the previous release is about 2 years old). I can look at this in more detail on my return. Michael 2008/8/21 Daniel Watkins <da...@da...> > Hello all, > > I currently have an 'Intend To Adopt' bug open in Debian for > configobj[0]. For those of you who don't know, this means that I'm > intending to become responsible for packaging configobj in Debian. > > My first action was to be the release of configobj 4.5.3 (Debian > currently only has 4.5.2). However, I'm having difficulty generating > the documentation to be included in the package. I'm running: > $ epydoc -o configobj-api configobj --debug > which gives the attached on stderr. > > This is a blocker on the new Debian version (and presumably future > versions), so I'd appreciate any help that can be proffered. > > Regards, > > Dan > > [Footnote 0: http://bugs.debian.org/493792] > -- > Daniel Watkins (Odd_Bloke) > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ |
|
From: Michael F. <fuz...@vo...> - 2008-08-21 16:51:40
|
Hi Daniel, I'm currently in Romania (and can't even view the attachment!). I'll look at it as soon as I return (Monday). ConfigObj wasn't written with creating documentation from epydoc in mind by the way. If the fix is trivial (which I assume it will be) then I'll be happy to include it of course. Thanks for adopting ConfigObj. Michael 2008/8/21 Daniel Watkins <da...@da...> > Hello all, > > I currently have an 'Intend To Adopt' bug open in Debian for > configobj[0]. For those of you who don't know, this means that I'm > intending to become responsible for packaging configobj in Debian. > > My first action was to be the release of configobj 4.5.3 (Debian > currently only has 4.5.2). However, I'm having difficulty generating > the documentation to be included in the package. I'm running: > $ epydoc -o configobj-api configobj --debug > which gives the attached on stderr. > > This is a blocker on the new Debian version (and presumably future > versions), so I'd appreciate any help that can be proffered. > > Regards, > > Dan > > [Footnote 0: http://bugs.debian.org/493792] > -- > Daniel Watkins (Odd_Bloke) > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ |
|
From: Michael F. <fuz...@vo...> - 2008-08-12 20:44:01
|
David B. wrote: > Thanks, that will work for me. For future reference is replacing a > function like i mentioned previously a bad practice? (Assuming i cant > find the proper way to do it like you showed me or there is not one > available.) > Monkey patching at runtime is slightly frowned on (it becomes a maintenance nightmare), but sometimes you have no choice. Michael > Thanks so much for your assistance. > > > Michael Foord wrote: > >> David B. wrote: >> >> >>> Apparently i was looking at the documentation for an older version of configobj. >>> >>> http://www.voidspace.org.uk/python/configobj3.html#exceptions >>> >>> My apologies. However, I still need a way to prevent configobj from stopping when it finds a duplicate key word entry. The link you posted says that the default for raise_errors is False and that parsing should continue. However for my program it stops parsing and the program exits. I did find that i can define the following in my program and it works for me: >>> >>> >>> >>> >> Although ConfigObj continues parsing it still raises an exception when >> it finishes parsing. >> >> Therefore instead of your code you could use: >> >> try: >> >> config = ConfigObj(filename) >> except ConfigObjError, e: >> config = e.config >> >> This ignores the error and uses whatever ConfigObj managed to find. >> >> Michael >> >> >> >>> def _handle_error(self, text, ErrorClass, infile, cur_index): >>> ##the next two lines i added to stop duplicate >>> ##entries from causing problems >>> if ErrorClass ==configobj.DuplicateError: >>> return >>> ##this is the end of the changes i made. >>> line = infile[cur_index] >>> cur_index += 1 >>> message = text % cur_index >>> error = ErrorClass(message, cur_index, line) >>> if self.raise_errors: >>> # raise the error - parsing stops here >>> raise error >>> # store the error >>> # reraise when parsing has finished >>> self._errors.append(error) >>> configobj.ConfigObj._handle_error=_handle_error >>> >>> This works but im not sure that this is "good coding" practice. >>> The following is the problem im am having. >>> >>> >>> >>>>>> x=configobj.ConfigObj("conf") >>>>>> >>>>>> >>>>>> >>> Traceback (most recent call last): >>> File "<stdin>", line 1, in <module> >>> File "/var/lib/python-support/python2.5/configobj.py", line 1272, in __init__ >>> self._load(infile, configspec) >>> File "/var/lib/python-support/python2.5/configobj.py", line 1355, in _load >>> raise error >>> configobj.DuplicateError: Duplicate keyword name at line 3. >>> >>> the conf file looks like this: >>> [conf] >>> value1= workgroup >>> value1=workgroup2 >>> >>> Any pointers would be appreciated. >>> Thanks, >>> David >>> >>> >>> >>> Michael Foord wrote: >>> >>> >>> >>>> David B. wrote: >>>> >>>> >>>> >>>> >>>>> Im trying to use the exceptionlist that is mentioned in the docs on the >>>>> website to stop my program from erroring out if there is a duplicate >>>>> value entered in the config file. However, when i try to do >>>>> >>>>> from configobj import exceptionlist >>>>> >>>>> like the website says to do, i get the following: >>>>> >>>>> >>> from configobj import exceptionlist >>>>> Traceback (most recent call last): >>>>> File "<stdin>", line 1, in <module> >>>>> ImportError: cannot import name exceptionlist >>>>> >>>>> >>>>> >>>>> >>>>> >>>> ConfigObj doesn't define any 'exceptionlist', nor is it in the >>>> documentation. Where are you getting this example from? >>>> >>>> The ConfigObj exceptions are documented at: >>>> >>>> http://www.voidspace.org.uk/python/configobj.html#exceptions >>>> >>>> Michael Foord >>>> >>>> >>>> >>>> >>>> >>>>> can anyone help me? >>>>> thanks. >>>>> David. >>>>> >>>>> ------------------------------------------------------------------------- >>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >>>>> Build the coolest Linux based applications with Moblin SDK & win great prizes >>>>> Grand prize is a trip for two to an Open Source event anywhere in the world >>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >>>>> _______________________________________________ >>>>> Configobj-develop mailing list >>>>> Con...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/configobj-develop >>>>> >>>>> >>>>> >>>>> >>>>> >>>> -- >>>> http://www.ironpythoninaction.com/ >>>> http://www.voidspace.org.uk/ >>>> http://www.trypython.org/ >>>> http://www.ironpython.info/ >>>> http://www.theotherdelia.co.uk/ >>>> http://www.resolverhacks.net/ >>>> >>>> >>>> ------------------------------------------------------------------------- >>>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >>>> Build the coolest Linux based applications with Moblin SDK & win great prizes >>>> Grand prize is a trip for two to an Open Source event anywhere in the world >>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >>>> _______________________________________________ >>>> Configobj-develop mailing list >>>> Con...@li... >>>> https://lists.sourceforge.net/lists/listinfo/configobj-develop >>>> . >>>> >>>> >>>> >>>> >>>> >>> ------------------------------------------------------------------------- >>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >>> Build the coolest Linux based applications with Moblin SDK & win great prizes >>> Grand prize is a trip for two to an Open Source event anywhere in the world >>> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >>> _______________________________________________ >>> Configobj-develop mailing list >>> Con...@li... >>> https://lists.sourceforge.net/lists/listinfo/configobj-develop >>> >>> >>> >> -- >> http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >> Build the coolest Linux based applications with Moblin SDK & win great prizes >> Grand prize is a trip for two to an Open Source event anywhere in the world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Configobj-develop mailing list >> Con...@li... >> https://lists.sourceforge.net/lists/listinfo/configobj-develop >> . >> >> >> > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ |
|
From: Michael F. <fuz...@vo...> - 2008-08-12 17:46:47
|
Sebastian Wiesner wrote: > Oliver Schweitzer <oli...@gm...> at Tuesday 12 August 2008, > 14:00:47 > >> Hello, >> >> first many thanks to the authors and contributors for making available >> such a flexible, powerful and clean tool. >> >> My question: Is anyone aware of a reusable widget/component that would >> allow me to display/interactively edit a CongfigObj in memory? >> >> If not, any hints on building such a beast? >> > > http://paste.pocoo.org/show/79974/ > > Implemented on the top of PyQt4. It's only PoC code, but I think it > illustrates the general approach and serves as small base for something > more powerful. > Nice! Thanks Michael > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > ------------------------------------------------------------------------ > > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ |
|
From: Sebastian W. <bas...@gm...> - 2008-08-12 16:16:18
|
Oliver Schweitzer <oli...@gm...> at Tuesday 12 August 2008, 14:00:47 > Hello, > > first many thanks to the authors and contributors for making available > such a flexible, powerful and clean tool. > > My question: Is anyone aware of a reusable widget/component that would > allow me to display/interactively edit a CongfigObj in memory? > > If not, any hints on building such a beast? http://paste.pocoo.org/show/79974/ Implemented on the top of PyQt4. It's only PoC code, but I think it illustrates the general approach and serves as small base for something more powerful. -- Freedom is always the freedom of dissenters. (Rosa Luxemburg) |
|
From: Oliver S. <oli...@gm...> - 2008-08-12 12:01:11
|
Hello, first many thanks to the authors and contributors for making available such a flexible, powerful and clean tool. My question: Is anyone aware of a reusable widget/component that would allow me to display/interactively edit a CongfigObj in memory? If not, any hints on building such a beast? Best regards, Oliver Schweitzer |
|
From: David B. <da...@gm...> - 2008-08-10 23:22:39
|
Thanks, that will work for me. For future reference is replacing a function like i mentioned previously a bad practice? (Assuming i cant find the proper way to do it like you showed me or there is not one available.) Thanks so much for your assistance. Michael Foord wrote: > David B. wrote: > >> Apparently i was looking at the documentation for an older version of configobj. >> >> http://www.voidspace.org.uk/python/configobj3.html#exceptions >> >> My apologies. However, I still need a way to prevent configobj from stopping when it finds a duplicate key word entry. The link you posted says that the default for raise_errors is False and that parsing should continue. However for my program it stops parsing and the program exits. I did find that i can define the following in my program and it works for me: >> >> >> > > Although ConfigObj continues parsing it still raises an exception when > it finishes parsing. > > Therefore instead of your code you could use: > > try: > > config = ConfigObj(filename) > except ConfigObjError, e: > config = e.config > > This ignores the error and uses whatever ConfigObj managed to find. > > Michael > > >> def _handle_error(self, text, ErrorClass, infile, cur_index): >> ##the next two lines i added to stop duplicate >> ##entries from causing problems >> if ErrorClass ==configobj.DuplicateError: >> return >> ##this is the end of the changes i made. >> line = infile[cur_index] >> cur_index += 1 >> message = text % cur_index >> error = ErrorClass(message, cur_index, line) >> if self.raise_errors: >> # raise the error - parsing stops here >> raise error >> # store the error >> # reraise when parsing has finished >> self._errors.append(error) >> configobj.ConfigObj._handle_error=_handle_error >> >> This works but im not sure that this is "good coding" practice. >> The following is the problem im am having. >> >> >>>>> x=configobj.ConfigObj("conf") >>>>> >>>>> >> Traceback (most recent call last): >> File "<stdin>", line 1, in <module> >> File "/var/lib/python-support/python2.5/configobj.py", line 1272, in __init__ >> self._load(infile, configspec) >> File "/var/lib/python-support/python2.5/configobj.py", line 1355, in _load >> raise error >> configobj.DuplicateError: Duplicate keyword name at line 3. >> >> the conf file looks like this: >> [conf] >> value1= workgroup >> value1=workgroup2 >> >> Any pointers would be appreciated. >> Thanks, >> David >> >> >> >> Michael Foord wrote: >> >> >>> David B. wrote: >>> >>> >>> >>>> Im trying to use the exceptionlist that is mentioned in the docs on the >>>> website to stop my program from erroring out if there is a duplicate >>>> value entered in the config file. However, when i try to do >>>> >>>> from configobj import exceptionlist >>>> >>>> like the website says to do, i get the following: >>>> >>>> >>> from configobj import exceptionlist >>>> Traceback (most recent call last): >>>> File "<stdin>", line 1, in <module> >>>> ImportError: cannot import name exceptionlist >>>> >>>> >>>> >>>> >>> ConfigObj doesn't define any 'exceptionlist', nor is it in the >>> documentation. Where are you getting this example from? >>> >>> The ConfigObj exceptions are documented at: >>> >>> http://www.voidspace.org.uk/python/configobj.html#exceptions >>> >>> Michael Foord >>> >>> >>> >>> >>>> can anyone help me? >>>> thanks. >>>> David. >>>> >>>> ------------------------------------------------------------------------- >>>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >>>> Build the coolest Linux based applications with Moblin SDK & win great prizes >>>> Grand prize is a trip for two to an Open Source event anywhere in the world >>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >>>> _______________________________________________ >>>> Configobj-develop mailing list >>>> Con...@li... >>>> https://lists.sourceforge.net/lists/listinfo/configobj-develop >>>> >>>> >>>> >>>> >>> -- >>> http://www.ironpythoninaction.com/ >>> http://www.voidspace.org.uk/ >>> http://www.trypython.org/ >>> http://www.ironpython.info/ >>> http://www.theotherdelia.co.uk/ >>> http://www.resolverhacks.net/ >>> >>> >>> ------------------------------------------------------------------------- >>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >>> Build the coolest Linux based applications with Moblin SDK & win great prizes >>> Grand prize is a trip for two to an Open Source event anywhere in the world >>> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >>> _______________________________________________ >>> Configobj-develop mailing list >>> Con...@li... >>> https://lists.sourceforge.net/lists/listinfo/configobj-develop >>> . >>> >>> >>> >>> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >> Build the coolest Linux based applications with Moblin SDK & win great prizes >> Grand prize is a trip for two to an Open Source event anywhere in the world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Configobj-develop mailing list >> Con...@li... >> https://lists.sourceforge.net/lists/listinfo/configobj-develop >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > . > > |
|
From: Michael F. <fuz...@vo...> - 2008-08-10 22:37:40
|
David B. wrote: > Apparently i was looking at the documentation for an older version of configobj. > > http://www.voidspace.org.uk/python/configobj3.html#exceptions > > My apologies. However, I still need a way to prevent configobj from stopping when it finds a duplicate key word entry. The link you posted says that the default for raise_errors is False and that parsing should continue. However for my program it stops parsing and the program exits. I did find that i can define the following in my program and it works for me: > > Although ConfigObj continues parsing it still raises an exception when it finishes parsing. Therefore instead of your code you could use: try: config = ConfigObj(filename) except ConfigObjError, e: config = e.config This ignores the error and uses whatever ConfigObj managed to find. Michael > def _handle_error(self, text, ErrorClass, infile, cur_index): > ##the next two lines i added to stop duplicate > ##entries from causing problems > if ErrorClass ==configobj.DuplicateError: > return > ##this is the end of the changes i made. > line = infile[cur_index] > cur_index += 1 > message = text % cur_index > error = ErrorClass(message, cur_index, line) > if self.raise_errors: > # raise the error - parsing stops here > raise error > # store the error > # reraise when parsing has finished > self._errors.append(error) > configobj.ConfigObj._handle_error=_handle_error > > This works but im not sure that this is "good coding" practice. > The following is the problem im am having. > >>>> x=configobj.ConfigObj("conf") >>>> > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "/var/lib/python-support/python2.5/configobj.py", line 1272, in __init__ > self._load(infile, configspec) > File "/var/lib/python-support/python2.5/configobj.py", line 1355, in _load > raise error > configobj.DuplicateError: Duplicate keyword name at line 3. > > the conf file looks like this: > [conf] > value1= workgroup > value1=workgroup2 > > Any pointers would be appreciated. > Thanks, > David > > > > Michael Foord wrote: > >> David B. wrote: >> >> >>> Im trying to use the exceptionlist that is mentioned in the docs on the >>> website to stop my program from erroring out if there is a duplicate >>> value entered in the config file. However, when i try to do >>> >>> from configobj import exceptionlist >>> >>> like the website says to do, i get the following: >>> >>> >>> from configobj import exceptionlist >>> Traceback (most recent call last): >>> File "<stdin>", line 1, in <module> >>> ImportError: cannot import name exceptionlist >>> >>> >>> >> ConfigObj doesn't define any 'exceptionlist', nor is it in the >> documentation. Where are you getting this example from? >> >> The ConfigObj exceptions are documented at: >> >> http://www.voidspace.org.uk/python/configobj.html#exceptions >> >> Michael Foord >> >> >> >>> can anyone help me? >>> thanks. >>> David. >>> >>> ------------------------------------------------------------------------- >>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >>> Build the coolest Linux based applications with Moblin SDK & win great prizes >>> Grand prize is a trip for two to an Open Source event anywhere in the world >>> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >>> _______________________________________________ >>> Configobj-develop mailing list >>> Con...@li... >>> https://lists.sourceforge.net/lists/listinfo/configobj-develop >>> >>> >>> >> -- >> http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >> Build the coolest Linux based applications with Moblin SDK & win great prizes >> Grand prize is a trip for two to an Open Source event anywhere in the world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Configobj-develop mailing list >> Con...@li... >> https://lists.sourceforge.net/lists/listinfo/configobj-develop >> . >> >> >> > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ |
|
From: David B. <da...@gm...> - 2008-08-10 22:32:17
|
Apparently i was looking at the documentation for an older version of configobj. http://www.voidspace.org.uk/python/configobj3.html#exceptions My apologies. However, I still need a way to prevent configobj from stopping when it finds a duplicate key word entry. The link you posted says that the default for raise_errors is False and that parsing should continue. However for my program it stops parsing and the program exits. I did find that i can define the following in my program and it works for me: def _handle_error(self, text, ErrorClass, infile, cur_index): ##the next two lines i added to stop duplicate ##entries from causing problems if ErrorClass ==configobj.DuplicateError: return ##this is the end of the changes i made. line = infile[cur_index] cur_index += 1 message = text % cur_index error = ErrorClass(message, cur_index, line) if self.raise_errors: # raise the error - parsing stops here raise error # store the error # reraise when parsing has finished self._errors.append(error) configobj.ConfigObj._handle_error=_handle_error This works but im not sure that this is "good coding" practice. The following is the problem im am having. >>>x=configobj.ConfigObj("conf") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/var/lib/python-support/python2.5/configobj.py", line 1272, in __init__ self._load(infile, configspec) File "/var/lib/python-support/python2.5/configobj.py", line 1355, in _load raise error configobj.DuplicateError: Duplicate keyword name at line 3. >>> the conf file looks like this: [conf] value1= workgroup value1=workgroup2 Any pointers would be appreciated. Thanks, David Michael Foord wrote: > David B. wrote: > >> Im trying to use the exceptionlist that is mentioned in the docs on the >> website to stop my program from erroring out if there is a duplicate >> value entered in the config file. However, when i try to do >> >> from configobj import exceptionlist >> >> like the website says to do, i get the following: >> >> >>> from configobj import exceptionlist >> Traceback (most recent call last): >> File "<stdin>", line 1, in <module> >> ImportError: cannot import name exceptionlist >> >> > > ConfigObj doesn't define any 'exceptionlist', nor is it in the > documentation. Where are you getting this example from? > > The ConfigObj exceptions are documented at: > > http://www.voidspace.org.uk/python/configobj.html#exceptions > > Michael Foord > > >> can anyone help me? >> thanks. >> David. >> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >> Build the coolest Linux based applications with Moblin SDK & win great prizes >> Grand prize is a trip for two to an Open Source event anywhere in the world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Configobj-develop mailing list >> Con...@li... >> https://lists.sourceforge.net/lists/listinfo/configobj-develop >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > . > > |
|
From: Michael F. <fuz...@vo...> - 2008-08-10 15:25:49
|
David B. wrote: > Im trying to use the exceptionlist that is mentioned in the docs on the > website to stop my program from erroring out if there is a duplicate > value entered in the config file. However, when i try to do > > from configobj import exceptionlist > > like the website says to do, i get the following: > > >>> from configobj import exceptionlist > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > ImportError: cannot import name exceptionlist > ConfigObj doesn't define any 'exceptionlist', nor is it in the documentation. Where are you getting this example from? The ConfigObj exceptions are documented at: http://www.voidspace.org.uk/python/configobj.html#exceptions Michael Foord > can anyone help me? > thanks. > David. > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ |
|
From: David B. <da...@gm...> - 2008-08-10 00:56:47
|
Im trying to use the exceptionlist that is mentioned in the docs on the website to stop my program from erroring out if there is a duplicate value entered in the config file. However, when i try to do from configobj import exceptionlist like the website says to do, i get the following: >>> from configobj import exceptionlist Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: cannot import name exceptionlist can anyone help me? thanks. David. |
|
From: Michael F. <fuz...@vo...> - 2008-07-16 11:47:32
|
Jeff Balogh wrote:
> ConfigObj raises a parse error when it finds a line with quoted and
> non-quoted words in the same line. The original failure was
> discovered when someone tried to write an email as
>
> email = "name" <na...@ex...>
>
> I'm attaching a patch with a failing test. It's against
> configobj_test.py from the latest configobj.zip, since I didn't find
> the test file in svn.
>
I don't think this is a bug. Quotes are used to 'contain' values, and if
a line starts with double quotes it is fair to assume it is a quoted value.
It would unnecessarily complicate the parser to change this behaviour.
At least you can use:
email = '"name" <na...@ex...>'
I would certainly consider a patch though. :-)
Michael
> Cheers,
> Jeff Balogh
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> ------------------------------------------------------------------------
>
> _______________________________________________
> Configobj-develop mailing list
> Con...@li...
> https://lists.sourceforge.net/lists/listinfo/configobj-develop
>
--
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/
http://www.trypython.org/
http://www.ironpython.info/
http://www.theotherdelia.co.uk/
http://www.resolverhacks.net/
|
|
From: Jeff B. <its...@gm...> - 2008-07-16 03:36:50
|
ConfigObj raises a parse error when it finds a line with quoted and
non-quoted words in the same line. The original failure was
discovered when someone tried to write an email as
email = "name" <na...@ex...>
I'm attaching a patch with a failing test. It's against
configobj_test.py from the latest configobj.zip, since I didn't find
the test file in svn.
Cheers,
Jeff Balogh
|
|
From: Marc T. <mar...@gm...> - 2008-06-24 20:30:21
|
On Tue, Jun 24, 2008 at 1:20 PM, Michael Foord <fuz...@vo...> wrote: > > If you checkout from the following URL you won't need to authenticate: > I feel dumb - I was trying to use the "Import" item on the RapidSVN repository menu. Using the same URL under "Checkout" does, indeed, work just fine. Meanwhile, the new version continues to be golden for me. Thank you again. -- www.fsrtechnologies.com |
|
From: Michael F. <fuz...@vo...> - 2008-06-24 20:21:27
|
Marc Tompkins wrote: > On Sun, Jun 22, 2008 at 12:47 PM, Michael Foord > <fuz...@vo... <mailto:fuz...@vo...>> wrote: > > Hello Marc, > > There is a fixed version now in subversion - I'd be grateful if you > could try it and report any issues you have. > > I have one more problem to investigate that was reported a while ago. > > Michael > > > Sorry for the delay - I generally use bazaar, not SVN, and had > uninstalled Tortoise 'cause I hated it; I installed RapidSVN this > time. I tried to import your repository but got stopped by a > username/password prompt (for future reference, what SHOULD I enter > there?) > If you checkout from the following URL you won't need to authenticate: http://svn.pythonutils.python-hosting.com/ Glad the change worked for you, I'll bush out a bugfix release soon. Michael Foord -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ |
|
From: Marc T. <mar...@gm...> - 2008-06-22 23:07:56
|
On Sun, Jun 22, 2008 at 12:47 PM, Michael Foord <fuz...@vo...> wrote: > Hello Marc, > > There is a fixed version now in subversion - I'd be grateful if you > could try it and report any issues you have. > > I have one more problem to investigate that was reported a while ago. > > Michael > Sorry for the delay - I generally use bazaar, not SVN, and had uninstalled Tortoise 'cause I hated it; I installed RapidSVN this time. I tried to import your repository but got stopped by a username/password prompt (for future reference, what SHOULD I enter there?) I gave up and just downloaded configobj.py from Revision 88: /trunk/pythonutilsand, so far, it looks great! I see the change you made, replacing two dictionary lookups with get/defaults. Very clever! Unfortunately, you've removed my excuse for procrastination: now I actually have to write the code that adds/edits/deletes job profiles. Dagnabbit, there went the weekend... Ah well, my users will be happy anyway. Thank you! -- www.fsrtechnologies.com |
|
From: Michael F. <fuz...@vo...> - 2008-06-22 20:59:29
|
Jesse Noller wrote:
> He Michael - I hope you don't mind me dropping you a line about this -
>
> Using the latest configObj and validator code - I am trying to build
> up a config file and spec and then do the validation/type coercion on
> it offered by configObj - and I am running into a mystifying issue -
> for example, here is the config file:
>
> ["network_options"]
> portal_port =
>
> And here is the spec:
> ["network_options"]
> portal_port = integer(min=0, default=8082)
>
> When I try this:
>
> vdt = Validator()
> configspec = ConfigObj('config.spec')
> config = ConfigObj(configFile, configspec=configspec)
> config.validate(vdt)
>
>
I'm really sorry - I should have looked at this more closely when you
sent it.
The answer is really quite simple. In order for a ConfigObj instance to
be used as a configspec it must be created with 'list_values=False' (or
the commas in the configspec will cause the right hand side to be parsed
as a list.
configspec = ConfigObj('config.spec', list_values=False)
Should work. Sorry that took so long.
Michael Foord
> It explodes with:
>
> Traceback (most recent call last):
> File "ctransfer.py", line 92, in <module>
> sys.exit(main(sys.argv[1]))
> File "ctransfer.py", line 85, in main
> config = load_config(configFile)
> File "ctransfer.py", line 49, in load_config
> config.validate(vdt)
> File "/Library/Python/2.5/site-packages/configobj.py", line 2301, in validate
> copy=copy, section=section[entry])
> File "/Library/Python/2.5/site-packages/configobj.py", line 2245, in validate
> missing=missing
> File "/Library/Python/2.5/site-packages/validate.py", line 595, in check
> fun_name, fun_args, fun_kwargs, default = self._parse_with_caching(check)
> File "/Library/Python/2.5/site-packages/validate.py", line 620, in
> _parse_with_caching
> if check in self._cache:
> TypeError: list objects are unhashable
>
> I added some debugging (print statements for the win) to the code and
> found that check looks like this:
>
> ['integer(min=0', 'default=8082)']
>
> So on line 619 - check is actually being passed in as a list so the if
> check in self._cache check fails. Did I do something horribly wrong
> here?
>
> -jesse
>
--
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/
http://www.trypython.org/
http://www.ironpython.info/
http://www.theotherdelia.co.uk/
http://www.resolverhacks.net/
|
|
From: Michael F. <fuz...@vo...> - 2008-06-22 19:48:08
|
Hello Marc, There is a fixed version now in subversion - I'd be grateful if you could try it and report any issues you have. I have one more problem to investigate that was reported a while ago. Michael Marc Tompkins wrote: > Hi all - > > I hope this is not a horribly stupid question... > > I'm setting up my configspec thusly: > > > tmpStr = """[Current] > npiXMLFile = string(default="npiMap.XML") > InHist = string_list(default=None) > OutHist = string_list(default=None) > Submitter = string(default=None) > Carrier = string(default=None) > MainSize = tuple() > MainPos = tuple() > SummarySize = tuple() > SummaryPos = tuple() > ConfirmSuccess = boolean(default=True) > CvtCarrier = boolean(default=False) > KeepLicense = boolean(default=False) > KeepInsID = boolean(default=False) > KeepTaxID = boolean(default=True) > KeepUxIN = boolean(default=True) > KeepFacID = boolean(default=False) > UseSecID = boolean(default=False) > FixSSN = boolean(default=True) > DNtoDQ = boolean(default=False) > [JobProfiles] > [[__many__]] > Submitter = string(default=" ") > Carrier = string(default=" ") > CvtCarrier = boolean(default=False) > KeepLicense = boolean(default=False) > KeepInsID = boolean(default=False) > KeepTaxID = boolean(default=True) > KeepUxIN = boolean(default=True) > KeepFacID = boolean(default=False) > UseSecID = boolean(default=False) > FixSSN = boolean(default=True) > DNtoDQ = boolean(default=False) > InFile = string(default="") > OutFile = string(default="") > """ > cfgSpec = StringIO.StringIO(tmpStr) > cfgFile = ConfigObj(cfgFileName, > configspec=cfgSpec, raise_errors=True, > write_empty_values = True, > create_empty=True, indent_type=' ', list_values > = True) > vtor = Validator() > > > and validating it thusly: > > test = cfgFile.validate(vtor, copy=True) > cfgFile.write() > > > My actual ini file looks like so: > > [Current] > npiXMLFile = file:///E:/ultrahld/npiMap.xml > Submitter = 1234567 > Carrier = ColoradoMedicare > ConfirmSuccess = True > KeepLicense = False > KeepInsID = False > KeepTaxID = True > KeepUxIN = False > KeepFacID = False > UseSecID = True > FixSSN = True > DNtoDQ = False > InHist = E:\ultrahld\MCARE06.837, E:\ultrahld\MCARE04.837, > E:\bbs\out.837 > OutHist = E:\bbs\out.837, E:\bbs\MCAL03.NPI > CvtCarrier = True > [JobProfiles] > [[Bogus]] > Submitter = 8675309 > Carrier = NHIC > CvtCarrier = False > KeepLicense = False > KeepInsID = False > KeepTaxID = True > KeepUxIN = True > KeepFacID = False > UseSecID = False > FixSSN = True > DNtoDQ = False > InFile = E:\ultrahld\MCARE04.837 > OutFile = E:\bbs\out.837 > [[ReallyBogus]] > Submitter = 345678 > Carrier = NHIC > CvtCarrier = False > KeepLicense = False > KeepInsID = False > KeepTaxID = True > KeepUxIN = True > KeepFacID = False > UseSecID = False > FixSSN = True > DNtoDQ = False > InFile = E:\ultrahld\MCARE03.837 > OutFile = E:\bbs\out.837 > > > If I cut the file short after [JobProfiles], all is well, but if I > include [[Bogus]] or [[ReallyBogus]] the validation blows up with the > following: > Traceback (most recent call last): > > File "E:\fsrPy\FSR-X12\fsr_x12.pyw", line 538, in <module> > main() > File "E:\fsrPy\FSR-X12\fsr_x12.pyw", line 530, in main > test = Global.cfgFile.validate(Global.vtor, copy=True) > File "c:\python25\lib\site-packages\configobj.py", line 2301, in > validate > copy=copy, section=section[entry]) > File "c:\python25\lib\site-packages\configobj.py", line 2297, in > validate > section.comments[entry] = section._cs_section_comments[entry] > KeyError: 'Bogus' > Script terminated. > > > I was poking around adding pprint() statements in configobj.py, and > the problem seems to be that when "__many__" occurs in the configspec, > no entries are created in section._cs_section_comments - which of > course they wouldn't be, because we don't know what the subsection > names are yet. > > I'm not actually using comments, and probably never will, so I suppose > I could just rip out all of that... but there must be a better way, > and I can't possibly be the only one who's run into this. However, I > haven't seen it mentioned in the list archives, so I suspect I'm doing > something wrong. What should I do? > > Windows XP Pro SP3 > Python 2.5.1 > wxPython 2.8.7.1 <http://2.8.7.1> > ConfigObj 4 > > -- > www.fsrtechnologies.com <http://www.fsrtechnologies.com> > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > ------------------------------------------------------------------------ > > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ |
|
From: Michael F. <fuz...@vo...> - 2008-06-22 19:34:04
|
Marc Tompkins wrote: > On Sun, Jun 22, 2008 at 12:12 PM, Michael Foord > <fuz...@vo... <mailto:fuz...@vo...>> wrote: > > Hello Marc, > > Your problem only occurs if 'copy=True' is set in the call to > validate. > This implies to me that it is a real bug. > > I'm looking at it now. > > > Thank you Fuzzyman! I think I have a fix, but I need to write a proper test for it. All the best, Michael Foord > > -- > www.fsrtechnologies.com <http://www.fsrtechnologies.com> > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > ------------------------------------------------------------------------ > > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ |
|
From: Marc T. <mar...@gm...> - 2008-06-22 19:23:05
|
On Sun, Jun 22, 2008 at 12:12 PM, Michael Foord <fuz...@vo...> wrote: > Hello Marc, > > Your problem only occurs if 'copy=True' is set in the call to validate. > This implies to me that it is a real bug. > > I'm looking at it now. > > Thank you Fuzzyman! -- www.fsrtechnologies.com |