Skip to content

Conversation

@slozier
Copy link
Contributor

@slozier slozier commented Apr 5, 2022

Noticed this while reviewing #1385

@slozier slozier requested a review from BCSharp April 5, 2022 16:44
Copy link
Member

@BCSharp BCSharp left a comment

Choose a reason for hiding this comment

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

Glad you noticed that. While reviewing this PR, I've noticed that ParseComplex doesn't handle null chars correctly like ParseFloat does.

>>> complex("1111\x00")
(1111+0j)
>>> complex("1111\x00j")
1111j

The above should raise ValueError: complex() arg is a malformed string. Perhaps replacing ParseFloadNoCatch in ParseComplex with ParseFloat would do the trick.

@slozier
Copy link
Contributor Author

slozier commented Apr 6, 2022

Thanks for the review!

@slozier slozier merged commit a8090a0 into IronLanguages:master Apr 6, 2022
@slozier slozier deleted the complex branch April 6, 2022 13:06
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

Successfully merging this pull request may close these issues.

2 participants