Hmm, it seems now the update system is also affected by the $PYTHONPATH 
environment variable setting -
with PYTHONPATH=/usr/lib/python2.7:/usr/local/lib/python2.7 :

$ apt-get dist-upgrade
fails with :

Fetched 41.2 MB in 15s (2,623 kB/s)                                            
(Reading database ... 552135 files and directories currently installed.)
Preparing to unpack .../python3-problem-report_2.14.1-0ubuntu3.6_all.deb ...
Fatal Python error: Py_Initialize: Unable to get the locale encoding
  File "/usr/lib/python2.7/encodings/__init__.py", line 123
    raise CodecRegistryError,\
                            ^
SyntaxError: invalid syntax
Aborted
dpkg: warning: subprocess old pre-removal script returned error exit status 134
dpkg: trying script from the new package instead ...
Fatal Python error: Py_Initialize: Unable to get the locale encoding
  File "/usr/lib/python2.7/encodings/__init__.py", line 123
    raise CodecRegistryError,\
                            ^
SyntaxError: invalid syntax
Aborted
dpkg: error processing archive 
/var/cache/apt/archives/python3-problem-report_2.14.1-0ubuntu3.6_all.deb 
(--unpack):
 subprocess new pre-removal script returned error exit status 134
Fatal Python error: Py_Initialize: Unable to get the locale encoding
  File "/usr/lib/python2.7/encodings/__init__.py", line 123
    raise CodecRegistryError,\
                            ^
SyntaxError: invalid syntax
Aborted
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 134
Preparing to unpack .../python3-apport_2.14.1-0ubuntu3.6_all.deb ...
Fatal Python error: Py_Initialize: Unable to get the locale encoding
  File "/usr/lib/python2.7/encodings/__init__.py", line 123
    raise CodecRegistryError,\
                            ^
SyntaxError: invalid syntax
Aborted
dpkg: warning: subprocess old pre-removal script returned error exit status 134
dpkg: trying script from the new package instead ...
Fatal Python error: Py_Initialize: Unable to get the locale encoding
  File "/usr/lib/python2.7/encodings/__init__.py", line 123
    raise CodecRegistryError,\
                            ^
SyntaxError: invalid syntax
Aborted
dpkg: error processing archive 
/var/cache/apt/archives/python3-apport_2.14.1-0ubuntu3.6_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 134
Fatal Python error: Py_Initialize: Unable to get the locale encoding
  File "/usr/lib/python2.7/encodings/__init__.py", line 123
    raise CodecRegistryError,\
                            ^
SyntaxError: invalid syntax
Aborted
dpkg: error while cleaning up:

I really think that tools such as gdb and dpkg should take care of managing 
critical environment variable settings 
like $PYTHONPATH if they intend to use python .
It is only because I knew of  this bug in advance that I did not spend ages 
determining the cause of the problem was $PYTHONPATH .
To solve this issue in the past, I did write a /usr/bin/python wrapper that , 
dependant on environment variable settings, would run 
either the i686 or x86_64 python binary of the required $PYTHON_VERSION .   I 
could attach this "C" program to this bug report if you want...

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1398033

Title:
  python breaks gdb

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apport/+bug/1398033/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to