Issue 11078

Support for iso-codes >= 4.8.0
The value "district with special status" for field "Type" in "Subdivision" is not one of the allowed options (issue 11128)
Nosy list
Assigned to

Created on 2021-12-21.21:56:52 by yangoon, last changed 10 months ago by ced.


Author: [hidden] (yangoon) Tryton translator
Date: 2022-01-10.20:27:58


FYI a new version of pycountry has now been released upstream and it includes
the iso-codes 4.8.0 data which presumably makes the tests fail upstream.
tryton upstream seem to want to be reactive rather than proactive in dealing
with this problem, so now is the time for them act, I guess.

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-12-22.09:13:15

If you really want but we are not going to do something for a problem that does not exist yet.

Author: [hidden] (yangoon) Tryton translator
Date: 2021-12-22.08:38:32

Therefore this is not a bug report, but a feature request.

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-12-21.23:00:41

The module still works correctly with the latest release of pycountry.

Author: [hidden] (yangoon) Tryton translator
Date: 2021-12-21.21:56:52

iso-codes 4.8. was released with some structural changes that lead to failures in the country import script. It seems pycountry is already adapted.

Relevant issues:

Doctest: scenario_country_import.rst ... Update countries
Update subdivisions

FAIL: /usr/lib/python3/dist-packages/trytond/modules/country/tests/scenario_country_import.rst
Doctest: scenario_country_import.rst
Traceback (most recent call last):
  File "/usr/lib/python3.9/", line 2202, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for scenario_country_import.rst
  File "/usr/lib/python3/dist-packages/trytond/modules/country/tests/scenario_country_import.rst", line 0

File "/usr/lib/python3/dist-packages/trytond/modules/country/tests/scenario_country_import.rst", line 21, in scenario_country_import.rst
Failed example:
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python3.9/", line 1334, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest scenario_country_import.rst[7]>", line 1, in <module>
      File "/usr/lib/python3/dist-packages/trytond/modules/country/scripts/", line 169, in do_import
        subdivisions = update_subdivisions(countries, subdivisions)
      File "/usr/lib/python3/dist-packages/trytond/modules/country/scripts/", line 114, in update_subdivisions
      File "/usr/lib/python3/dist-packages/proteus/", line 104, in newfunc
        return self.func(owner, *args, **kwargs)
      File "/usr/lib/python3/dist-packages/proteus/", line 847, in save
        ids = proxy.create(values, context)
      File "/usr/lib/python3/dist-packages/proteus/", line 198, in __call__
        result = rpc.result(meth(*args, **kwargs))
      File "/usr/lib/python3/dist-packages/trytond/modules/country/", line 240, in create
        return super(Subdivision, cls).create(vlist)
      File "/usr/lib/python3/dist-packages/trytond/model/", line 159, in wrapper
        return func(cls, *args, **kwargs)
      File "/usr/lib/python3/dist-packages/trytond/model/", line 679, in create
      File "/usr/lib/python3/dist-packages/trytond/model/", line 79, in wrapper
        return func(*args, **kwargs)
      File "/usr/lib/python3/dist-packages/trytond/model/", line 1347, in _validate
        raise SelectionValidationError(gettext(
    trytond.model.modelstorage.SelectionValidationError: The value "district with special status" for field "Type" in "Subdivision" is not one of the allowed options. - 

Date User Action Args
2022-01-11 16:48:48cedsetstatus: chatting -> closed
superseder: + The value "district with special status" for field "Type" in "Subdivision" is not one of the allowed options
2022-01-10 20:27:58yangoonsetmessages: + msg73187
2021-12-22 09:13:22cedsetnosy: - ced
2021-12-22 09:13:15cedsetmessages: + msg72881
nosy: ced, yangoon
priority: feature -> wish
status: chatting
2021-12-22 08:38:33yangoonsetmessages: + msg72880
status: invalid -> (no value)
2021-12-21 23:00:41cedsetmessages: + msg72858
nosy: + ced
status: unread -> invalid
2021-12-21 21:56:52yangooncreate

Showing 10 items. Show all history (warning: this could be VERY long)