sparckles / Robyn

Robyn is a Super Fast Async Python Web Framework with a Rust runtime.
https://robyn.tech/
BSD 2-Clause "Simplified" License
4.45k stars 229 forks source link

Git error: bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) #1027

Open dave42w opened 1 week ago

dave42w commented 1 week ago

Bug Description

For some files (mostly when trying to commit multiple files) I'm getting this message (from with VSCODE and from the command line)

> git -c user.useConfigOnly=true commit --quiet --allow-empty-message --file -
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
[WARNING] Unstaged files detected.
[INFO] Stashing unstaged files to /home/dave/.cache/pre-commit/patch1731348310-81464.
ruff.....................................................................Passed
ruff-format..............................................................Failed
- hook id: ruff-format
- files were modified by this hook

warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `pyproject.toml`:
  - 'mccabe' -> 'lint.mccabe'
1 file reformatted

[WARNING] Stashed changes conflicted with hook auto-fixes... Rolling back fixes...
[INFO] Restored changes from /home/dave/.cache/pre-commit/patch1731348310-81464.

I've tried changing pyproject.toml from [tool.ruff.mccabe] to [tool.ruff.lint.mccabe] but it doesn't help.

Steps to Reproduce

It's not entirely consistent. I can't work out why it happens for some groups of files (but not if committed singly). Latest example is after a 1 line change in authentication.py from

        if "authorization" in request.headers:

to

        if request.headers.contains("authorization"):

Your operating system

Linux

Your Python version (python --version)

3.12

Your Robyn version

main branch

Additional Info

No response

sansyrox commented 1 day ago

Hey @dave42w 👋

I was unable to reproduce this error 😅 Were you able to reproduce it again? And is it only happening with Robyn?

dave42w commented 1 day ago

I got it again last night with a commit on the static files. I eventually got it to commit without changing the code by committing only one file at a time (and it worked in one order but not the other) and by simplifying the commit message (maybe it didn't like me using _ to reference a method?)