You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pyparsing.ParseException: Expected "]" (at char 14), (line:2, col:7)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/capi/.local/lib64/python3.4/site-packages/pyhocon/config_parser.py", line 51, in parse_file
return ConfigFactory.parse_string(content, os.path.dirname(filename), resolve)
File "/home/capi/.local/lib64/python3.4/site-packages/pyhocon/config_parser.py", line 90, in parse_string
return ConfigParser().parse(content, basedir, resolve)
File "/home/capi/.local/lib64/python3.4/site-packages/pyhocon/config_parser.py", line 272, in parse
config = config_expr.parseString(content, parseAll=True)[0]
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1613, in parseString
raise exc
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1603, in parseString
loc, tokens = self._parse( instring, 0 )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3283, in parseImpl
loc, exprtokens = e._parse( instring, loc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3418, in parseImpl
ret = e._parse( instring, loc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3605, in parseImpl
return self.expr._parse( instring, loc, doActions, callPreParse=False )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3811, in parseImpl
return super(ZeroOrMore, self).parseImpl(instring, loc, doActions)
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3735, in parseImpl
loc, tokens = self_expr_parse( instring, loc, doActions, callPreParse=False )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3418, in parseImpl
ret = e._parse( instring, loc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3605, in parseImpl
return self.expr._parse( instring, loc, doActions, callPreParse=False )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3605, in parseImpl
return self.expr._parse( instring, loc, doActions, callPreParse=False )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3274, in parseImpl
loc, exprtokens = e._parse( instring, loc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3418, in parseImpl
ret = e._parse( instring, loc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3274, in parseImpl
loc, exprtokens = e._parse( instring, loc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3605, in parseImpl
return self.expr._parse( instring, loc, doActions, callPreParse=False )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3811, in parseImpl
return super(ZeroOrMore, self).parseImpl(instring, loc, doActions)
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3735, in parseImpl
loc, tokens = self_expr_parse( instring, loc, doActions, callPreParse=False )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3418, in parseImpl
ret = e._parse( instring, loc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3605, in parseImpl
return self.expr._parse( instring, loc, doActions, callPreParse=False )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3279, in parseImpl
raise ParseSyntaxException._from_exception(pe)
pyparsing.ParseSyntaxException: Expected "]" (at char 14), (line:2, col:7)
Whereas if we use : instead:
foo = [
bar: { baz=1 }
]
With the same code, we get a different outcome:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/capi/.local/lib64/python3.4/site-packages/pyhocon/config_parser.py", line 51, in parse_file
return ConfigFactory.parse_string(content, os.path.dirname(filename), resolve)
File "/home/capi/.local/lib64/python3.4/site-packages/pyhocon/config_parser.py", line 90, in parse_string
return ConfigParser().parse(content, basedir, resolve)
File "/home/capi/.local/lib64/python3.4/site-packages/pyhocon/config_parser.py", line 272, in parse
config = config_expr.parseString(content, parseAll=True)[0]
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1603, in parseString
loc, tokens = self._parse( instring, 0 )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3283, in parseImpl
loc, exprtokens = e._parse( instring, loc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3418, in parseImpl
ret = e._parse( instring, loc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3605, in parseImpl
return self.expr._parse( instring, loc, doActions, callPreParse=False )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3811, in parseImpl
return super(ZeroOrMore, self).parseImpl(instring, loc, doActions)
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3735, in parseImpl
loc, tokens = self_expr_parse( instring, loc, doActions, callPreParse=False )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3418, in parseImpl
ret = e._parse( instring, loc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3605, in parseImpl
return self.expr._parse( instring, loc, doActions, callPreParse=False )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3605, in parseImpl
return self.expr._parse( instring, loc, doActions, callPreParse=False )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3274, in parseImpl
loc, exprtokens = e._parse( instring, loc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3418, in parseImpl
ret = e._parse( instring, loc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3274, in parseImpl
loc, exprtokens = e._parse( instring, loc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3605, in parseImpl
return self.expr._parse( instring, loc, doActions, callPreParse=False )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3811, in parseImpl
return super(ZeroOrMore, self).parseImpl(instring, loc, doActions)
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3735, in parseImpl
loc, tokens = self_expr_parse( instring, loc, doActions, callPreParse=False )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3418, in parseImpl
ret = e._parse( instring, loc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3605, in parseImpl
return self.expr._parse( instring, loc, doActions, callPreParse=False )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3266, in parseImpl
loc, resultlist = self.exprs[0]._parse( instring, loc, doActions, callPreParse=False )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3274, in parseImpl
loc, exprtokens = e._parse( instring, loc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3605, in parseImpl
return self.expr._parse( instring, loc, doActions, callPreParse=False )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3274, in parseImpl
loc, exprtokens = e._parse( instring, loc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3811, in parseImpl
return super(ZeroOrMore, self).parseImpl(instring, loc, doActions)
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3735, in parseImpl
loc, tokens = self_expr_parse( instring, loc, doActions, callPreParse=False )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1375, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 3274, in parseImpl
loc, exprtokens = e._parse( instring, loc, doActions )
File "/usr/lib64/python3.4/site-packages/pyparsing.py", line 1381, in _parseNoCache
tokens = self.postParse( instring, loc, tokens )
File "/home/capi/.local/lib64/python3.4/site-packages/pyhocon/config_parser.py", line 474, in postParse
return [config_values.transform()]
File "/home/capi/.local/lib64/python3.4/site-packages/pyhocon/config_tree.py", line 411, in transform
col=col(self._loc, self._instring)))
pyhocon.exceptions.ConfigWrongTypeException: Token 'ConfigTree([('baz', 1)])' of type ConfigTree (index 1) must be of type str (line: 2, col: 1)
Granted, both are errors. I am still learning HOCON, so I'm assuming you just can't place a key-value pair inside an array, which actually makes sense. However, the pyparsing exception leaking out makes it harder for someone that uses pyhocon, since we have to catch not only pyhocon.exceptions.ConfigException, but also pyparsing stuff (which means we have to import pyparsing in our own code).
The text was updated successfully, but these errors were encountered:
israel-lugo
changed the title
Dict inside an array throws pyparsing exception if we use = instead of :
Key-value inside an array throws pyparsing exception if we use = instead of :
Dec 1, 2016
Incidentally, I actually understood the error message from pyparsing better (in the first example) than the error message from ConfigWrongTypeException ;)
This example:
With this code:
Causes:
Whereas if we use
:
instead:With the same code, we get a different outcome:
Granted, both are errors. I am still learning HOCON, so I'm assuming you just can't place a key-value pair inside an array, which actually makes sense. However, the pyparsing exception leaking out makes it harder for someone that uses pyhocon, since we have to catch not only pyhocon.exceptions.ConfigException, but also pyparsing stuff (which means we have to import pyparsing in our own code).
The text was updated successfully, but these errors were encountered: