Solved output net-im/toot -- what does it mean?

Hi,

I installed net-im/toot with pkg install py36-toot, a CLI program for the Mastodon social network. Some commands work fine, but several commands give the same feedback I don't know what to do with:

Code:
Traceback (most recent call last):
  File "/usr/local/bin/toot", line 11, in <module>
    load_entry_point('toot==0.19.0', 'console_scripts', 'toot')()
  File "/usr/local/lib/python3.6/site-packages/toot/console.py", line 387, in main
    run_command(app, user, command_name, args)
  File "/usr/local/lib/python3.6/site-packages/toot/console.py", line 363, in run_command
    return fn(app, user, parsed_args)
  File "/usr/local/lib/python3.6/site-packages/toot/commands.py", line 27, in timeline
    print_timeline(items)
  File "/usr/local/lib/python3.6/site-packages/toot/output.py", line 162, in print_timeline
    print_out("\u2500" * 31 + "\u252c" + "\u2500" * 88)
  File "/usr/local/lib/python3.6/site-packages/toot/output.py", line 56, in print_out
    print(*args, **kwargs)
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 0-119: ordinal not in range(256)

Could anybody enlighten me what happens here, and

how (if) I can resolve this?

TIA,
 
Try setting your locale(1).

Indeed, toot is a console application. Setting my locale(1) was also the suggestion of the maintainer of the toot-port on Mastodon, so

I changed my ~/.local_conf to UTF-8:
Code:
$ cat .login_conf
# see FreeBSD Handbook 22.2 Using Localization
#
# see login.conf(5)
#
me:\
     :charset=UTF-8:\
     :lang=nl_NL.UTF-8:

# me:\
#     :charset=ISO-8859-1:\
#     :lang=nl_NL.ISO8859-1:

After logging out and in again, and also after a reboot $ locale just gives '8859-1 settings' all over the place and no UTF-8. I checked all system wide settings following the Handbook 22.2 -- found nothing disturbing, but also no solution. My .profile, .shrc and .cshrc (I only use the sh shell) don't have any settings on localization, and /etc/login.conf only has an uncommented setting for UTF-8 for Russian users.

But maybe I'm overseeing something...
 
My .profile, .shrc and .cshrc (I only use the sh shell) don't have any settings on localization
I find those easier to use for setting the locale(1).
For the csh(1) you can use something like this:
Code:
setenv LANG nl_NL.UTF-8
For the Bourne type shells use:
Code:
export LANG=nl_NL.UTF-8

You can use login.conf and associated files but they require using cap_mkdb(1) before the settings are actually applied.

You can use either one, the effect is the same for both.
 
I changed my ~/.login_conf but to no avail.

$ export LANG=nl_NL.UTF-8 worked for the active session, but was gone after logout.

Also added UTF-8 for all Dutch users in /etc/login.conf including # cap_mkdb /etc/login.conf, but that didn't work either, probably because I wasn't able to add 'Dutch' to my own login profile -- question below!

Finally the Shell Startup File Method (Handbook 22.2.1.2.) made my 'UTF-8' settings sticky.

This makes that my original problem is SOLVED. However, the question remains where I can set a language to an existing account, as 22.2 in the Handbook only mentions new accounts...
 
You set it in the shell config file for your preferred shell. If using /bin/sh then you'd add it to .profile or .shrc. No idea where you came up with the idea to use .login_conf. I don't have that file on any of my FreeBSD or Linux systems. :)

When in doubt, read the man page for your shell: sh(1) Particularly the Invocation section, to see which files are loaded at login, and in which order.
 
No idea where you came up with the idea to use .login_conf.

I found it in the Handbook, 22.2.1 -- https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/using-localization.html Since it is presented as the recommended method, I implemented it and until now didn't try the 'shell startup file method' from the handbook. I'd like to have 'as global as possible' settings I thought the .login_conf was best.

Up til now I didn't give much attention to it because a non-working localization didn't frustrate my work, until I wanted toot to work properly without annoying messages.
 
My final remarks are that I got back to the ISO8859-15 settings, but this time with a proper setup.

Having UTF-8 in my ~/.profile causes especially mutt to display a complete mess in console: missing the top bar, blank lines between following numbers in list view, jumping text all over the place. Besides, toot displays multiple rows of '@' between messages instead of the '-' I used to have, in regular timeline as well as in toot curses.

Anyhow, I learned a lot from this configuring my FreeBSD box, Thanks to all!
 
Back
Top