invalid byte sequence in UTF-8 in Windows10 and Windows Server 2016

Ouverte
#791 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
35/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
git, ruby
Domaine
devtools

Piste de recherche

The exception is raised in win32_symlink? in lib/overcommit/utils/file_utils.rb around line 67, reached through symlink? and broken_symlink? in lib/overcommit/utils.rb and then store_modified_times in lib/overcommit/hook_context/helpers/stash_unstaged_changes.rb. Start by checking how that code reads the symlink or file output and what encoding it assumes on Windows. Reproducing it needs a Windows setup with a non-UTF-8 default encoding. Done means the pre-commit hook runs on Windows without the 'invalid byte sequence' error and the existing specs still pass.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

bug help wanted

Error:
C:\Users\artem\Desktop\TestOvercommit\overcommit>git commit -m "fix" invalid byte sequence in UTF-8 C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/overcommit-0.59.1/lib/overcommit/utils/file_utils.rb:67:in win32_symlink?'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/overcommit-0.59.1/lib/overcommit/utils/file_utils.rb:27:in symlink?' C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/overcommit-0.59.1/lib/overcommit/utils.rb:271:in broken_symlink?'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/overcommit-0.59.1/lib/overcommit/hook_context/helpers/stash_unstaged_changes.rb:65:in block in store_modified_times' C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/overcommit-0.59.1/lib/overcommit/hook_context/helpers/stash_unstaged_changes.rb:64:in each'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/overcommit-0.59.1/lib/overcommit/hook_context/helpers/stash_unstaged_changes.rb:64:in store_modified_times' C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/overcommit-0.59.1/lib/overcommit/hook_context/helpers/stash_unstaged_changes.rb:11:in setup_environment'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/overcommit-0.59.1/lib/overcommit/hook_runner.rb:42:in block in run' C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/overcommit-0.59.1/lib/overcommit/interrupt_handler.rb:86:in isolate_from_interrupts'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/overcommit-0.59.1/lib/overcommit/hook_runner.rb:30:in run' .git/hooks/pre-commit:87:in

'
Report this bug at https://github.com/sds/overcommit/issues`

.overcommit.yml:
PreCommit: RuboCop: enabled: true

please help me to solve the problem

Langage dominant
Ruby
Étoiles
4k
Forks
288
Merge moyen
2 j 4 h
PR mergées (30 j)
18

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de sds/overcommit

Toutes les issues de sds/overcommit

Issues similaires

Plus d'issues Ruby

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.