While installing additional packages in Ubuntu using
apt-get command, following error was thrown,
Setting up python2.7 (2.7.6-8ubuntu0.2) ... Sorry: TypeError: compile() expected string without null bytesdpkg: error processing package python2.7 (--configure) Dependency issue - python2.7 - Ubuntu 14.04 Errors were encountered while processing: python-minimal python libapache2-mod-wsgi lsb-release python-pkg-resources python-setuptools python-pip
Configuration files are messed up. You need to purge them. Please note the below point about purge.
purge purge is identical to remove except that packages are removed and purged (any configuration files are deleted too).
Purge python packages
apt-get purge python*
Also documented on Github