You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
encoding problem in opening packed-refs file(Windows) #750
and next line value = fp.read().rstrip(), this builtin lib can not read non-unicode string
I think, this expected encoding is 'utf-8' or 'unicode', but is setting for default system language encoder.
So, I modified this line(no.93 and 148 at symbolic.py) for that
#with open(cls._get_packed_refs_path(repo), 'rt') as fp:#modify: encoding option setting for multilanguagewithopen(cls._get_packed_refs_path(repo), 'rt', encoding='utf-8') asfp:
after this modify, it has no problem! but, I worried about some side-effect.
few source code used yet open() function, I can not certain for every coverage from os, encoding system and etc.
I've encountered a variation on this error when the non-ascii ref is in refs/heads instead of packed-refs.
File '/var/local/env-allura/lib/python2.7/site-packages/git/repo/base.py', line 269 in heads
return Head.list_items(self)
File '/var/local/env-allura/lib/python2.7/site-packages/git/util.py', line 934 in list_items
out_list.extend(cls.iter_items(repo, *args, **kwargs))
File '/var/local/env-allura/lib/python2.7/site-packages/git/refs/symbolic.py', line 601 in _iter_items
for root, dirs, files in os.walk(join_path_native(repo.common_dir, common_path)):
File '/usr/lib64/python2.7/os.py', line 284 in walk
if isdir(join(top, name)):
File '/usr/lib64/python2.7/posixpath.py', line 80 in join
path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 15: ordinal not in range(128)
Activity
brondsem commentedon May 1, 2018
I've encountered a variation on this error when the non-ascii ref is in refs/heads instead of packed-refs.