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

--convert-3to4 incorrectly escaping quotes when using signal yields #63291

Closed
and3rson opened this issue Jul 21, 2022 · 3 comments · Fixed by #63887
Closed

--convert-3to4 incorrectly escaping quotes when using signal yields #63291

and3rson opened this issue Jul 21, 2022 · 3 comments · Fixed by #63887

Comments

@and3rson
Copy link
Contributor

and3rson commented Jul 21, 2022

Godot version

4.0-alpha12

System information

ArchLinux

Issue description

--convert-3to4 improperly escapes quotes when converting yield(obj, "signal") to await obj.signal format:

# Original:

[sub_resource type="GDScript" id=269]
script/source = "extends ColorRect
# ...
    yield(self.fade_out(), \"finished\")
# ...
"

# After conversion:
[sub_resource type="GDScript" id=269]
script/source = "extends ColorRect
# ...
    await self.fade_out().\finished\
# ...
"

This leads to a broken escape (\f) in the editor:

image

Steps to reproduce

  1. Create a project in Godot 3.x that uses yield(obj, signal) syntax
  2. Run Godot 4.x with --convert-3to4 parameter
  3. Observe broken quote escapes

Minimal reproduction project

No response

@Calinou
Copy link
Member

Calinou commented Jul 21, 2022

cc @qarmin

PS: 2to3? Isn't it 3to4?

@Calinou Calinou added this to the 4.0 milestone Jul 21, 2022
@Calinou Calinou moved this to To Assess in 4.x Priority Issues Jul 21, 2022
@and3rson
Copy link
Contributor Author

and3rson commented Jul 21, 2022

cc @qarmin

PS: 2to3? Isn't it 3to4?

Sorry, you're right. Those were terrible flashbacks from Python 2.x times.

@and3rson and3rson changed the title --convert-2to3 incorrectly escaping quotes when using signal yields --convert-3to4 incorrectly escaping quotes when using signal yields Jul 21, 2022
@and3rson
Copy link
Contributor Author

and3rson commented Jul 21, 2022

There seems to be a test covering this in 24f45bd, but it still seems to reproduce

EDIT: Nevermind, the test does not cover the escape itself (should be \\\")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
2 participants