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 }}
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.
I have a problem, which I wasn't able to fix myself. If my directory i want to cd in contains german umlauts, then I got the error mentioned in the title:
$ cd /Users/Martin/Dropbox/Entwicklung/Bstäpp
Traceback (most recent call last):
File "/Users/Martin/bin/promptastic/promptastic.py", line 186, in <module>
write(prompt.render())
File "/Users/Martin/bin/promptastic/promptastic.py", line 37, in render
first_line = self._render_first_line()
File "/Users/Martin/bin/promptastic/promptastic.py", line 65, in _render_first_line
output += segment.render()
UnicodeDecodeError: 'ascii' codec can't decode byte 0xcc in position 68: ordinal not in range(128)
Any idea where to encode de ascii-string in the promptastic.py? Thanks for your help!
The text was updated successfully, but these errors were encountered:
Hi,
I had the same issue with 'é, è, à' in French, and found a quick way to fix it.
In the function get_valid_cwd() in utils.sys, try to replace : cwd = os.getcwd()
by cwd = os.getcwd().decode('utf-8')
I'm not 100% sure why it works though. The getcwd function returns a unicode object, which needs to be decoded. So I think that Python implicitly somehow does it, probably in ascii by default. With it, I force the string to be in UTF8.
I'll read more about encodings in python later, and I'll come back here if I find a clear explanation.
Hope this helped.
I have a problem, which I wasn't able to fix myself. If my directory i want to
cd
in contains german umlauts, then I got the error mentioned in the title:Any idea where to encode de ascii-string in the promptastic.py? Thanks for your help!
The text was updated successfully, but these errors were encountered: