Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 530064 - app-portage/layman-2.2.0-r5: crashes with UnicodeDecodeError exception
Summary: app-portage/layman-2.2.0-r5: crashes with UnicodeDecodeError exception
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2014-11-21 19:18 UTC by Sebastian Pipping
Modified: 2015-03-24 17:28 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Script to nail it down (test_layman_locale_crash.sh,349 bytes, application/x-shellscript)
2014-12-04 20:34 UTC, Sebastian Pipping
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Pipping gentoo-dev 2014-11-21 19:18:21 UTC
# layman -i mv

Traceback (most recent call last):
  File "/usr/lib/python-exec/python2.7/layman", line 45, in <module>
    main()
  File "/usr/lib64/python2.7/site-packages/layman/cli.py", line 197, in __call__
    result += getattr(self, action[1])()
  File "/usr/lib64/python2.7/site-packages/layman/cli.py", line 355, in Info
    list_printer.print_shortdict(info, complain=_complain)
  File "/usr/lib64/python2.7/site-packages/layman/cli.py", line 63, in print_shortdict
    self.print_overlay(summary, supported, official, complain)
  File "/usr/lib64/python2.7/site-packages/layman/cli.py", line 95, in print_overlay
    self.output.warn(summary, 1)
  File "/usr/lib64/python2.7/site-packages/layman/output.py", line 203, in warn
    for i in warn.split('\n'):
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 192: ordinal not in range(128)
Comment 1 Devan Franchini (RETIRED) gentoo-dev 2014-12-04 20:08:43 UTC
Can I see which locale you have it set to? It works for me when it's utf-8 but I want to try to reproduce so I can tackle it.
Comment 2 Devan Franchini (RETIRED) gentoo-dev 2014-12-04 20:11:46 UTC
Never mind that, I can reproduce.
Comment 3 Sebastian Pipping gentoo-dev 2014-12-04 20:34:22 UTC
Created attachment 390956 [details]
Script to nail it down

(In reply to Devan Franchini from comment #1)
> Can I see which locale you have it set to? It works for me when it's utf-8
> but I want to try to reproduce so I can tackle it.

# bash ~/Desktop/test_layman_locale_crash.sh 
Testing LC_ADDRESS...
Testing LC_COLLATE...
Testing LC_CTYPE...
  LC_CTYPE=C fixed it, so LC_CTYPE="en_US.UTF-8" is at fault
Testing LC_IDENTIFICATION...
Testing LC_MEASUREMENT...
Testing LC_MESSAGES...
Testing LC_MONETARY...
Testing LC_NAME...
Testing LC_NUMERIC...
Testing LC_PAPER...
Testing LC_TELEPHONE...
Testing LC_TIME...
Comment 4 Devan Franchini (RETIRED) gentoo-dev 2014-12-04 23:39:36 UTC
I figured out what the issue was and I was able to successfully fix it by making layman indiscriminately encode all messages from layman's output class. It's in layman's master branch, and you should expect to see a new layman release somewhat soonish.

Until then feel free to test out the 9999 ebuild.
Comment 5 Sebastian Pipping gentoo-dev 2014-12-05 00:25:27 UTC
I can confirm that the master branch does not crash on

  # PYTHONPATH=. ./bin/layman -i mv
  [..]

Good work!