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

baron raise exception when unicode is in code #175

Open
James4Ever0 opened this issue Nov 9, 2022 · 0 comments
Open

baron raise exception when unicode is in code #175

James4Ever0 opened this issue Nov 9, 2022 · 0 comments

Comments

@James4Ever0
Copy link

example:

the unicode below are just attributes inside a class.

orders=[
        BSP.all.order.最多点击,
        BSP.all.order.最多收藏,
        BSP.all.order.最新发布,
        BSP.all.order.最多弹幕,
        BSP.all.order.综合排序,
    ]

exception:

Traceback (most recent call last):
  File "/media/root/parrot/pyjom/tests/skipexception_code_and_continue_resurrection_time_travel_debugging/codemod_redbaron/redbaron_test.py", line 6, in <module>
    r=redbaron.RedBaron(t)
  File "/usr/local/lib/python3.9/dist-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 "/usr/local/lib/python3.9/dist-packages/baron/baron.py", line 49, in parse
    tokens = tokenize(source_code, False)
  File "/usr/local/lib/python3.9/dist-packages/baron/baron.py", line 70, in tokenize
    splitted = split(pouet)
  File "/usr/local/lib/python3.9/dist-packages/baron/spliter.py", line 6, in split
    return list(split_generator(sequence))
  File "/usr/local/lib/python3.9/dist-packages/baron/spliter.py", line 76, in split_generator
    raise UntreatedError("Untreated elements: %s" % iterator.rest_of_the_sequence().__repr__()[:50])
baron.spliter.UntreatedError: Untreated elements: '最多点击,\n        BSP.all.order.最多收藏,\n        BSP.a
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