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 when running 'sudo pihole5-list-tool' #4

Closed
patrickisfrench opened this issue May 25, 2020 · 7 comments
Closed

error when running 'sudo pihole5-list-tool' #4

patrickisfrench opened this issue May 25, 2020 · 7 comments

Comments

@patrickisfrench
Copy link

Hello jessedp, I'm having an error appear when trying to run your tool. I'm using a raspberry pi 4 on the latest version of raspbian (buster). I followed the instruction in your post for installation which reported fine, then when trying to run the tool I get the following:

Traceback (most recent call last): File "/usr/local/bin/pihole5-list-tool", line 10, in <module> sys.exit(main()) File "/usr/local/lib/python3.7/dist-packages/ph5lt.py", line 82, in main print(color(' \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510', fg='#b61042')) UnicodeEncodeError: 'latin-1' codec can't encode characters in position 21-64: ordinal not in range(256)

Seen this before? I will admit I know nothing of programming, and am a basic linux user. I followed many guides to get pi-hole 5 up and running and any help you can offer on this issue would be awesome. Thank you very much!

@jessedp
Copy link
Owner

jessedp commented May 26, 2020

i have not seen that. My guess was that your terminal might be in a non-UTF8 character set and that was causing it, but trying to change it to latin-1 didn't break it. What is that, though. For example, mine is:

# sudo echo $LANG
en_US.UTF-8

I'll see if I can make that happen so I can come up with some fix.

@patrickisfrench
Copy link
Author

Hey jessedp, it looks like my $LANG is set to en_GB - great britain it seems. but I can change it to US UTF-8 if it allows me to install, how might I do that?

@patrickisfrench
Copy link
Author

I found the locale settings and adjusted it, then re-ran your tool. everything works now. thank you so much for the quick replies!

@jessedp
Copy link
Owner

jessedp commented May 26, 2020

Sweet. Would you mind posting what you did in case someone else runs into this?

@patrickisfrench
Copy link
Author

sure! I don't know the commands in terminal for what I did as I found it browsing around pixel (xwindows). I clicked on the Raspi menu > Preferences > Raspberry Pi Configuration > Localisation > Set Locale > changed country from GB (United Kingdom) to US (United States), and Character Set from ISO to UTF-8, saved, reboot the raspi, and re-ran the tool. Everything good now!

Reason I had it GB to begin with was I like the name "Wastebasket" better than "Trash" (US locale uses this name). I couldn't find a way to rename the Trash bin otherwise. Silly, I know, haha

@jessedp
Copy link
Owner

jessedp commented May 26, 2020

That's amazing, I love it. I'm pretty sure that all that mattered was the Character Set if you want to change the Country back.

@jessedp jessedp closed this as completed May 26, 2020
@jessedp jessedp mentioned this issue Jun 3, 2020
@MexSalem
Copy link

MexSalem commented Jun 3, 2020

Some helpful commands in terminal
Display current locale settings:
$ locale
Show available locales:
$ locale -a
If a locale does not appear in the list, it must be generated:
$ sudo locale-gen en_GB.UTF-8
A list of all available locales can be found in the following file:
$ cat /usr/share/i18n/SUPPORTED
Adjust Locales:
The default settings are stored in the file /etc/default/locale:

$ cat /etc/default/locale 
LANG=en_US.UTF-8

This file can either be adjusted manually or updated with the update-locale tool:
$ sudo update-locale LANG=en_GB.UTF-8
(Hint: update-locale also generates the file /etc/default/locale if it does not exist.)
Then reboot the system or open a new console.

UTF-8 encoding in terminal is required for pihole5-list-tool to show the red frame on startup..

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

3 participants