Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GroupingError on await expression #212

Open
Aluriak opened this issue Mar 19, 2022 · 0 comments
Open

GroupingError on await expression #212

Aluriak opened this issue Mar 19, 2022 · 0 comments

Comments

@Aluriak
Copy link

Aluriak commented Mar 19, 2022

Hi !

While running RedBaron on all .py of my virtualenv, i got the following error:

Traceback (most recent call last):
  File "proj/proj.py", line 149, in <module>
    main()
  File "proj/proj.py", line 39, in get_imports_from
    red = RedBaron(fd.read())
  File "proj/venv/lib/python3.10/site-packages/redbaron/redbaron.py", line 36, in __init__
    self.node_list = base_nodes.NodeList.from_fst(baron.parse(source_code), parent=self, on_attribute="root")
  File "proj/venv/lib/python3.10/site-packages/baron/baron.py", line 49, in parse
    tokens = tokenize(source_code, False)
  File "proj/venv/lib/python3.10/site-packages/baron/baron.py", line 74, in tokenize
    inner_grouped = inner_group(space_grouped)
  File "proj/venv/lib/python3.10/site-packages/baron/inner_formatting_grouper.py", line 119, in group
    return list(group_generator(sequence))
  File "proj/venv/lib/python3.10/site-packages/baron/inner_formatting_grouper.py", line 173, in group_generator
    fail_on_bad_token(iterator.show_next(), debug_file_content, in_grouping_mode)
  File "proj/venv/lib/python3.10/site-packages/baron/inner_formatting_grouper.py", line 132, in fail_on_bad_token
    raise GroupingError("Fail to group formatting tokens, here:\n%s <----\n\n'%s' should have been in: %s\n\nCurrent value of 'in_grouping_mode': %s" % (debug_file_content, token, ', '.join(sorted(GROUP_ON)), in_grouping_mode))
baron.inner_formatting_grouper.GroupingError: Fail to group formatting tokens, here:
 126         if self._rcv_task.done():
 127             raise RouterClosed("This DBusRouter has stopped")
 128 
 129         serial = next(self._conn.outgoing_serial)
 130 
 131         with self._replies.catch(serial, asyncio.Future()) as reply_fut:
 132             await self.send(message, serial=serial)
 133             return (await reply_fut <----

'('NAME', 'reply_fut')' should have been in: AMPER, AMPER_EQUAL, AND, AS, AT, AT_EQUAL, BINARY_RAW_STRING, BINARY_STRING, CIRCUMFLEX, CIRCUMFLEX_EQUAL, COLON, COLON, COMMA, DOT, DOUBLE_SLASH, DOUBLE_SLASH_EQUAL, DOUBLE_STAR, DOUBLE_STAR_EQUAL, ELSE, ENDL, EQUAL, EQUAL_EQUAL, FOR, FROM, GREATER, GREATER_EQUAL, IF, IMPORT, IN, INTERPOLATED_RAW_STRING, INTERPOLATED_STRING, IS, LEFT_BRACKET, LEFT_PARENTHESIS, LEFT_SHIFT, LEFT_SHIFT_EQUAL, LEFT_SQUARE_BRACKET, LEFT_SQUARE_BRACKET, LESS, LESS_EQUAL, MINUS, MINUS_EQUAL, NOT, NOT_EQUAL, OR, PERCENT, PERCENT_EQUAL, PLUS, PLUS_EQUAL, RAW_STRING, RAW_STRING, RIGHT_BRACKET, RIGHT_PARENTHESIS, RIGHT_SHIFT, RIGHT_SHIFT_EQUAL, RIGHT_SQUARE_BRACKET, SLASH, SLASH_EQUAL, STAR, STAR_EQUAL, STRING, UNICODE_RAW_STRING, UNICODE_RAW_STRING, UNICODE_STRING, UNICODE_STRING, VBAR, VBAR_EQUAL

Current value of 'in_grouping_mode': 1

Maybe that's expected, feel free to close this issue.

For reference, the file is venv/lib/python3.10/site-packages/jeepney/io/asyncio.py, which seems to be hosted here.

Thank you for your work, redbaron is awesome \o/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant