Thanks for reporting, committed fix

On Fri, Mar 18, 2011 at 7:57 AM, Peter Cock <p.j.a.cock@googlemail.com> wrote:
Hi all,

I just got a nasty recursion error when trying to run the functional
tests for my TMHMM and
SignalP wrappers - tools which produce tabular output.

galaxy.jobs.runners.local: ERROR: Job wrapper finish method failed
Traceback (most recent call last):
 File "/home/pjcock/repositories/galaxy-central/lib/galaxy/jobs/runners/local.py",
line 125, in run_job
   job_wrapper.finish( stdout, stderr )
 File "/home/pjcock/repositories/galaxy-central/lib/galaxy/jobs/__init__.py",
line 578, in finish
   dataset.set_peek()
 File "/home/pjcock/repositories/galaxy-central/lib/galaxy/model/__init__.py",
line 690, in set_peek
   return self.datatype.set_peek( self, is_multi_byte=is_multi_byte )
 File "/home/pjcock/repositories/galaxy-central/lib/galaxy/datatypes/tabular.py",
line 227, in set_peek
   data.Text.set_peek( self, dataset, line_count=line_count,
is_multi_byte=is_multi_byte )
 File "/home/pjcock/repositories/galaxy-central/lib/galaxy/datatypes/data.py",
line 431, in set_peek
   self.set_peek(dataset)
...
 File "/home/pjcock/repositories/galaxy-central/lib/galaxy/datatypes/tabular.py",
line 227, in set_peek
   data.Text.set_peek( self, dataset, line_count=line_count,
is_multi_byte=is_multi_byte )
 File "/home/pjcock/repositories/galaxy-central/lib/galaxy/datatypes/data.py",
line 431, in set_peek
   self.set_peek(dataset)
...
 File "/home/pjcock/repositories/galaxy-central/lib/galaxy/datatypes/tabular.py",
line 227, in set_peek
   data.Text.set_peek( self, dataset, line_count=line_count,
is_multi_byte=is_multi_byte )
 File "/home/pjcock/repositories/galaxy-central/lib/galaxy/datatypes/data.py",
line 419, in set_peek
   dataset.peek = get_file_peek( dataset.file_name,
is_multi_byte=is_multi_byte )
 File "/home/pjcock/repositories/galaxy-central/lib/galaxy/model/__init__.py",
line 628, in get_file_name
   return self.dataset.get_file_name()
 File "/home/pjcock/repositories/galaxy-central/lib/galaxy/model/__init__.py",
line 515, in get_file_name
   return os.path.abspath( os.path.join( dir, "dataset_%d.dat" % self.id ) )
 File "/usr/local/lib/python2.6/posixpath.py", line 348, in abspath
   return normpath(path)
 File "/usr/local/lib/python2.6/posixpath.py", line 314, in normpath
   slash, dot = (u'/', u'.') if isinstance(path, unicode) else ('/', '.')
RuntimeError: maximum recursion depth exceeded while calling a Python object


>From the trace, two set_peek methods are calling each other in a loop. I deduced
the problem was an empty tabular files, where
dataset.metadata.data_lines is zero,
but the test should really have been for None. Please review and apply
this patch
which appears to correctly resolve the issue:


diff -r 9fae539215be lib/galaxy/datatypes/data.py
--- a/lib/galaxy/datatypes/data.py      Fri Mar 18 11:46:48 2011 +0000
+++ b/lib/galaxy/datatypes/data.py      Fri Mar 18 11:49:05 2011 +0000
@@ -422,7 +422,7 @@
            dataset.peek = get_file_peek( dataset.file_name,
is_multi_byte=is_multi_byte )
            if line_count is None:
                # See if line_count is stored in the metadata
-                if dataset.metadata.data_lines:
+                if dataset.metadata.data_lines is not None:
                    dataset.blurb = "%s %s" % ( util.commaify(
str(dataset.metadata.data_lines) ),
inflector.cond_plural(dataset.metadata.data_lines, "line") )
                else:
                    # Number of lines is not known ( this should not
happen ), and auto-detect is



Thanks,

Peter
___________________________________________________________
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:

 http://lists.bx.psu.edu/