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

Handle NUL bytes in strings everywhere #407

Closed
andychu opened this issue Jul 6, 2019 · 2 comments
Closed

Handle NUL bytes in strings everywhere #407

andychu opened this issue Jul 6, 2019 · 2 comments

Comments

@andychu
Copy link
Contributor

andychu commented Jul 6, 2019

From #387

This probably happens all over the place. Options:

  1. silently truncate (bash)
  2. raise a fatal error

I think I want to get rid of the concept of "warnings".

It's similar what happens when we have invalid UTF-8.

@andychu
Copy link
Contributor Author

andychu commented Jan 7, 2023

Note: we have an issue where CPython will raise exceptions on internal NUL bytes, but our C++ bindings don't, and probably shouldn't

>>> import os
>>> os.system('ls\0')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: system() argument 1 must be string without null bytes, not str
>>> 

@andychu
Copy link
Contributor Author

andychu commented Mar 9, 2024

This works in C++, and is tested

@andychu andychu closed this as completed Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant