Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 436736 - sys-apps/elfix: revdep-pax fails with UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 24: ordinal not in range(128) when an utf-8 locale is set
Summary: sys-apps/elfix: revdep-pax fails with UnicodeDecodeError: 'ascii' codec can't...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: All Linux
: Normal critical (vote)
Assignee: Anthony Basile
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-01 00:34 UTC by Francisco Blas Izquierdo Riera
Modified: 2012-12-29 22:38 UTC (History)
0 users

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


Attachments
fix unicode decode for any file system encoding (fix-unicode-decode.patch,622 bytes, text/plain)
2012-10-01 08:48 UTC, Anthony Basile
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Francisco Blas Izquierdo Riera gentoo-dev 2012-10-01 00:34:18 UTC
revdep-pax tries to interpret non ascii data during execution returned by ldd when a non ascii locale is set. This can be fixed by setting a propper environment before calling ldd (i.e. LC_ALL=C ) to ensure all the messages will be written with the C locale (which seems to be ascii).

Reproducible: Always

Steps to Reproduce:
1. Set LANG to an utf-8 locale (for example LANG=es_ES.UTF-8)
2. Run revdep-pax

Actual Results:  
Traceback (most recent call last):
  File "/usr/sbin/revdep-pax", line 489, in <module>
    main()
  File "/usr/sbin/revdep-pax", line 483, in main
    run_soname(soname, verbose, True, mark, allyes, executable_only)
  File "/usr/sbin/revdep-pax", line 313, in run_soname
    ( forward_linkings, so2library_mappings ) = get_forward_linkings()
  File "/usr/sbin/revdep-pax", line 60, in get_forward_linkings
    ( linkings, mappings ) = get_ldd_linkings(binary)
  File "/usr/sbin/revdep-pax", line 21, in get_ldd_linkings
    ldd_lines = ldd_output.stdout.read().decode().split('\n')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 24: ordinal not in range(128)


Expected Results:  
Normal execution of the program.
Comment 1 Anthony Basile gentoo-dev 2012-10-01 08:48:21 UTC
Created attachment 325452 [details]
fix unicode decode for any file system encoding

Can you test this patch for the following combo:

1) UTF-8 and non-UTF-8

2) python 3.2 or 3.1 and python 2.7
Comment 2 Anthony Basile gentoo-dev 2012-12-29 22:38:54 UTC
The new revdep-pax does not use ldd.  Rather it obtains the NEEDED values from portage and then contructs the entire linkage map.