You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
All irrelevant errors are not silenced when parsing reStructuredText data #4086
The issue here is that RobotFramework parses the entire ReST document, even though it ignores everything but robotframework code blocks (see here). This has caused problems in the past already (#2093), which were mitigated to some extent (#2152). This is not enough for csv-table (see here).
IMHO the solution is to make RobotFramework parse what it needs and only what it needs from ReST files, and ignore everything else.
Sounds good to me. Do you have any other examples of constructs that cause errors than csv-table?
The main question here is that do we consider this a bug that should still be fixed in RF 4.1.2 or can it wait for RF 5.0. The former would mean the fix is out soon but it has some drawbacks:
RF 4.1.x releases still need to support Python 2 but the fix seems to work only with Python 3. Making it Python 2 compatible is probably easy, but I'm still not sure is it worth the effort.
We want bug fix releases to be as stable as possible. This change would thus need to be tested with various docutils versions to make sure we aren't using an unstable API. With major releases like RF 5.0 this is easier because we have longer pre-release period and possible problems can also be fixed in future bug fix releases. RF 4.1.2 is planned to be the last RF 4.1.x release and I didn't want to create 4.1.3 to fix possible problems caused by this.
Sounds good to me. Do you have any other examples of constructs that cause errors than csv-table?
I don't have too many examples. Taking a quick look at docutils, the figure directive may fail similarly in some circumstances.
RF 4.1.x releases still need to support Python 2 but the fix seems to work only with Python 3. Making it Python 2 compatible is probably easy, but I'm still not sure is it worth the effort.
Hmm, yeah. If it's just the __wrapped__ attribute of functools wrapped function, that can be fixed.
This change would thus need to be tested with various docutils versions to make sure we aren't using an unstable API.
Good point. From what I can see in https://github.com/docutils-mirror/docutils, the docutils.parsers.rst.directives.directive function has been around since docutils inception and the docutils.parsers.rst.roles.role function has been around since docutils ~0.3. What could have changed is the use docutils makes of them and on which the fix relies on to be a fix. That I haven't checked.
Ultimately, it's fine if you're wary about potential breakage and you'd rather wait till the next major release. How far are we? I do need the fix 😅
The code is Python 2 compatible. __wrapped__ seems to be the only problem and that ought to be easy to fix. I added a comment to the PR about that.
The fix is tested with different docutils versions. Probably testing with 0.9, the lowest we support, and whatever is the latest version is enough. Would be good to test both with Python 2 and 3 on both of those.
The fix is tested with different docutils versions. Probably testing with 0.9, the lowest we support, and whatever is the latest version is enough. Would be good to test both with Python 2 and 3 on both of those.
We test with Python 2 and 3 on CI but I think they use the latest docutils. It's probably a lot easier to pip install different versions locally than configuring CI. That said, one Python 3 version on CI using oldest supported docutils while others use the latest could be a good idea in general.
changed the title [-]ReST `csv-table` directive may cause parsing errors[/-][+]All irrelevant errors are not silenced when parsing reStructuredText data[/+]on Sep 20, 2021
I tested this locally with different docutils and Python versions. I noticed docutils 0.9 didn't work with Python 3, but that same problem occurred also without these changes. Both the old code and the new code worked with docutils 0.10 so everything ought to be fine. With Python 2.7 also docutils 0.9 was fine.
Activity
hidmic commentedon Sep 14, 2021
The issue here is that
RobotFrameworkparses the entire ReST document, even though it ignores everything butrobotframeworkcode blocks (see here). This has caused problems in the past already (#2093), which were mitigated to some extent (#2152). This is not enough forcsv-table(see here).IMHO the solution is to make RobotFramework parse what it needs and only what it needs from ReST files, and ignore everything else.
pekkaklarck commentedon Sep 14, 2021
Sounds good to me. Do you have any other examples of constructs that cause errors than
csv-table?The main question here is that do we consider this a bug that should still be fixed in RF 4.1.2 or can it wait for RF 5.0. The former would mean the fix is out soon but it has some drawbacks:
hidmic commentedon Sep 14, 2021
I don't have too many examples. Taking a quick look at
docutils, thefiguredirective may fail similarly in some circumstances.Hmm, yeah. If it's just the
__wrapped__attribute offunctoolswrapped function, that can be fixed.Good point. From what I can see in https://github.com/docutils-mirror/docutils, the
docutils.parsers.rst.directives.directivefunction has been around sincedocutilsinception and thedocutils.parsers.rst.roles.rolefunction has been around sincedocutils~0.3. What could have changed is the usedocutilsmakes of them and on which the fix relies on to be a fix. That I haven't checked.Ultimately, it's fine if you're wary about potential breakage and you'd rather wait till the next major release. How far are we? I do need the fix 😅
pekkaklarck commentedon Sep 14, 2021
I'm fine adding this to RF 4.1.2 if:
__wrapped__seems to be the only problem and that ought to be easy to fix. I added a comment to the PR about that.hidmic commentedon Sep 14, 2021
Do you happen to have some CI workflows for that?
pekkaklarck commentedon Sep 15, 2021
We test with Python 2 and 3 on CI but I think they use the latest docutils. It's probably a lot easier to pip install different versions locally than configuring CI. That said, one Python 3 version on CI using oldest supported docutils while others use the latest could be a good idea in general.
[-]ReST `csv-table` directive may cause parsing errors[/-][+]All irrelevant errors are not silenced when parsing reStructuredText data[/+]Narrow down the scope of ReST parsing. (#4085)
pekkaklarck commentedon Sep 20, 2021
I tested this locally with different docutils and Python versions. I noticed docutils 0.9 didn't work with Python 3, but that same problem occurred also without these changes. Both the old code and the new code worked with docutils 0.10 so everything ought to be fine. With Python 2.7 also docutils 0.9 was fine.
hidmic commentedon Sep 20, 2021
@pekkaklarck at last, will this go into a 4.1.2 release or will it hold for the 5.0.0 bump?
pekkaklarck commentedon Sep 21, 2021
I considered this a bug fix, and relatively safe, so it's in RF 4.1.2.