Tests failing on macOS with "AttributeError: 'InternationalizedText' object has no attribute 'text'" #127
-
I'm trying to run __________________________________________ TestManifest.test_simple_manifest_is_valid __________________________________________
self = <tests.unit.test_manifest.TestManifest testMethod=test_simple_manifest_is_valid>
def test_simple_manifest_is_valid(self):
# Act
> subject = election_factory.get_simple_manifest_from_file()
tests/unit/test_manifest.py:26:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src/electionguard_tools/factories/election_factory.py:84: in get_simple_manifest_from_file
return self._get_manifest_from_file(self.simple_election_manifest_file_name)
src/electionguard_tools/factories/election_factory.py:246: in _get_manifest_from_file
return from_file_to_dataclass(Manifest, os.path.join(data, filename))
src/electionguard_tools/helpers/serialize.py:52: in from_file_to_dataclass
return parse_obj_as(dataclass_type_, data)
pydantic/tools.py:34: in pydantic.tools.parse_obj_as
???
pydantic/tools.py:27: in pydantic.tools._get_parsing_type
???
pydantic/main.py:990: in pydantic.main.create_model
???
pydantic/main.py:299: in pydantic.main.ModelMetaclass.__new__
???
pydantic/fields.py:411: in pydantic.fields.ModelField.infer
???
pydantic/fields.py:342: in pydantic.fields.ModelField.__init__
???
pydantic/fields.py:456: in pydantic.fields.ModelField.prepare
???
pydantic/fields.py:670: in pydantic.fields.ModelField.populate_validators
???
pydantic/validators.py:675: in find_validators
???
pydantic/dataclasses.py:266: in make_dataclass_validator
???
pydantic/dataclasses.py:255: in pydantic.dataclasses.dataclass
???
pydantic/dataclasses.py:250: in pydantic.dataclasses.dataclass.wrap
???
pydantic/dataclasses.py:186: in pydantic.dataclasses._process_class
???
pydantic/main.py:990: in pydantic.main.create_model
???
pydantic/main.py:299: in pydantic.main.ModelMetaclass.__new__
???
pydantic/fields.py:411: in pydantic.fields.ModelField.infer
???
pydantic/fields.py:342: in pydantic.fields.ModelField.__init__
???
pydantic/fields.py:451: in pydantic.fields.ModelField.prepare
???
pydantic/fields.py:629: in pydantic.fields.ModelField._type_analysis
???
pydantic/fields.py:648: in pydantic.fields.ModelField._create_sub_type
???
pydantic/fields.py:342: in pydantic.fields.ModelField.__init__
???
pydantic/fields.py:456: in pydantic.fields.ModelField.prepare
???
pydantic/fields.py:670: in pydantic.fields.ModelField.populate_validators
???
pydantic/validators.py:675: in find_validators
???
pydantic/dataclasses.py:266: in make_dataclass_validator
???
pydantic/dataclasses.py:255: in pydantic.dataclasses.dataclass
???
pydantic/dataclasses.py:250: in pydantic.dataclasses.dataclass.wrap
???
pydantic/dataclasses.py:158: in pydantic.dataclasses._process_class
???
/usr/local/Cellar/python@3.9/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/dataclasses.py:1021: in dataclass
return wrap(cls)
/usr/local/Cellar/python@3.9/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/dataclasses.py:1013: in wrap
return _process_class(cls, init, repr, eq, order, unsafe_hash, frozen)
/usr/local/Cellar/python@3.9/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/dataclasses.py:993: in _process_class
str(inspect.signature(cls)).replace(' -> None', ''))
/usr/local/Cellar/python@3.9/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/inspect.py:3068: in __str__
formatted = str(param)
/usr/local/Cellar/python@3.9/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/inspect.py:2591: in __str__
formatted = '{} = {}'.format(formatted, repr(self._default))
/usr/local/Cellar/python@3.9/3.9.7/Frameworks/Python.framework/Versions/3.9/lib/python3.9/dataclasses.py:370: in wrapper
result = user_function(self)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <[AttributeError("'InternationalizedText' object has no attribute 'text'") raised in repr()] InternationalizedText object at 0x1038b70a0>
> ???
E AttributeError: 'InternationalizedText' object has no attribute 'text' Looking at the I'm sure there's probably something dumb I'm doing, so please let me know if it jumps out at you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Python 3.9.7 has a bug in it that has to be resolved with a patch. There is an open issue for this in the python repository. Switch to 3.9.5. I recommend using pyenv instead of homebrew. |
Beta Was this translation helpful? Give feedback.
Python 3.9.7 has a bug in it that has to be resolved with a patch. There is an open issue for this in the python repository. Switch to 3.9.5. I recommend using pyenv instead of homebrew.
Election-Tech-Initiative/electionguard-python#440