I'm in the process of updating pycountry to the latest 17.5.14 release in Ubuntu. I'll attach the diff to the debian directory I used.
diff -Nru pycountry-1.8+ds1/debian/changelog pycountry-17.5.14+ds1/debian/changelog --- pycountry-1.8+ds1/debian/changelog 2017-01-29 12:27:30.000000000 +1300 +++ pycountry-17.5.14+ds1/debian/changelog 2017-06-30 13:23:25.000000000 +1200 @@ -1,3 +1,16 @@ +pycountry (17.5.14+ds1-0ubuntu1) artful; urgency=medium + + * New upstream version. + * d/control: add build-depends on dh-python, remove build-depends on unzip. + * d/watch: upstream distributes tarballs now. + * d/rules: update get-orig-source to extract tarball not zip. + * d/patches/00-use_system_iso-codes.patch: update to use json from iso-codes, + not XML. + * d/patches/01-prevent_logger_warning.patch, + d/patches/02-disable-failing-asserts.patch: regenerate. + + -- Michael Hudson-Doyle <michael.hud...@ubuntu.com> Fri, 30 Jun 2017 12:57:57 +1200 + pycountry (1.8+ds1-0.2) unstable; urgency=medium * Non-maintainer upload. diff -Nru pycountry-1.8+ds1/debian/control pycountry-17.5.14+ds1/debian/control --- pycountry-1.8+ds1/debian/control 2014-08-26 03:02:08.000000000 +1200 +++ pycountry-17.5.14+ds1/debian/control 2017-06-30 13:14:21.000000000 +1200 @@ -1,10 +1,11 @@ Source: pycountry Section: python Priority: extra -Maintainer: David Paleino <da...@debian.org> +Maintainer: Ubuntu Developers <ubuntu-devel-disc...@lists.ubuntu.com> +XSBC-Original-Maintainer: David Paleino <da...@debian.org> Build-Depends: debhelper (>= 7.0.50~) - , unzip + , dh-python , python (>= 2.6.6-3~) , python3 (>= 3.4.1-1~) , python-setuptools diff -Nru pycountry-1.8+ds1/debian/patches/00-use_system_iso-codes.patch pycountry-17.5.14+ds1/debian/patches/00-use_system_iso-codes.patch --- pycountry-1.8+ds1/debian/patches/00-use_system_iso-codes.patch 2014-07-10 20:43:13.000000000 +1200 +++ pycountry-17.5.14+ds1/debian/patches/00-use_system_iso-codes.patch 2017-06-30 13:05:52.000000000 +1200 @@ -9,37 +9,37 @@ --- a/src/pycountry/__init__.py +++ b/src/pycountry/__init__.py -@@ -15,8 +15,8 @@ +@@ -12,8 +12,8 @@ return os.path.join(os.path.dirname(__file__), resource_name) -LOCALES_DIR = resource_filename('pycountry', 'locales') -DATABASE_DIR = resource_filename('pycountry', 'databases') +LOCALES_DIR = '/usr/share/locale' -+DATABASE_DIR = '/usr/share/xml/iso-codes' ++DATABASE_DIR = '/usr/share/iso-codes/json' - class CountriesBase(pycountry.db.Database): -@@ -141,10 +141,10 @@ - divs.add(subdivision) + class ExistingCountries(pycountry.db.Database): +@@ -112,10 +112,10 @@ + return [] --countries = ExistingCountries(os.path.join(DATABASE_DIR, 'iso3166.xml')) -+countries = ExistingCountries(os.path.join(DATABASE_DIR, 'iso_3166.xml')) +-countries = ExistingCountries(os.path.join(DATABASE_DIR, 'iso3166-1.json')) ++countries = ExistingCountries(os.path.join(DATABASE_DIR, 'iso_3166-1.json')) historic_countries = HistoricCountries( -- os.path.join(DATABASE_DIR, 'iso3166.xml')) --scripts = Scripts(os.path.join(DATABASE_DIR, 'iso15924.xml')) --currencies = Currencies(os.path.join(DATABASE_DIR, 'iso4217.xml')) --languages = Languages(os.path.join(DATABASE_DIR, 'iso639.xml')) --subdivisions = Subdivisions(os.path.join(DATABASE_DIR, 'iso3166_2.xml')) -+ os.path.join(DATABASE_DIR, 'iso_3166.xml')) -+scripts = Scripts(os.path.join(DATABASE_DIR, 'iso_15924.xml')) -+currencies = Currencies(os.path.join(DATABASE_DIR, 'iso_4217.xml')) -+languages = Languages(os.path.join(DATABASE_DIR, 'iso_639.xml')) -+subdivisions = Subdivisions(os.path.join(DATABASE_DIR, 'iso_3166_2.xml')) +- os.path.join(DATABASE_DIR, 'iso3166-3.json')) +-scripts = Scripts(os.path.join(DATABASE_DIR, 'iso15924.json')) +-currencies = Currencies(os.path.join(DATABASE_DIR, 'iso4217.json')) +-languages = Languages(os.path.join(DATABASE_DIR, 'iso639-3.json')) +-subdivisions = Subdivisions(os.path.join(DATABASE_DIR, 'iso3166-2.json')) ++ os.path.join(DATABASE_DIR, 'iso_3166-3.json')) ++scripts = Scripts(os.path.join(DATABASE_DIR, 'iso_15924.json')) ++currencies = Currencies(os.path.join(DATABASE_DIR, 'iso_4217.json')) ++languages = Languages(os.path.join(DATABASE_DIR, 'iso_639-3.json')) ++subdivisions = Subdivisions(os.path.join(DATABASE_DIR, 'iso_3166-2.json')) --- a/src/pycountry/tests/test_general.py +++ b/src/pycountry/tests/test_general.py -@@ -87,7 +87,7 @@ +@@ -89,7 +89,7 @@ def test_locales(): german = gettext.translation( diff -Nru pycountry-1.8+ds1/debian/patches/01-prevent_logger_warning.patch pycountry-17.5.14+ds1/debian/patches/01-prevent_logger_warning.patch --- pycountry-1.8+ds1/debian/patches/01-prevent_logger_warning.patch 2014-07-10 03:34:17.000000000 +1200 +++ pycountry-17.5.14+ds1/debian/patches/01-prevent_logger_warning.patch 2017-06-30 13:17:54.000000000 +1200 @@ -9,22 +9,21 @@ --- a/src/pycountry/db.py +++ b/src/pycountry/db.py -@@ -7,8 +7,17 @@ +@@ -4,7 +4,17 @@ import logging - from xml.dom import minidom + import json --logger = logging.getLogger('pycountry.db') +# NullHandler is only defined for python >= 2.7 +if 'NullHandler' not in dir(logging): + class NullHandler(logging.Handler): + def emit(self, record): + pass + logging.NullHandler = NullHandler - -+logger = logging.getLogger('pycountry.db') ++ + logger = logging.getLogger('pycountry.db') +# Prevent warning, see +# http://docs.python.org/library/logging.html#configuring-logging-for-a-library +logger.addHandler(logging.NullHandler()) - class Data(object): - + try: + unicode diff -Nru pycountry-1.8+ds1/debian/patches/02-disable-failing-asserts.patch pycountry-17.5.14+ds1/debian/patches/02-disable-failing-asserts.patch --- pycountry-1.8+ds1/debian/patches/02-disable-failing-asserts.patch 2017-01-29 12:27:30.000000000 +1300 +++ pycountry-17.5.14+ds1/debian/patches/02-disable-failing-asserts.patch 2017-06-30 13:08:39.000000000 +1200 @@ -14,39 +14,39 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- a/src/pycountry/tests/test_general.py +++ b/src/pycountry/tests/test_general.py -@@ -25,7 +25,7 @@ +@@ -26,7 +26,7 @@ def test_subdivisions_directly_accessible(): -- assert len(pycountry.subdivisions) == 4847 -+ #assert len(pycountry.subdivisions) == 4847 +- assert len(pycountry.subdivisions) == 4835 ++ #assert len(pycountry.subdivisions) == 4835 assert isinstance(list(pycountry.subdivisions)[0], pycountry.db.Data) de_st = pycountry.subdivisions.get(code='DE-ST') -@@ -51,7 +51,7 @@ +@@ -54,7 +54,7 @@ def test_scripts(): -- assert len(pycountry.scripts) == 169 -+ #assert len(pycountry.scripts) == 169 +- assert len(pycountry.scripts) == 182 ++ #assert len(pycountry.scripts) == 182 assert isinstance(list(pycountry.scripts)[0], pycountry.db.Data) latin = pycountry.scripts.get(name='Latin') -@@ -61,7 +61,7 @@ +@@ -64,7 +64,7 @@ def test_currencies(): -- assert len(pycountry.currencies) == 182 -+ #assert len(pycountry.currencies) == 182 +- assert len(pycountry.currencies) == 170 ++ #assert len(pycountry.currencies) == 170 assert isinstance(list(pycountry.currencies)[0], pycountry.db.Data) - argentine_peso = pycountry.currencies.get(letter='ARS') -@@ -71,7 +71,7 @@ + argentine_peso = pycountry.currencies.get(alpha_3='ARS') +@@ -74,7 +74,7 @@ def test_languages(): -- assert len(pycountry.languages) == 487 -+ #assert len(pycountry.languages) == 487 +- assert len(pycountry.languages) == 7847 ++ #assert len(pycountry.languages) == 7847 assert isinstance(list(pycountry.languages)[0], pycountry.db.Data) - aragonese = pycountry.languages.get(alpha2='an') + aragonese = pycountry.languages.get(alpha_2='an') diff -Nru pycountry-1.8+ds1/debian/rules pycountry-17.5.14+ds1/debian/rules --- pycountry-1.8+ds1/debian/rules 2014-08-27 22:35:41.000000000 +1200 +++ pycountry-17.5.14+ds1/debian/rules 2017-06-30 13:03:38.000000000 +1200 @@ -29,7 +29,7 @@ --download-version $(UPVER) \ --force-download \ --destdir . - unzip pycountry-$(UPVER).zip + tar xfz pycountry-$(UPVER).tar.gz rm -vrf pycountry-$(UPVER)/src/pycountry/databases rm -vrf pycountry-$(UPVER)/src/pycountry/locales tar cf pycountry_$(DEBVER).orig.tar pycountry-$(UPVER) diff -Nru pycountry-1.8+ds1/debian/watch pycountry-17.5.14+ds1/debian/watch --- pycountry-1.8+ds1/debian/watch 2014-08-26 02:57:07.000000000 +1200 +++ pycountry-17.5.14+ds1/debian/watch 2017-06-30 13:03:38.000000000 +1200 @@ -1,3 +1,3 @@ version=3 opts=dversionmangle=s/\+ds.*// \ -https://pypi.python.org/packages/source/p/pycountry/pycountry-(\d+.*)\.zip +https://pypi.python.org/packages/source/p/pycountry/pycountry-(\d+.*)\.tar.gz