Linenumbers of traceback wrong

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Thomas Guettler

    Linenumbers of traceback wrong

    Hi,

    Sometimes the linenumbers of a traceback are wrong.

    See this traceback. I don't use any attribute "key" here.
    The method search_dict does not use this attribute, too.

    Traceback (most recent call last):
    File "/mnt/raid/modarch/workflow/python/lib/python2.3/site-packages/quixote/publish.py", line 553, in publish
    output = self.process_re quest(request, env)
    File "/mnt/raid/modarch/workflow/python/lib/python2.3/site-packages/quixote/publish.py", line 535, in process_requ
    output = self.try_publis h(request, env.get('PATH_I NFO', ''))
    File "/mnt/raid/modarch/workflow/lib/ZEOClientPublis her.py", line 198, in try_publish
    return Publisher.try_p ublish(self, request, path)
    File "/mnt/raid/modarch/workflow/python/lib/python2.3/site-packages/quixote/publish.py", line 483, in try_publish
    output = object(request)
    File "/mnt/raid/modarch/workflow/lib/WorkflowServer. py", line 726, in search
    buchungsdatum_b is))
    File "/mnt/raid/modarch/workflow/lib/SearchCatalog.p y", line 302, in search_dict
    ids_dict.update (this_ids_dict)
    AttributeError: keys

    Python 2.3.2 (#1, Nov 20 2003, 12:57:28)
    [GCC 2.95.3 20010315 (SuSE)] on linux2


    "keys" get used here:

    def search(self, attr, value, maxvalue=None):
    result_dict=sel f.search_dict(a ttr, value, maxvalue)
    return result_dict.key s()

    ids_dict was created with "ids_dict={ }"

    Any hints?

    Thomas
  • Peter Otten

    #2
    Re: Linenumbers of traceback wrong

    Thomas Guettler wrote:
    [color=blue]
    > Sometimes the linenumbers of a traceback are wrong.
    >
    > See this traceback. I don't use any attribute "key" here.
    > The method search_dict does not use this attribute, too.
    >
    > Traceback (most recent call last):
    > File
    >[/color]
    "/mnt/raid/modarch/workflow/python/lib/python2.3/site-packages/quixote/publish.py",[color=blue]
    > line 553, in publish
    > output = self.process_re quest(request, env)
    > File
    >[/color]
    "/mnt/raid/modarch/workflow/python/lib/python2.3/site-packages/quixote/publish.py",[color=blue]
    > line 535, in process_requ
    > output = self.try_publis h(request, env.get('PATH_I NFO', ''))
    > File "/mnt/raid/modarch/workflow/lib/ZEOClientPublis her.py", line 198,
    > in try_publish
    > return Publisher.try_p ublish(self, request, path)
    > File
    >[/color]
    "/mnt/raid/modarch/workflow/python/lib/python2.3/site-packages/quixote/publish.py",[color=blue]
    > line 483, in try_publish
    > output = object(request)
    > File "/mnt/raid/modarch/workflow/lib/WorkflowServer. py", line 726, in
    > search
    > buchungsdatum_b is))
    > File "/mnt/raid/modarch/workflow/lib/SearchCatalog.p y", line 302, in
    > search_dict
    > ids_dict.update (this_ids_dict)
    > AttributeError: keys
    >
    > Python 2.3.2 (#1, Nov 20 2003, 12:57:28)
    > [GCC 2.95.3 20010315 (SuSE)] on linux2
    >
    >
    > "keys" get used here:
    >
    > def search(self, attr, value, maxvalue=None):
    > result_dict=sel f.search_dict(a ttr, value, maxvalue)
    > return result_dict.key s()
    >
    > ids_dict was created with "ids_dict={ }"
    >
    > Any hints?[/color]

    Consider:
    [color=blue][color=green][color=darkred]
    >>> d = {1:2, 3:4}
    >>> d.update(["a", "b"])[/color][/color][/color]
    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    AttributeError: keys[color=blue][color=green][color=darkred]
    >>> d.update({"a":1 , "b":2})[/color][/color][/color]

    dict.update() tries to access the keys method, so you should check if
    this_ids_dict is really a dictionary.

    Peter

    Comment

    Working...