Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Umlauts #12

Open
Fetzii opened this issue Jan 28, 2022 · 2 comments
Open

Umlauts #12

Fetzii opened this issue Jan 28, 2022 · 2 comments

Comments

@Fetzii
Copy link

Fetzii commented Jan 28, 2022

  • spikex version: 0.5.2
  • Python version: 3.9.7
  • Operating System: Windows 10

Description

Getting categories for a page with umlauts from my dewiki_core (Cem Özdemir: https://de.wikipedia.org/wiki/Cem_%C3%96zdemir)
It crashes, what shouldn't happen. There is also an english wiki page for him (https://en.wikipedia.org/wiki/Cem_%C3%96zdemir)

What I Did

from spikex.wikigraph import load as wg_load
wg = wg_load("dewiki_core")
page = "Cem_Özdemir"
categories = wg.get_categories(page, distance=1)
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'
@paoloq
Copy link
Contributor

paoloq commented Jan 28, 2022

Thank you, @Fetzii!
I'll investigate this issue, but it could be related to some bad handled encoding.
I keep you posted on what I'll find.

@Fetzii
Copy link
Author

Fetzii commented Feb 8, 2022

It seems to me, that I have managed to fix the problem locally by changing line 234 in dumptools.py from:
line = line.decode("latin1") to: line = line.decode(encoding="utf-8", errors="backslashreplace")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants