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 if author name contains non ascii chars like "ó" in "Antón" #150

Closed
matutet opened this issue Jun 4, 2017 · 3 comments
Closed
Labels

Comments

@matutet
Copy link

matutet commented Jun 4, 2017

I trying to use gitinspector on my repositories. All of them have authors with non ascii chars in its names (we are spanish developers).

Traceback (most recent call last):
  File "/Users/matutet/wrkspc.others/gitinspector/gitinspector.py", line 24, in <module>
    gitinspector.main()
  File "/Users/matutet/wrkspc.others/gitinspector/gitinspector/gitinspector.py", line 206, in main
    run.process(repos)
  File "/Users/matutet/wrkspc.others/gitinspector/gitinspector/gitinspector.py", line 83, in process
    outputable.output(ChangesOutput(summed_changes))
  File "/Users/matutet/wrkspc.others/gitinspector/gitinspector/output/outputable.py", line 43, in output
    outputable.output_text()
  File "/Users/matutet/wrkspc.others/gitinspector/gitinspector/output/changesoutput.py", line 151, in output_text
    print(terminal.ljust(i, 20)[0:20 - terminal.get_excess_column_count(i)], end=" ")
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 9: ordinal not in range(128)

I am using MacOS. Not tested on other operating systems.

@adam-waldenberg
Copy link
Member

Hi @matutet. Gitinspector is behaving correctly. If you read traceback you can see that your terminal encoding is set to ascii - as such, it won't be able to display those international unicode characters in your terminal. This has been discussed several times before. See for example issues #122 and #9 for information on how to fix it. You can also redirect to a text file to get rid of the problem.

@matutet
Copy link
Author

matutet commented Jun 4, 2017

You're right. I was missing some locale vars. Now, after fixing it, is working

$ locale
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL="en_US.UTF-8"

Thanks for your quick answer.
+1 for gitinspector :-)

@adam-waldenberg
Copy link
Member

@matutet Good to hear. Enjoy gitinspector :).

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

No branches or pull requests

2 participants