Activity log for bug #1979637

Date Who What changed Old value New value Message
2022-06-23 10:39:04 Benjamin Drung bug added bug
2022-06-23 10:39:08 Benjamin Drung apport: status New Triaged
2022-06-23 10:39:10 Benjamin Drung apport: milestone 2.22.0
2022-06-23 10:39:51 Benjamin Drung apport: importance Undecided Low
2022-06-23 10:44:11 Benjamin Drung bug task added apport (Ubuntu)
2022-06-23 13:20:43 Benjamin Drung apport: status Triaged Fix Committed
2022-06-27 10:13:17 Benjamin Drung apport: status Fix Committed Fix Released
2022-06-27 14:31:06 Launchpad Janitor apport (Ubuntu): status New Fix Released
2022-06-27 16:18:06 Benjamin Drung nominated for series Ubuntu Jammy
2022-06-27 16:18:06 Benjamin Drung bug task added apport (Ubuntu Jammy)
2022-06-27 16:45:03 Benjamin Drung description Run following shell script: ```sh echo "raise ValueError()" > /tmp/failure.py mkdir /tmp/foo cd /tmp/foo/ rmdir /tmp/foo/ python3 ../failure.py ``` Python should only show a ValueError, but apport_python_hook.py crashes: ``` Traceback (most recent call last): File "../failure.py", line 1, in <module> raise ValueError() ValueError Error in sys.excepthook: Traceback (most recent call last): File "<frozen importlib._bootstrap_external>", line 1372, in _path_importer_cache KeyError: '..' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 55, in apport_excepthook import apt_pkg File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1002, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 945, in _find_spec File "<frozen importlib._bootstrap_external>", line 1439, in find_spec File "<frozen importlib._bootstrap_external>", line 1408, in _get_spec File "<frozen importlib._bootstrap_external>", line 1374, in _path_importer_cache File "<frozen importlib._bootstrap_external>", line 1350, in _path_hooks File "<frozen importlib._bootstrap_external>", line 1632, in path_hook_for_FileFinder File "<frozen importlib._bootstrap_external>", line 1505, in __init__ FileNotFoundError: [Errno 2] No such file or directory Original exception was: Traceback (most recent call last): File "../failure.py", line 1, in <module> raise ValueError() ValueError ``` Test Case --------- Run following shell script: ```sh echo "raise ValueError()" > /tmp/failure.py mkdir /tmp/foo cd /tmp/foo/ rmdir /tmp/foo/ python3 ../failure.py ``` It should only print following stacktrace: ``` Traceback (most recent call last): File "../failure.py", line 1, in <module> raise ValueError() ValueError ``` Regression Potential -------------------- There might be a regression that causes capturing Python exception fail. Then reporting them as bugs to Launchpad or the error tracker would not be possible. Original Description -------------------- The script should only show a ValueError, but apport_python_hook.py crashes: ``` Traceback (most recent call last):   File "../failure.py", line 1, in <module>     raise ValueError() ValueError Error in sys.excepthook: Traceback (most recent call last):   File "<frozen importlib._bootstrap_external>", line 1372, in _path_importer_cache KeyError: '..' During handling of the above exception, another exception occurred: Traceback (most recent call last):   File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 55, in apport_excepthook     import apt_pkg   File "<frozen importlib._bootstrap>", line 1027, in _find_and_load   File "<frozen importlib._bootstrap>", line 1002, in _find_and_load_unlocked   File "<frozen importlib._bootstrap>", line 945, in _find_spec   File "<frozen importlib._bootstrap_external>", line 1439, in find_spec   File "<frozen importlib._bootstrap_external>", line 1408, in _get_spec   File "<frozen importlib._bootstrap_external>", line 1374, in _path_importer_cache   File "<frozen importlib._bootstrap_external>", line 1350, in _path_hooks   File "<frozen importlib._bootstrap_external>", line 1632, in path_hook_for_FileFinder   File "<frozen importlib._bootstrap_external>", line 1505, in __init__ FileNotFoundError: [Errno 2] No such file or directory Original exception was: Traceback (most recent call last):   File "../failure.py", line 1, in <module>     raise ValueError() ValueError ```
2022-07-26 14:09:17 Launchpad Janitor apport (Ubuntu Jammy): status New Confirmed
2022-08-23 20:46:27 Benjamin Drung description Test Case --------- Run following shell script: ```sh echo "raise ValueError()" > /tmp/failure.py mkdir /tmp/foo cd /tmp/foo/ rmdir /tmp/foo/ python3 ../failure.py ``` It should only print following stacktrace: ``` Traceback (most recent call last): File "../failure.py", line 1, in <module> raise ValueError() ValueError ``` Regression Potential -------------------- There might be a regression that causes capturing Python exception fail. Then reporting them as bugs to Launchpad or the error tracker would not be possible. Original Description -------------------- The script should only show a ValueError, but apport_python_hook.py crashes: ``` Traceback (most recent call last):   File "../failure.py", line 1, in <module>     raise ValueError() ValueError Error in sys.excepthook: Traceback (most recent call last):   File "<frozen importlib._bootstrap_external>", line 1372, in _path_importer_cache KeyError: '..' During handling of the above exception, another exception occurred: Traceback (most recent call last):   File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 55, in apport_excepthook     import apt_pkg   File "<frozen importlib._bootstrap>", line 1027, in _find_and_load   File "<frozen importlib._bootstrap>", line 1002, in _find_and_load_unlocked   File "<frozen importlib._bootstrap>", line 945, in _find_spec   File "<frozen importlib._bootstrap_external>", line 1439, in find_spec   File "<frozen importlib._bootstrap_external>", line 1408, in _get_spec   File "<frozen importlib._bootstrap_external>", line 1374, in _path_importer_cache   File "<frozen importlib._bootstrap_external>", line 1350, in _path_hooks   File "<frozen importlib._bootstrap_external>", line 1632, in path_hook_for_FileFinder   File "<frozen importlib._bootstrap_external>", line 1505, in __init__ FileNotFoundError: [Errno 2] No such file or directory Original exception was: Traceback (most recent call last):   File "../failure.py", line 1, in <module>     raise ValueError() ValueError ``` Impact ------ The Apport Python hook should be transparent to the user (which is normally the case). Bugs and crashes inside the hook lead to an exception inside the exception which clutters the output and confuse the user. User/Developer need to understand this Python hook and look into the encapsulated stack trace only. Test Case --------- Run following shell script: ```sh echo "raise ValueError()" > /tmp/failure.py mkdir /tmp/foo cd /tmp/foo/ rmdir /tmp/foo/ python3 ../failure.py ``` It should only print following stacktrace: ``` Traceback (most recent call last):   File "../failure.py", line 1, in <module>     raise ValueError() ValueError ``` Regression Potential -------------------- There might be a regression that causes capturing Python exception fail. Then reporting them as bugs to Launchpad or the error tracker would not be possible. Original Description -------------------- The script should only show a ValueError, but apport_python_hook.py crashes: ``` Traceback (most recent call last):   File "../failure.py", line 1, in <module>     raise ValueError() ValueError Error in sys.excepthook: Traceback (most recent call last):   File "<frozen importlib._bootstrap_external>", line 1372, in _path_importer_cache KeyError: '..' During handling of the above exception, another exception occurred: Traceback (most recent call last):   File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 55, in apport_excepthook     import apt_pkg   File "<frozen importlib._bootstrap>", line 1027, in _find_and_load   File "<frozen importlib._bootstrap>", line 1002, in _find_and_load_unlocked   File "<frozen importlib._bootstrap>", line 945, in _find_spec   File "<frozen importlib._bootstrap_external>", line 1439, in find_spec   File "<frozen importlib._bootstrap_external>", line 1408, in _get_spec   File "<frozen importlib._bootstrap_external>", line 1374, in _path_importer_cache   File "<frozen importlib._bootstrap_external>", line 1350, in _path_hooks   File "<frozen importlib._bootstrap_external>", line 1632, in path_hook_for_FileFinder   File "<frozen importlib._bootstrap_external>", line 1505, in __init__ FileNotFoundError: [Errno 2] No such file or directory Original exception was: Traceback (most recent call last):   File "../failure.py", line 1, in <module>     raise ValueError() ValueError ```