encode:UnicodeDecodeError: 'ascii' #74

Closed
christianjann opened this Issue Apr 8, 2011 · 4 comments

Comments

Projects
None yet
2 participants
@christianjann

https://bugzilla.redhat.com/show_bug.cgi?id=694806

backtrace

core.py:36:encode:UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in
position 56: ordinal not in range(128)

Traceback (most recent call last):
File "/usr/bin/git-cola", line 54, in
cola.main.main()
File "/usr/share/git-cola/lib/cola/main.py", line 157, in main
valid = model.use_worktree(repo)
File "/usr/share/git-cola/lib/cola/models/main.py", line 141, in use_worktree
self._init_config_data()
File "/usr/share/git-cola/lib/cola/models/main.py", line 183, in
_init_config_data
_config.update()
File "/usr/share/git-cola/lib/cola/gitcfg.py", line 88, in update
self._read_configs()
File "/usr/share/git-cola/lib/cola/gitcfg.py", line 117, in _read_configs
self._repo = self.read_config(self._config_files['repo'])
File "/usr/share/git-cola/lib/cola/gitcfg.py", line 127, in read_config
config_lines = self.git.config(_args).split('\0')
File "/usr/share/git-cola/lib/cola/git.py", line 63, in
return lambda *args, *_kwargs: self._call_process(name, _args, *_kwargs)
File "/usr/share/git-cola/lib/cola/git.py", line 224, in _call_process
ext_args = map(core.encode, args)
File "/usr/share/git-cola/lib/cola/core.py", line 36, in encode
return unenc.encode('utf-8', 'replace')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 56:
ordinal not in range(128)

Local variables in innermost frame:
unenc:
'/home/chris/work/projects/csync/backup/csync_Christian_K\xc3\xb6lpin/csync/.git/config'

@davvid

This comment has been minimized.

Show comment
Hide comment
@davvid

davvid Apr 10, 2011

Member

What is the value of $LANG in your configuration?

echo $LANG

That might not matter, though. I was just able to reproduce this by using a directory with unicode characters. Fix on the way... thanks for the report.

Member

davvid commented Apr 10, 2011

What is the value of $LANG in your configuration?

echo $LANG

That might not matter, though. I was just able to reproduce this by using a directory with unicode characters. Fix on the way... thanks for the report.

@ghost ghost assigned davvid Apr 10, 2011

@christianjann

This comment has been minimized.

Show comment
Hide comment

en_US.UTF-8

@davvid davvid closed this in 3ee70d6 Apr 10, 2011

@christianjann

This comment has been minimized.

Show comment
Hide comment
@christianjann

christianjann Apr 15, 2011

I don't get a crash, but I see this on the command line:
Traceback (most recent call last):
File "/usr/share/git-cola/lib/cola/views/main.py", line 269, in _update_callback
merge_msg_hash = utils.checksum(merge_msg_path)
File "/usr/share/git-cola/lib/cola/utils.py", line 287, in checksum
md5.update(slurp(path))
File "/usr/share/git-cola/lib/cola/utils.py", line 209, in slurp
fh = open(core.encode(path))
File "/usr/share/git-cola/lib/cola/core.py", line 36, in encode
return unenc.encode('utf-8', 'replace')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 56: ordinal not in range(128)

git-cola --version
cola version 1.4.3.2

I don't get a crash, but I see this on the command line:
Traceback (most recent call last):
File "/usr/share/git-cola/lib/cola/views/main.py", line 269, in _update_callback
merge_msg_hash = utils.checksum(merge_msg_path)
File "/usr/share/git-cola/lib/cola/utils.py", line 287, in checksum
md5.update(slurp(path))
File "/usr/share/git-cola/lib/cola/utils.py", line 209, in slurp
fh = open(core.encode(path))
File "/usr/share/git-cola/lib/cola/core.py", line 36, in encode
return unenc.encode('utf-8', 'replace')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 56: ordinal not in range(128)

git-cola --version
cola version 1.4.3.2

@davvid

This comment has been minimized.

Show comment
Hide comment
@davvid

davvid Apr 15, 2011

Member

Thanks for the heads up. I found more places where we were not properly handling unicode. You should see the commits shortly. If you could try running cola from its source tree that will help me know whether the fixes are good before making a new release. Just clone the repo and run /path/to/git-cola/bin/git-cola to test it.

I was able to reproduce this by creating a directory with unicode characters, doing "git init" in there, and then setting $HOME to that directory. I was then able to run cola and find a few more bugs.

Member

davvid commented Apr 15, 2011

Thanks for the heads up. I found more places where we were not properly handling unicode. You should see the commits shortly. If you could try running cola from its source tree that will help me know whether the fixes are good before making a new release. Just clone the repo and run /path/to/git-cola/bin/git-cola to test it.

I was able to reproduce this by creating a directory with unicode characters, doing "git init" in there, and then setting $HOME to that directory. I was then able to run cola and find a few more bugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment