On Wed, 2012-07-11 at 10:38 -0400, Chris Lumens wrote:
> diff --git a/meh/dump.py b/meh/dump.py
> index 7e01d39..adfdb27 100644
> --- a/meh/dump.py
> +++ b/meh/dump.py
> @@ -249,9 +249,9 @@ class ExceptionDump(object):
>
> return traceback.format_list(frames)
>
> - # Create a string representation of a class and write it to fd. This
> - # method will recursively handle all attributes of the base given class.
> - def _dumpClass(self, instance, fd, level=0, parentkey="",
skipList=[]):
> + # Create a string representation of a class. This method will recursively
> + # handle all attributes of the base given class.
> + def _dumpClass(self, instance, level=0, parentkey="", skipList=[]):
While you're here, you might as well get rid of the bug we've been
dragging around forever. Convert to skipList=None and then at the
beginning of the function, add a:
if not skipList:
skipList = []
The key is to just not have a list as the default argument to something.
Good idea,
I will change this before pushing.
> @@ -209,7 +211,9 @@ class ExceptionHandler(object):
> params["reason"] = self.exn.desc
> params["description"] = "The following was filed
automatically by %s:\n%s" \
> % (self.conf.programName, str(self.exn))
> - params["exnFileName"] = self.exnFile
> +
> + tb_item_name = "%s-tb" % self.conf.programName
> + params[tb_item_name] = self.exnText
>
> accountManager = report.accountmanager.AccountManager()
>
I've not been following along too well with things in report land. Does
the traceback still end up getting written to a file with a unique
component in the filename?
This is handled few lines above (still using the
openFile() method):
# Save the exception to the filesystem first.
self.exn = self.exnClass((ty, value, tb), self.conf)
(fd, self.exnFile) = self.openFile()
- text = self.exn.write(obj, fd)
+ self.exnText = self.exn.traceback_and_object_dump(obj)
+ fd.write(self.exnText)
fd.close()
As for the bugreport -- since some people use the anaconda-tb prefix to
search through bugreports, I kept the name of the item (passed in the
params dictionary) to match this prefix. Without this patch, report
reads the file content and attaches it to bugreport under the name of
the file (e.g. anaconda-tb-PfS1Hi). With this patch, report just doesn't
have to read the file contents and the name of the attached file is
simply 'anaconda-tb' without the random suffix.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic