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

Consider escaping more characters when generating node ids #2649

Open
nicoddemus opened this issue Aug 2, 2017 · 3 comments
Open

Consider escaping more characters when generating node ids #2649

nicoddemus opened this issue Aug 2, 2017 · 3 comments
Labels
type: enhancement new feature or API change, should be merged into features branch type: feature-branch new feature or API change, should be merged into features branch

Comments

@nicoddemus
Copy link
Member

As discussed in #2646:

We might consider escaping null bytes and other unprintable characters when generating node ids.

@nicoddemus nicoddemus added the type: feature-branch new feature or API change, should be merged into features branch label Aug 2, 2017
@nicoddemus nicoddemus added type: enhancement new feature or API change, should be merged into features branch and removed type: enhancement new feature or API change, should be merged into features branch labels Sep 14, 2017
@CarycaKatarzyna
Copy link
Contributor

Is it still actual? The code here

_non_printable_ascii_translate_table = {
i: "\\x{:02x}".format(i) for i in range(128) if i not in range(32, 127)
}
_non_printable_ascii_translate_table.update(
{ord("\t"): "\\t", ord("\r"): "\\r", ord("\n"): "\\n"}
)
def _translate_non_printable(s: str) -> str:
return s.translate(_non_printable_ascii_translate_table)

seems to be good at escaping unprintable bytes. Can you add any failed example?

@RonnyPfannschmidt
Copy link
Member

I would like to deprecate non printable node ids, everything in a nodeid should be safe to handle

@CarycaKatarzyna
Copy link
Contributor

Could you add instructions on how to create a nodeid with unprintable bytes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement new feature or API change, should be merged into features branch type: feature-branch new feature or API change, should be merged into features branch
Projects
None yet
Development

No branches or pull requests

3 participants