strycore / fakegir

fakegir: Bring autocompletion to your PyGObject code
GNU General Public License v3.0
89 stars 16 forks source link

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 422619: ordinal not in range(128) #21

Closed ilya-zlobintsev closed 6 years ago

ilya-zlobintsev commented 6 years ago

I once used fakegir to get PyGObject completions work in vim with YCM, it worked fine. Now after reinstall of Arch Linux I'm getting an error when running fakegir.py: Parsing /usr/share/gir-1.0/Secret-1.gir Parsing /usr/share/gir-1.0/Atk-1.0.gir Traceback (most recent call last): File "./fakegir.py", line 420, in <module> generate_fakegir() File "./fakegir.py", line 412, in generate_fakegir fakegir_content = parse_gir(gir_path) File "./fakegir.py", line 366, in parse_gir content = open(gir_path).read() File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 422619: ordinal not in range(128) P.S. My first time opening an issue on github, so idk how to make these logs's lines look better.

kastixx commented 6 years ago

Looks strange. Can you upload a copy of your /usr/share/gir-1.0/Atk-1.0.gir file somewhere?

My first time opening an issue on github, so idk how to make these logs's lines look better.

You can place lines with three backticks (```) before and after your log fragment:

```

Parsing /usr/share/gir-1.0/Secret-1.gir
Parsing /usr/share/gir-1.0/Atk-1.0.gir
Traceback (most recent call last):
  File "./fakegir.py", line 420, in <module>
    generate_fakegir()
  File "./fakegir.py", line 412, in generate_fakegir
    fakegir_content = parse_gir(gir_path)
  File "./fakegir.py", line 366, in parse_gir
    content = open(gir_path).read()
  File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 422619: ordinal not in range(128)

```

ilya-zlobintsev commented 6 years ago

Sure: https://drive.google.com/open?id=1PhWfnylneFBeHMlHXdNblMoJbla_Y4DS

kastixx commented 6 years ago

Could you do

git fetch
git checkout test-issue21

and try running fakegir.py again?

ilya-zlobintsev commented 6 years ago

Wow thank you, that fixed the issue!

kastixx commented 6 years ago

No problem! Switch back to master please, I've merged that patch.