Oops sorry. I am on Ubuntu 16.04, which might be part of the problem.
Its corresponding python version is 3.5 which is not really supported by
more recent hg version. So I followed the advice of Marcin Kasperski to
compile it with python 2.7 by
Replacing
export PYTHON=python3
By
export PYTHON=python
That might have caused the dulwich problem. On the other hand I use
still some extension that have not been exported to python3 and that is
why I want in principle to stick with hg-5.2 till I am forced to
upgrade.
So in other words, ignore my message for the moment.
regards