Skip to content

Weaken locale dependency #168

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JackYoustra
Copy link
Contributor

If you run code2prompt on a system with an unset locale (such as ssh'ed wsl2), it can crash when using format token. I weaken this and make the format token flag only take effect if systemlocale is valid.

There are other approaches possible too: we could change the default_value to be raw if systemlocale is invalid, for example. I'm not sure what the best approach is for a tool like this. If the maintainers think a different direction is better, feel free to comment and I'll revise.

@ODAncona
Copy link
Collaborator

Hi @JackYoustra ,

Thanks to bring this issue,

I bet the most straightforward and robust way would be:

Expected behavior

  1. Use the system locale by default
  2. If unavailable use raw formatting and display a Warning message

What do you think?

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