Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 709610 - app-portage/gentoolkit-0.4.7 revdep-rebuild error
Summary: app-portage/gentoolkit-0.4.7 revdep-rebuild error
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2020-02-14 14:09 UTC by Andrea Postiglione
Modified: 2020-11-29 20:28 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrea Postiglione 2020-02-14 14:09:14 UTC
phoenix /home/custom # revdep-rebuild -i
 * This is the new python coded version
 * Please report any bugs found using it.
 * The original revdep-rebuild script is installed as revdep-rebuild.sh
 * Please file bugs at: https://bugs.gentoo.org/
 * Collecting system binaries and libraries
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.6/revdep-rebuild", line 40, in <module>
    success = rebuild.main(rebuild.parse_options())
  File "/usr/lib64/python3.6/site-packages/gentoolkit/revdep_rebuild/rebuild.py", line 152, in main
    assigned, orphaned = analyse(settings, logger, _libs_to_check=_libs_to_check)
  File "/usr/lib64/python3.6/site-packages/gentoolkit/revdep_rebuild/analyse.py", line 380, in analyse
    logger, searchbits)
  File "/usr/lib64/python3.6/site-packages/gentoolkit/revdep_rebuild/analyse.py", line 38, in scan_files
    libs_and_bins, cmd_max_args, logger)
  File "/usr/lib64/python3.6/site-packages/gentoolkit/revdep_rebuild/stuff.py", line 46, in scan
    ['scanelf'] + params + _files[i:i+max_args]).strip().split('\n')
  File "/usr/lib64/python3.6/site-packages/gentoolkit/revdep_rebuild/stuff.py", line 22, in call_program
    subp = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "/usr/lib64/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/usr/lib64/python3.6/subprocess.py", line 1295, in _execute_child
    restore_signals, start_new_session, preexec_fn)
UnicodeEncodeError: 'ascii' codec can't encode character '\xe8' in position 20: ordinal not in range(128)
Comment 1 Brian Evans (RETIRED) gentoo-dev 2020-02-14 14:17:01 UTC
(In reply to Andrea Postiglione from comment #0)
> phoenix /home/custom # revdep-rebuild -i
> UnicodeEncodeError: 'ascii' codec can't encode character '\xe8' in position
> 20: ordinal not in range(128)

You do not have a UTF-8 enabled locale selected.  Please correct this by setting one in 'eselect locale'.  If one is not available, then editing /etc/locale.gen and running locale-gen may be required.

In addition, do not set LC_ALL=C as this does not support UTF-8 either.
Comment 2 Andrea Postiglione 2020-02-14 14:22:19 UTC
phoenix /home/custom # eselect locale list 
Available targets for the LANG variable:
  [1]   C
  [2]   C.utf8
  [3]   POSIX
  [4]   it_IT
  [5]   it_IT.iso88591
  [6]   it_IT.utf8 *
  [ ]   (free form)
phoenix /home/custom # revdep-rebuild -i
 * This is the new python coded version
 * Please report any bugs found using it.
 * The original revdep-rebuild script is installed as revdep-rebuild.sh
 * Please file bugs at: https://bugs.gentoo.org/
 * Collecting system binaries and libraries
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.6/revdep-rebuild", line 40, in <module>
    success = rebuild.main(rebuild.parse_options())
  File "/usr/lib64/python3.6/site-packages/gentoolkit/revdep_rebuild/rebuild.py", line 152, in main
    assigned, orphaned = analyse(settings, logger, _libs_to_check=_libs_to_check)
  File "/usr/lib64/python3.6/site-packages/gentoolkit/revdep_rebuild/analyse.py", line 380, in analyse
    logger, searchbits)
  File "/usr/lib64/python3.6/site-packages/gentoolkit/revdep_rebuild/analyse.py", line 38, in scan_files
    libs_and_bins, cmd_max_args, logger)
  File "/usr/lib64/python3.6/site-packages/gentoolkit/revdep_rebuild/stuff.py", line 46, in scan
    ['scanelf'] + params + _files[i:i+max_args]).strip().split('\n')
  File "/usr/lib64/python3.6/site-packages/gentoolkit/revdep_rebuild/stuff.py", line 22, in call_program
    subp = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "/usr/lib64/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/usr/lib64/python3.6/subprocess.py", line 1295, in _execute_child
    restore_signals, start_new_session, preexec_fn)
UnicodeEncodeError: 'ascii' codec can't encode character '\xe8' in position 20: ordinal not in range(128)
Comment 3 Andrea Postiglione 2020-02-14 14:24:09 UTC
setting the locale does not change anything the error is always the same
Comment 4 Zac Medico gentoo-dev 2020-02-14 18:00:05 UTC
This is solvable by explicitly encoding the Popen args parameter as UTF-8 bytes.
Comment 5 Larry the Git Cow gentoo-dev 2020-02-14 18:13:12 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=c6d2400dccc2b5334bfab5f82f1a8bf1ab38f06c

commit c6d2400dccc2b5334bfab5f82f1a8bf1ab38f06c
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2020-02-14 18:04:53 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2020-02-14 18:09:43 +0000

    revdep-rebuild: encode Popen args as utf-8 bytes (bug 709610)
    
    Prevent this Popen exception:
    
    UnicodeEncodeError: 'ascii' codec can't encode character '\xe8' in position 20: ordinal not in range(128)
    
    Bug: https://bugs.gentoo.org/709610#c0
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 pym/gentoolkit/revdep_rebuild/stuff.py | 1 +
 1 file changed, 1 insertion(+)
Comment 6 Matt Turner gentoo-dev 2020-03-12 16:56:02 UTC
Released in v0.4.8.