[Bug 1977954] Proposed package upload rejected
Steve Langasek
1977954 at bugs.launchpad.net
Fri Sep 2 23:05:45 UTC 2022
An upload of apport to jammy-proposed has been rejected from the upload
queue for the following reason: "contains bugfixes without bug
references or test cases, does not meet SRU policy".
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to apport in Ubuntu.
https://bugs.launchpad.net/bugs/1977954
Title:
apport_python_hook: Crashes if os.getcwd() throws FileNotFoundError
Status in Apport:
Fix Released
Status in apport package in Ubuntu:
Fix Released
Status in apport source package in Jammy:
New
Bug description:
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
---------
1. Create /tmp/getcwd.py with following content:
```
#!/usr/bin/python3
import os
import tempfile
tempdir = tempfile.mkdtemp()
os.chdir(tempdir)
os.rmdir(tempdir)
os.getcwd()
```
2. Make it executable and execute it.
It should produce following output:
```
Traceback (most recent call last):
File "/tmp/getcwd.py", line 9, in <module>
os.getcwd()
FileNotFoundError: [Errno 2] No such file or directory
```
instead of:
```
$ /tmp/getcwd.py
Traceback (most recent call last):
File "/tmp/getcwd.py", line 9, in <module>
os.getcwd()
FileNotFoundError: [Errno 2] No such file or directory
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 76, in apport_excepthook
binary = os.path.realpath(os.path.join(os.getcwd(), sys.argv[0]))
FileNotFoundError: [Errno 2] No such file or directory
Original exception was:
Traceback (most recent call last):
File "/tmp/getcwd.py", line 9, in <module>
os.getcwd()
FileNotFoundError: [Errno 2] No such file or directory
```
Another related issue: bug #1979637
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.
To manage notifications about this bug go to:
https://bugs.launchpad.net/apport/+bug/1977954/+subscriptions
More information about the foundations-bugs
mailing list