Closed jamadden closed 5 years ago
Hmm. There may be an issue here:
>>> from zope.configuration.fields import GlobalObject
>>> go = GlobalObject()
>>> go.fromUnicode('pkg._private')
Traceback ...
InvalidDottedName: foo._abc
Meanwhile, PythonIdentifier
allows for underscores in segments:
>>> from zope.configuration.fields import PythonIdentifier
>>> pi = PythonIdentifier()
>>> pi.validate('_abc')
>>>
I would think this is a bug in zope.schema.DottedName
. If that's fixed, then PythonIdentifier can be changed to just extend DottedName
with min_dots = max_dots = 0
Rebased on master and updated to use the newer DottedName that fixes the above issue.
Rebased on master, post #30
Cool! Thanks!
Fixes #6
Also make all fields provide the
value
andfield
when they raise an exception.Based on #24 so tests pass.