Skip to content

Crashes if a package's description is not in English #88

@OneOfOne

Description

@OneOfOne

Description

If a package's name or description has unicode characters, aurman crashes.

Expected Behavior

Not Crash.

Current Behavior

Well, it crashes.

Possible Solution

in aurman/utilities.py line 99:

replace:
print("    {}".format(ret_dict['Description']))

with:
print("    {}".format(ret_dict['Description'].encode('utf-8')))

Steps to Reproduce

➤ aurman -Ss peek
aur/peek 1.3.1-1 (70, 5.963747)
Simple screen recorder with an easy to use interface
aur/cardpeek 0.8.4-1 (6, 0.456978)
A tool to read-only the contents of smartcards
aur/peek-git 1.3.1.r45.g22b9fe0-1 (5, 0.007787)
Simple screen recorder with an easy to use interface (latest development release)
aur/cardpeek-svn 206-1 (4, 0)
A tool to read the contents of smartcards
aur/diod-git 1.0.24.r11.g0ea3fe3-1 (0, 0)
A multi-threaded, user space file server that speeks 9P2000.L
aur/peekvc 0.1-1 (0, 0)
Dumps the the current state of a Linux virtual console
aur/poplines 2.1.1-2 (0, 0)
Tools to pop/peek lines from the head/tail or known position within a given file, and output to stdout. Makes files into queues!
aur/python-poplines 2.1.1-2 (0, 0)
Tools to pop/peek lines from the head/tail or known position within a given file, and output to stdout. Makes files into queues!
aur/python2-poplines 2.1.1-2 (0, 0)
Tools to pop/peek lines from the head/tail or known position within a given file, and output to stdout. Makes files into queues!
aur/readesm-fr 2.4-1 (0, 0)
2018-05-09 00:38:06,072 - main - main - ERROR - 
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/aurman/main.py", line 526, in main
    process(argv[1:])
  File "/usr/lib/python3.6/site-packages/aurman/main.py", line 225, in process
    search_and_print(search, installed_system, str(pacman_args), repo, aur)
  File "/usr/lib/python3.6/site-packages/aurman/utilities.py", line 99, in search_and_print
    print("    {}".format(ret_dict['Description']))
UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 94: ordinal not in range(128)

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem right

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions