Edgewall Software

Ticket #82 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

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 ?

Attachments

Change History

in reply to: ↑ description   Changed 2 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.

  Changed 2 years ago by cmlenz

  • status changed from assigned to closed
  • resolution set to fixed

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

  Changed 2 years ago by robinbryce@…

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

Add/Change #82 (infinite loop matching on axis 'self')

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.