Edgewall Software

Opened 17 years ago

Closed 17 years ago

Last modified 12 years ago

#82 closed defect (fixed)

infinite loop matching on axis 'self'

Reported by: robinbryce@… Owned by: cmlenz
Priority: major Milestone: 0.4
Component: XPath support Version: devel
Keywords: Cc:

Description

Using Genshi 0.3.5 (http://svn.edgewall.org/repos/genshi/tags/0.3.5). I have a small template that triggers an infinite loop in genshi.path.Path.test. I'm attempting to selectively match & modify tags based on both element paths and element attribute values.

This works as expected (it selects the ul tag and its kids)

<document xmlns:py="http://genshi.edgewall.org/">

<div id='matching_eg3'>
    <py:match path='ul'>
        <ul foo='bar' bar='foo' py:attrs='select("@*")'>
            ${select('.[@flag="1"]/*')}</ul>
    </py:match>
    <ul flag="1"><li>a</li><li>b</li></ul>
</div>
</document>

The following gets stuck for ever in genshi.path.Path.test, in the while 1: loop starting at line 184. The node test is successful and the path predicate is not.

<document xmlns:py="http://genshi.edgewall.org/">
<div id='matching_eg3'>
    <py:match path='ul'>
        <ul foo='bar' bar='foo' py:attrs='select("@*")'>
            ${select('.[@flag="0"]/*')}</ul>
    </py:match>
    <ul flag="1"><li>a</li><li>b</li></ul>
</div>
</document>

What am I doing wrong ?

Change History (3)

comment:1 in reply to: ↑ description Changed 17 years ago by cmlenz

  • Status changed from new to assigned

Replying to robinbryce@gmail.com:

What am I doing wrong ?

Nothing, you've discovered a bug :-P I'm able to reproduce this.

comment:2 Changed 17 years ago by cmlenz

  • Resolution set to fixed
  • Status changed from assigned to closed

Should be fixed in [466]. Thanks for reporting this!

comment:3 Changed 17 years ago by robinbryce@…

I can confirm this works on the trunk (r476). Thanks for the quick response.

Note: See TracTickets for help on using tickets.