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

Error while writing output html #27

Open
malko opened this issue Aug 18, 2020 · 5 comments
Open

Error while writing output html #27

malko opened this issue Aug 18, 2020 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@malko
Copy link

malko commented Aug 18, 2020

on ubuntu 20.20 with a fresh geit install get this error while attempting generation:

Collecting and analyzing contribution data...
Collecting and generating commits and contribution matrices...
Writing HTML output...
Traceback (most recent call last):
  File "/usr/lib/python3.8/sre_parse.py", line 1039, in parse_template
    this = chr(ESCAPES[this][1])
KeyError: '\\u'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "geit.py", line 135, in <module>
    handle_cli()
  File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "geit.py", line 89, in handle_cli
    filename = write_html_output(json_physical_data, identifier)
  File "geit.py", line 117, in write_html_output
    updated_file = re.sub(r'<script tag="data-entry-tag">.*<\/script>',
  File "/usr/lib/python3.8/re.py", line 208, in sub
    return _compile(pattern, flags).sub(repl, string, count)
  File "/usr/lib/python3.8/re.py", line 325, in _subx
    template = _compile_repl(template, pattern)
  File "/usr/lib/python3.8/re.py", line 316, in _compile_repl
    return sre_parse.parse_template(repl, pattern)
  File "/usr/lib/python3.8/sre_parse.py", line 1042, in parse_template
    raise s.error('bad escape %s' % this, len(this))
re.error: bad escape \u at position 444928

pip version: pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)

@kelhaji
Copy link
Owner

kelhaji commented Aug 19, 2020

Hey @malko

I haven't been able to reproduce the error on a similar version of Ubuntu with a clean installation of Geit. It seems the error is caused by something going wrong with the regex, I have only seen this error before when trying to run it on Windows natively (currently not supported). When you ran Geit, did you use a publicly accessible repository? If so, could you share the link to it?

@kelhaji kelhaji self-assigned this Aug 19, 2020
@kelhaji kelhaji added the bug Something isn't working label Aug 19, 2020
@malko
Copy link
Author

malko commented Aug 19, 2020

No sorry it's on a private local repository. Can it be related to some content being in french with utf8 characters ?
Anyway thanks for the reply

@kelhaji
Copy link
Owner

kelhaji commented Aug 19, 2020

Hmm. Perhaps so, I tried to run it in a repository containing French sentences but it didn't yield an error. Do you get the same or similar error when running Geit on a different repository? Could you run echo $LANG and locale charmap separately in your terminal and paste the output here? It might be related to your terminal character encoding.

@malko
Copy link
Author

malko commented Aug 19, 2020

here's the result of commands:

ツ【malko@hslap:~】➤ echo $LANG
fr_FR.UTF-8
ツ【malko@hslap:~】➤ locale charmap
UTF-8

Will try on another repo later and let you know if the problem occur or not.

@malko
Copy link
Author

malko commented Aug 20, 2020

I've just ran it on another repository without error. Difference the repo was in english. Same machine / env and settings. So seems to be somewhat related to the content of the repo i'm trying to run geit against.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants