configobj validation

A

Andrea Crotti

I seemed to remember that type validation and type conversion worked out
of the box, but now
I can't get it working anymore.

Shouldn't this simple example actually fail the parsing (instead it
parses perfectly port to a string)?

sample.py:
from configobj import ConfigObj

conf = ConfigObj('sample.conf', configspec='sample.spec')

sample.conf:
port = some_string

sample.spec:
port = integer(0, 10)

PS. using configobj 4.7.2
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,147
Messages
2,570,835
Members
47,382
Latest member
MichaleStr

Latest Threads

Top