← Winnitude! Search  ·  Reader Mode (836 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 12 LINKS

Error when handling non-ascii filename · Issue #1631 · gitpython-developers/GitPython

Repository navigation

Error when handling non-ascii filename  #1631


New issue

New issue

Closed as not planned
Bug
Closed as not planned
Error when handling non-ascii filename #1631 Bug Labels
acknowledged

help wanted

Description

@lubomir's profile lubomir opened on Aug 22, 2023

Steps to reproduce:

$ mkdir foo
$ cd foo
$ git init
$ touch 'bokm'$'\345''l.alias'
$ python -c 'import git; git.Repo(".").untracked_files'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.11/site-packages/git/repo/base.py", line 839, in untracked_files
    return self._get_untracked_files()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/git/repo/base.py", line 856, in _get_untracked_files
    filename = filename.encode("ascii").decode("unicode_escape").encode("latin1").decode(defenc)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe5 in position 4: invalid continuation byte

I can reproduce with 3.1.30 and 3.1.32.

A file with such name is present in ftp://ftp.gnu.org/gnu/aspell/dict/nb/aspell-nb-0.50.1-0.tar.bz2
I'm not sure what encoding it's supposed to be. Firefox detects it as windows-1252 (and displays it correctly).

Metadata

Metadata

Assignees

No one assigned

    Labels


    acknowledged

    help wanted

    Type

    Bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions