◐ Shell
reader mode source ↗
Skip to content

Raise ValueError if \x00 character exists for eval argument#4052

Merged
youknowone merged 10 commits into
RustPython:mainfrom
moreal:correct-eval
Aug 13, 2022
Merged

Raise ValueError if \x00 character exists for eval argument#4052
youknowone merged 10 commits into
RustPython:mainfrom
moreal:correct-eval

Conversation

@moreal

@moreal moreal commented Aug 12, 2022

Copy link
Copy Markdown
Contributor

It isn't a full perfect solution for eval implementation but it fixes:

  • eval became to receive bytes also.
  • eval raises ValueError when there is null (\x00) character before compiling.

You can see also:

    str = _Py_SourceAsString(source, "eval", "string, bytes or code", &cf, &source_copy);

p.s. The message says like it should receive string or bytes or code but it also receives bytearray well. 🤔

@moreal

moreal commented Aug 13, 2022

Copy link
Copy Markdown
Contributor Author

About the CI / Check Rust code with rustfmt and clippy (pull_request) is broken, you can see #4051

@moreal moreal requested a review from fanninpm August 13, 2022 03:12
@moreal moreal requested a review from youknowone August 13, 2022 18:21

@youknowone youknowone left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hide comment

looks great! I left a few minor change requests

moreal and others added 2 commits August 14, 2022 03:47
Co-authored-by: Jeong YunWon <69878+youknowone@users.noreply.github.com>

@youknowone youknowone left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hide comment

Thank you!

@youknowone youknowone added the z-ca-2022 Tag to track contrubution-academy 2022 label Aug 13, 2022
@youknowone youknowone merged commit d82c2b0 into RustPython:main Aug 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

z-ca-2022 Tag to track contrubution-academy 2022

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants