Web lists-archives.com

Re: how to report bugs? (reportbug broken)




On Wed, 22 May 2019 19:04:52 +0200
Nico Schlömer <nico.schloemer@xxxxxxxxx> wrote:

> Thanks Michael for the quick response!
> ```
> python3 -c "import sys; print(sys.path)"
> ```
> gives
> ```
> ['', '/usr/lib/python37.zip', '/usr/lib/python3.7',
> '/usr/lib/python3.7/lib-dynload',
> '/home/nschloe/.local/lib/python3.7/site-packages',
> '/usr/local/lib/python3.7/dist-packages',
> '/usr/lib/python3/dist-packages']
> ```
> Looks normal?

Actually not, '/usr/lib/python3/dist-packages' should appear
before '/home/nschloe/.local/lib/python3.7/site-packages' (resp. your
custom Python should be at the very end of sys.path). Obviously this is
the reason why reportbug tries to import some module from your custom
Python3 install which refuses to work. You should definitely fix this,
otherwise the next bad surprise will be waiting just around the corner ;)

I am not sure how to do this properly, though. Maybe the Python-path is
somehow created from $PATH, is your ~/.local somewhere in $PATH and could
you possibly move it to the end?

According to
https://stackoverflow.com/questions/18247333/python-pythonpath-in-linux
you could also try to set the PYTHONPATH environment variable with
something like
export
PYTHONPATH="":/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3/dist-packages:
(etc.)

however I am not sure if this is actually wise (Python2 should also be
taken into account of course).

As a quick-and-dirty workaround you could try to add something like

import sys 
sys.path = ['', '/usr/lib/python37.zip', '/usr/lib/python3.7',
'/usr/lib/python3.7/lib-dynload',
'/usr/local/lib/python3.7/dist-packages',
'/usr/lib/python3/dist-packages']

to the very beginning of /usr/bin/reportbug .
This wouldn't help with other misbehaving Python3 programs of course.

Regards

Michael

.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

Our way is peace.
		-- Septimus, the Son Worshiper, "Bread and Circuses",
		   stardate 4040.7.