Skip to content

Support both Unicode and Path for icon_path.#575

Open
ryanlovett wants to merge 2 commits intojupyterhub:mainfrom
ryanlovett:icon-path-validate
Open

Support both Unicode and Path for icon_path.#575
ryanlovett wants to merge 2 commits intojupyterhub:mainfrom
ryanlovett:icon-path-validate

Conversation

@ryanlovett
Copy link
Copy Markdown
Collaborator

@ryanlovett ryanlovett requested review from manics and minrk April 17, 2026 21:29

icon_path = Unicode(
"",
icon_path = Union(
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.

Does CUnicode work? It's meant to be a casting variant of Unicode so might automatically convert Path to string.
https://traitlets.readthedocs.io/en/stable/trait_types.html#traitlets.CUnicode

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.

CUnicode is a little overly permissive because it will accept anything and cast to str. I think we should generally operate as if the C casting traitlets don't exist.

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.

3 participants