Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #863 (closed defect: fixed)

Opened 13 years ago

Last modified 12 years ago

Cryptic error message for configuration syntax error

Reported by: max Owned by: Fuzzyman
Priority: normal Milestone: 1.0b1
Component: TurboGears Version: 0.9a6
Severity: normal Keywords:
Cc: ischenko@…

Description

Adding line like "kid.encoding = latin1" (note missing quotes over latin1) yields the following cryptic traceback:

Traceback (most recent call last):
  File "D:\Projects\z01\start-z01.py", line 21, in ?
    modulename="z01.config")
  File "d:\projects\3rd-party\turbogears-1.0\turbogears\config.py", line 183, in update_config
    configdata2 = ConfigObj(configfile, unrepr=True)
  File "C:\Python24\lib\site-packages\configobj-4.3.0-py2.4.egg\configobj.py", line 1055, in __init__
  File "C:\Python24\lib\site-packages\configobj-4.3.0-py2.4.egg\configobj.py", line 1323, in _parse
  File "C:\Python24\lib\site-packages\configobj-4.3.0-py2.4.egg\configobj.py", line 1491, in _handle_value
  File "C:\Python24\lib\site-packages\configobj-4.3.0-py2.4.egg\configobj.py", line 203, in unrepr
  File "C:\Python24\lib\site-packages\configobj-4.3.0-py2.4.egg\configobj.py", line 157, in build
  File "C:\Python24\lib\site-packages\configobj-4.3.0-py2.4.egg\configobj.py", line 184, in build_Name
configobj.UnknownType: Undefined Name

TurboGears should be more user-friendly here, at least explaining there was a syntax error and at best giving exact error location.

Change History

comment:1 Changed 13 years ago by fuzzyman@…

  • Owner changed from anonymous to fuzzyman@…

This is a ConfigObj? issue, and will be addressed.

I *should* be able to add a line number. What would you prefer the error message to say ? (Given that in unrepr mode, ConfigObj? is expecting a valid Python expression.)

Fuzzyman

comment:2 Changed 13 years ago by anonymous

  • Owner changed from fuzzyman@… to Fuzzyman

comment:3 Changed 13 years ago by Fuzzyman

This should be fixed in ConfigObj? 4.3.2 (now in subversion)

See :

 http://www.voidspace.org.uk/python/weblog/arch_d7_2006_05_20.shtml#e336

Fuzzyman

comment:4 Changed 13 years ago by max

  • Cc ischenko@… added

OK, but I cannot verify it until 4.3.2 can be installed with easy_install.

comment:5 Changed 13 years ago by jorge.vargas

  • Version changed from 0.9a5 to 0.9a6

a diferent issue but a cryptic error too

Traceback (most recent call last):

File "/usr/local/bin/tg-admin", line 7, in ?

sys.exit(

File "/usr/lib/python2.4/site-packages/TurboGears-0.9a6-py2.4.egg/turbogears/command/base.py", line 274, in main

command = command.load()(turbogears.version)

File "/usr/lib/python2.4/site-packages/TurboGears-0.9a6-py2.4.egg/turbogears/command/base.py", line 101, in init

self.find_config()

File "/usr/lib/python2.4/site-packages/TurboGears-0.9a6-py2.4.egg/turbogears/command/base.py", line 66, in find_config

load_project_config(self.config)

File "/usr/lib/python2.4/site-packages/TurboGears-0.9a6-py2.4.egg/turbogears/command/base.py", line 54, in load_project_config

modulename = package + ".config")

File "/usr/lib/python2.4/site-packages/TurboGears-0.9a6-py2.4.egg/turbogears/config.py", line 183, in update_config

configdata2 = ConfigObj?(configfile, unrepr=True)

File "/usr/lib/python2.4/site-packages/ConfigObj-4.3.1-py2.4.egg/configobj.py", line 1077, in init

configobj.ConfigObjError?: Parsing failed.

this happens when you have 2 keys inside the same section with the same name, which will become a common problem ones people start not seeing the default uncommented sqlobject.dburi in dev.cfg

comment:6 Changed 13 years ago by fuzzyman

  • Status changed from new to closed
  • Resolution set to fixed

All these issues *should* have been addressed by ConfigObj? 4.3.2.

Once this is included in Turbogears, this ticket can be closed. Further issues should be raised in a new ticket.

Note: See TracTickets for help on using tickets.