diff -Nru pytables-3.5.2/debian/changelog pytables-3.5.2/debian/changelog
--- pytables-3.5.2/debian/changelog	2019-08-16 19:53:28.000000000 +0200
+++ pytables-3.5.2/debian/changelog	2019-10-22 13:04:06.000000000 +0200
@@ -1,3 +1,25 @@
+pytables (3.5.2-3ubuntu2) UNRELEASED; urgency=medium
+
+  [ Michael Hudson-Doyle ]
+  * Fix build with Python 3.8 in a way that does not break Python 2.7. 
+
+  [ Matthias Klose ]
+  * Fix installation of Python 3.8 extensions.
+
+ -- Matthias Klose <doko@ubuntu.com>  Tue, 22 Oct 2019 13:04:06 +0200
+
+pytables (3.5.2-3ubuntu1) focal; urgency=medium
+
+  * Fix build with Python3.8.
+
+ -- Matthias Klose <doko@ubuntu.com>  Mon, 21 Oct 2019 11:25:19 +0200
+
+pytables (3.5.2-3build1) focal; urgency=medium
+
+  * No-change rebuild to build with python3.8.
+
+ -- Matthias Klose <doko@ubuntu.com>  Fri, 18 Oct 2019 18:33:41 +0000
+
 pytables (3.5.2-3) unstable; urgency=medium
 
   * debian/rules:
diff -Nru pytables-3.5.2/debian/control pytables-3.5.2/debian/control
--- pytables-3.5.2/debian/control	2019-08-16 19:53:28.000000000 +0200
+++ pytables-3.5.2/debian/control	2019-10-22 13:04:06.000000000 +0200
@@ -1,5 +1,6 @@
 Source: pytables
-Maintainer: Debian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+XSBC-Original-Maintainer: Debian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
 Uploaders: Antonio Valentino <antonio.valentino@tiscali.it>,
            Yaroslav Halchenko <debian@onerussian.com>
 Section: python
diff -Nru pytables-3.5.2/debian/patches/python3.8-fix.diff pytables-3.5.2/debian/patches/python3.8-fix.diff
--- pytables-3.5.2/debian/patches/python3.8-fix.diff	1970-01-01 01:00:00.000000000 +0100
+++ pytables-3.5.2/debian/patches/python3.8-fix.diff	2019-10-22 13:04:06.000000000 +0200
@@ -0,0 +1,51 @@
+--- a/tables/index.py
++++ b/tables/index.py
+@@ -23,7 +23,11 @@
+ import tempfile
+ import warnings
+ 
+-from time import time, clock
++from time import time
++try:
++    from time import perf_counter
++except ImportError:
++    from time import clock
+ 
+ import numpy
+ 
+@@ -847,7 +851,7 @@
+ 
+         if self.verbose:
+             t1 = time()
+-            c1 = clock()
++            c1 = perf_counter()
+         ss = self.slicesize
+         tmp = self.tmp
+         ranges = tmp.ranges[:]
+@@ -953,7 +957,7 @@
+         self.compute_overlaps(self.tmp, "do_complete_sort()", self.verbose)
+         if self.verbose:
+             t = round(time() - t1, 4)
+-            c = round(clock() - c1, 4)
++            c = round(perf_counter() - c1, 4)
+             print("time: %s. clock: %s" % (t, c))
+ 
+     def swap(self, what, mode=None):
+@@ -968,7 +972,7 @@
+ 
+         if self.verbose:
+             t1 = time()
+-            c1 = clock()
++            c1 = perf_counter()
+         if what == "chunks":
+             self.swap_chunks(mode)
+         elif what == "slices":
+@@ -982,7 +986,7 @@
+         rmult = len(mult.nonzero()[0]) / float(len(mult))
+         if self.verbose:
+             t = round(time() - t1, 4)
+-            c = round(clock() - c1, 4)
++            c = round(perf_counter() - c1, 4)
+             print("time: %s. clock: %s" % (t, c))
+         # Check that entropy is actually decreasing
+         if what == "chunks" and self.last_tover > 0. and self.last_nover > 0:
diff -Nru pytables-3.5.2/debian/patches/series pytables-3.5.2/debian/patches/series
--- pytables-3.5.2/debian/patches/series	2019-08-16 19:53:28.000000000 +0200
+++ pytables-3.5.2/debian/patches/series	2019-10-21 11:24:20.000000000 +0200
@@ -4,3 +4,4 @@
 0004-remove-gtags.patch
 0005-Drop-mock-for-requirements.txt.patch
 0006-Skip-index-backcompat-tests-on-bingendian.patch
+python3.8-fix.diff
diff -Nru pytables-3.5.2/debian/python3-tables-dbg.install pytables-3.5.2/debian/python3-tables-dbg.install
--- pytables-3.5.2/debian/python3-tables-dbg.install	2019-08-16 19:53:28.000000000 +0200
+++ pytables-3.5.2/debian/python3-tables-dbg.install	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-usr/lib/python3*/*-packages/tables/*.cpython-3?dm*.so
diff -Nru pytables-3.5.2/debian/python3-tables.install pytables-3.5.2/debian/python3-tables.install
--- pytables-3.5.2/debian/python3-tables.install	2019-08-16 19:53:28.000000000 +0200
+++ pytables-3.5.2/debian/python3-tables.install	1970-01-01 01:00:00.000000000 +0100
@@ -1,8 +0,0 @@
-usr/lib/python3*/dist-packages/tables/*.py
-usr/lib/python3*/dist-packages/tables/misc/*.py
-usr/lib/python3*/dist-packages/tables/nodes/*.py
-usr/lib/python3*/dist-packages/tables/nodes/tests/*.py
-usr/lib/python3*/dist-packages/tables/scripts/*.py
-usr/lib/python3*/dist-packages/tables/tests/*.py
-usr/lib/python3*/dist-packages/tables*.egg-info
-usr/bin/*
diff -Nru pytables-3.5.2/debian/python3-tables-lib.install pytables-3.5.2/debian/python3-tables-lib.install
--- pytables-3.5.2/debian/python3-tables-lib.install	2019-08-16 19:53:28.000000000 +0200
+++ pytables-3.5.2/debian/python3-tables-lib.install	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-usr/lib/python3*/*-packages/tables/*.cpython-3?m*.so
diff -Nru pytables-3.5.2/debian/python-tables-data.install pytables-3.5.2/debian/python-tables-data.install
--- pytables-3.5.2/debian/python-tables-data.install	2019-08-16 19:53:28.000000000 +0200
+++ pytables-3.5.2/debian/python-tables-data.install	2019-10-22 13:04:06.000000000 +0200
@@ -1,5 +1,5 @@
-usr/lib/python3*/dist-packages/tables/tests/*.h5 usr/share/python-tables/tests
-usr/lib/python3*/dist-packages/tables/tests/*.mat usr/share/python-tables/tests
-usr/lib/python3*/dist-packages/tables/nodes/tests/*.h5 usr/share/python-tables/nodes/tests
-usr/lib/python3*/dist-packages/tables/nodes/tests/*.xbm usr/share/python-tables/nodes/tests
-usr/lib/python3*/dist-packages/tables/nodes/tests/*.dat usr/share/python-tables/nodes/tests
+debian/python3-tables/usr/lib/python3*/dist-packages/tables/tests/*.h5 usr/share/python-tables/tests
+debian/python3-tables/usr/lib/python3*/dist-packages/tables/tests/*.mat usr/share/python-tables/tests
+debian/python3-tables/usr/lib/python3*/dist-packages/tables/nodes/tests/*.h5 usr/share/python-tables/nodes/tests
+debian/python3-tables/usr/lib/python3*/dist-packages/tables/nodes/tests/*.xbm usr/share/python-tables/nodes/tests
+debian/python3-tables/usr/lib/python3*/dist-packages/tables/nodes/tests/*.dat usr/share/python-tables/nodes/tests
diff -Nru pytables-3.5.2/debian/python-tables-dbg.install pytables-3.5.2/debian/python-tables-dbg.install
--- pytables-3.5.2/debian/python-tables-dbg.install	2019-08-16 19:53:28.000000000 +0200
+++ pytables-3.5.2/debian/python-tables-dbg.install	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-usr/lib/python2*/dist-packages/tables/*_d.so
diff -Nru pytables-3.5.2/debian/python-tables.install pytables-3.5.2/debian/python-tables.install
--- pytables-3.5.2/debian/python-tables.install	2019-08-16 19:53:28.000000000 +0200
+++ pytables-3.5.2/debian/python-tables.install	1970-01-01 01:00:00.000000000 +0100
@@ -1,7 +0,0 @@
-usr/lib/python2*/dist-packages/tables/*.py
-usr/lib/python2*/dist-packages/tables/misc/*.py
-usr/lib/python2*/dist-packages/tables/nodes/*.py
-usr/lib/python2*/dist-packages/tables/nodes/tests/*.py
-usr/lib/python2*/dist-packages/tables/scripts/*.py
-usr/lib/python2*/dist-packages/tables/tests/*.py
-usr/lib/python2*/dist-packages/tables*.egg-info
diff -Nru pytables-3.5.2/debian/python-tables-lib.install pytables-3.5.2/debian/python-tables-lib.install
--- pytables-3.5.2/debian/python-tables-lib.install	2019-08-16 19:53:28.000000000 +0200
+++ pytables-3.5.2/debian/python-tables-lib.install	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-usr/lib/python2*/dist-packages/tables/*[!_]?.so
diff -Nru pytables-3.5.2/debian/rules pytables-3.5.2/debian/rules
--- pytables-3.5.2/debian/rules	2019-08-16 19:53:28.000000000 +0200
+++ pytables-3.5.2/debian/rules	2019-10-22 13:04:06.000000000 +0200
@@ -19,6 +19,12 @@
 export PYBUILD_INSTALL_ARGS_python3-dbg=--install-scripts=/usr/bin-dbg/
 export DISABLE_AVX2=1
 
+# pybuild magic
+export PYBUILD_NAME=tables
+export PYBUILD_EXT_DESTDIR_python2=debian/python-tables-lib
+export PYBUILD_EXT_DESTDIR_python2-dbg=debian/python-tables-dbg
+export PYBUILD_EXT_DESTDIR_python3=debian/python3-tables-lib
+export PYBUILD_EXT_DESTDIR_python3-dbg=debian/python3-tables-dbg
 
 %:
 	dh $@ --with python2,python3,sphinxdoc --buildsystem=pybuild
