Here's a reproduction of the error:

bcurtiss@bcurtiss-laptop:~$ ipython
Python 2.7.12 (default, Oct  8 2019, 14:14:10) 
Type "copyright", "credits" or "license" for more information.

IPython 2.4.1 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import apport_python_hook; 
apport_python_hook.apport_excepthook(Exception, Exception(), None)
Exception
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-1-e8f288b62cb1> in <module>()
----> 1 import apport_python_hook; 
apport_python_hook.apport_excepthook(Exception, Exception(), None)

/usr/lib/python2.7/dist-packages/apport_python_hook.pyc in 
apport_excepthook(exc_type, exc_obj, exc_tb)
    107         traceback.print_exception(exc_type, exc_obj, exc_tb, 
file=tb_file)
    108         pr['Traceback'] = tb_file.getvalue().strip()
--> 109         pr.add_proc_info(extraenv=['PYTHONPATH', 'PYTHONHOME'])
    110         pr.add_user_info()
    111         # override the ExecutablePath with the script that was actually 
running

/usr/lib/python2.7/dist-packages/apport/report.pyc in add_proc_info(self, pid, 
proc_pid_fd, extraenv)
    517                 self.pid = int(pid)
    518             pid = str(pid)
--> 519             proc_pid_fd = os.open('/proc/%s' % pid, os.O_RDONLY | 
os.O_PATH | os.O_DIRECTORY)
    520 
    521         try:

AttributeError: 'module' object has no attribute 'O_PATH'

In [2]: exit
bcurtiss@bcurtiss-laptop:~$ ipython3
Python 3.5.2 (default, Oct  8 2019, 13:06:37) 
Type "copyright", "credits" or "license" for more information.

IPython 2.4.1 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import apport_python_hook; 
apport_python_hook.apport_excepthook(Exception, Exception(), None)
Exception

In [2]: exit
bcurtiss@bcurtiss-laptop:~$

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to apport in Ubuntu.
https://bugs.launchpad.net/bugs/1851806

Title:
  'module' object has no attribute 'O_PATH'

Status in apport package in Ubuntu:
  Incomplete

Bug description:
  I encountered the following exception in python-apport while
  encountering an exception `bup` which uses `python-apport`. I'm sure
  that the exception lies in the responsibility of `python-apport` (the
  `AttributeError` stacktrace is relevant):

  ```
  Traceback (most recent call last):
    File "/usr/lib/bup/cmd/bup-index", line 269, in <module>
      update_index(rp, excluded_paths, exclude_rxs, xdev_exceptions=xexcept)
    File "/usr/lib/bup/cmd/bup-index", line 191, in update_index
      mi.close()
    File "/usr/lib/bup/bup/index.py", line 528, in close
      os.rename(self.tmpname, self.filename)
  OSError: [Errno 13] Permission denied
  Error in sys.excepthook:
  Traceback (most recent call last):
    File "/usr/lib/bup/bup/helpers.py", line 916, in newhook
      return oldhook(exctype, value, traceback)
    File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 109, in 
apport_excepthook
      pr.add_proc_info(extraenv=['PYTHONPATH', 'PYTHONHOME'])
    File "/usr/lib/python2.7/dist-packages/apport/report.py", line 544, in 
add_proc_info
      proc_pid_fd = os.open('/proc/%s' % pid, os.O_RDONLY | os.O_PATH | 
os.O_DIRECTORY)
  AttributeError: 'module' object has no attribute 'O_PATH'

  Original exception was:
  Traceback (most recent call last):
    File "/usr/lib/bup/cmd/bup-index", line 269, in <module>
      update_index(rp, excluded_paths, exclude_rxs, xdev_exceptions=xexcept)
    File "/usr/lib/bup/cmd/bup-index", line 191, in update_index
      mi.close()
    File "/usr/lib/bup/bup/index.py", line 528, in close
      os.rename(self.tmpname, self.filename)
  OSError: [Errno 13] Permission denied
  ```

  ProblemType: Bug
  DistroRelease: Ubuntu 19.10
  Package: python-apport 2.20.11-0ubuntu8.2
  ProcVersionSignature: Ubuntu 5.3.0-19.20-generic 5.3.1
  Uname: Linux 5.3.0-19-generic x86_64
  NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
  ApportLog: Error: [Errno 13] Keine Berechtigung: '/var/log/apport.log'
  ApportVersion: 2.20.11-0ubuntu8.2
  Architecture: amd64
  CurrentDesktop: ubuntu:GNOME
  Date: Fri Nov  8 10:43:02 2019
  PackageArchitecture: all
  SourcePackage: apport
  UpgradeStatus: Upgraded to eoan on 2019-10-25 (13 days ago)

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

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to