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

Semantically unchanged CST nodes do not always roundtrip safely #7

Closed
sirosen opened this issue Feb 1, 2024 · 3 comments
Closed

Semantically unchanged CST nodes do not always roundtrip safely #7

sirosen opened this issue Feb 1, 2024 · 3 comments

Comments

@sirosen
Copy link
Owner

sirosen commented Feb 1, 2024

Probably a slight misuse of libcst APIs:

-case y, z:
+case [y, z]:
@sirosen sirosen changed the title Semantically unchanged case expressions in match-case do not roundtrip safely Semantically unchanged CST nodes do not always roundtrip safely Feb 1, 2024
@sirosen
Copy link
Owner Author

sirosen commented Feb 1, 2024

Found another fun case in some encoding tests:

 # -*- encoding: koi8-r  -*-
-test = "ðÏÚÎÁÎÉÅ ÂÅÓËÏÎÅÞÎÏÓÔÉ ÔÒÅÂÕÅÔ ÂÅÓËÏÎÅÞÎÏÇÏ ×ÒÅÍÅÎÉ.
+test = "Познание бесконечности требует бесконечного времени.

(Source: CPython, Lib/test/encoded_modules/module_koi8_r.py)

@sirosen
Copy link
Owner Author

sirosen commented Feb 2, 2024

Tracked part of this down to what appears to be a libcst bug:
Instagram/LibCST#1096

@sirosen
Copy link
Owner Author

sirosen commented Feb 3, 2024

The encoding issue was fixed: 66d66cb

All that's left is to pick up a new libcst release to fix match handling.

@sirosen sirosen closed this as completed Aug 2, 2024
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