2012-08-30 20:53:56 |
Scott Moser |
description |
running 'ubuntu-bug' on ec2 to report a bug results in:
ERROR: hook /usr/share/apport/general-hooks/ubuntu.py crashed:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport/report.py", line 749, in add_hooks_info
symb['add_info'](self, ui)
File "/usr/share/apport/general-hooks/ubuntu.py", line 34, in add_info
add_cloud_info(report)
File "/usr/share/apport/general-hooks/ubuntu.py", line 323, in add_cloud_info
if ami and ami.startswith('ami'):
TypeError: startswith first arg must be bytes or a tuple of bytes, not str
The fix to this as-yet-python-3-illiterate looks like:
--- /usr/share/apport/general-hooks/ubuntu.py.dist 2012-06-27 19:45:13.332342429 +0000
+++ /usr/share/apport/general-hooks/ubuntu.py 2012-06-27 19:45:26.340342116 +0000
@@ -316,7 +316,7 @@
ami_id_url = urljoin(metadata_url, 'ami-id')
try:
- ami = urlopen(ami_id_url, timeout=5).read()
+ ami = str(urlopen(ami_id_url, timeout=5)).read()
except:
ami = None
ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: apport 2.2.5-0ubuntu1
ProcVersionSignature: User Name 3.5.0-2.2-generic 3.5.0-rc4
Uname: Linux 3.5.0-2-generic x86_64
Architecture: amd64
Date: Wed Jun 27 19:32:56 2012
PackageArchitecture: all
ProcEnviron:
TERM=screen
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: apport
UpgradeStatus: No upgrade log present (probably fresh install) |
running 'ubuntu-bug' on ec2 to report a bug results in:
ERROR: hook /usr/share/apport/general-hooks/ubuntu.py crashed:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport/report.py", line 749, in add_hooks_info
symb['add_info'](self, ui)
File "/usr/share/apport/general-hooks/ubuntu.py", line 34, in add_info
add_cloud_info(report)
File "/usr/share/apport/general-hooks/ubuntu.py", line 323, in add_cloud_info
if ami and ami.startswith('ami'):
TypeError: startswith first arg must be bytes or a tuple of bytes, not str
The fix to this as-yet-python-3-illiterate looks like:
--- data/general-hooks/ubuntu.py 2012-08-28 09:11:22 +0000
+++ data/general-hooks/ubuntu.py 2012-08-30 20:53:30 +0000
@@ -337,7 +337,7 @@
except:
ami = None
- if ami and ami.startswith('ami'):
+ if ami and ami.startswith(b'ami'):
add_tag(report, 'ec2-images')
fields = {'Ec2AMIManifest': 'ami-manifest-path',
'Ec2Kernel': 'kernel-id',
ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: apport 2.2.5-0ubuntu1
ProcVersionSignature: User Name 3.5.0-2.2-generic 3.5.0-rc4
Uname: Linux 3.5.0-2-generic x86_64
Architecture: amd64
Date: Wed Jun 27 19:32:56 2012
PackageArchitecture: all
ProcEnviron:
TERM=screen
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: apport
UpgradeStatus: No upgrade log present (probably fresh install) |
|