8000 Not properly checking for invalid escape seqeunce \X · Issue #5656 · RustPython/RustPython · GitHub
[go: up one dir, main page]

Skip to content
Not properly checking for invalid escape seqeunce \X #5656
Open
@hbina

Description

@hbina

Summary

RustPython doesn't report any errors running the file RustPython/extra_tests/snippets/builtin_bytes.py

cargo run --release -- /home/hbina085/git/RustPython/extra_tests/snippets/builtin_bytes.py 
    Finished `release` profile [optimized] target(s) in 0.15s
     Running `target/release/rustpython /home/hbina085/git/RustPython/extra_tests/snippets/builtin_bytes.py`

Expected

But CPython does,

python /home/hbina085/git/RustPython/extra_tests/snippets/builtin_bytes.py 
/home/hbina085/git/RustPython/extra_tests/snippets/builtin_bytes.py:23: SyntaxWarning: invalid escape sequence '\X'
  assert b"omkmok\Xaa" == bytes([111, 109, 107, 109, 111, 107, 92, 88, 97, 97])

The issue is that RustPython does not check if \X is a valid escape sequence.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0