From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 88C161381F3 for ; Tue, 9 Apr 2013 20:41:42 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C3C6BE0B11; Tue, 9 Apr 2013 20:41:39 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D6BE2E0AEB for ; Tue, 9 Apr 2013 20:41:38 +0000 (UTC) Received: from [10.169.125.204] (85-76-20-153-nat.elisa-mobile.fi [85.76.20.153]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: ssuominen) by smtp.gentoo.org (Postfix) with ESMTPSA id 89E0133DC53 for ; Tue, 9 Apr 2013 20:41:37 +0000 (UTC) Message-ID: <51647CF7.10907@gentoo.org> Date: Tue, 09 Apr 2013 23:41:27 +0300 From: Samuli Suominen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130407 Thunderbird/17.0.5 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] [fyi] lddtree magic References: <201304091531.06078.vapier@gentoo.org> In-Reply-To: <201304091531.06078.vapier@gentoo.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Archives-Salt: a9a5e840-e8c5-413b-bd88-9c440f336696 X-Archives-Hash: 991b8b6315bdcd48b739fb85c1639d24 On 09/04/13 22:31, Mike Frysinger wrote: > i doubt few people have noticed, but i've rewritten lddtree recently in > python. i did for speed, for fun, and to add a lot more functionality that > would have driven the bash code base to new perverse levels. > > i've randomly stumbled across places in our code base (beyond ebuilds) where > the new python version would be useful. rather than try and ferret out those > myself, i'll just announce here and people can sort it out. > > if you guys think this can satisfy most of your needs but there's like a small > edge case that isn't quite handled, let me know. i can always add another > option :). > > specifically, lddtree (both the shell & python variants) support a --list: > $ lddtree -l /bin/bash $ qfile -v /usr/bin/lddtree app-misc/pax-utils-0.6 (/usr/bin/lddtree) $ python --version Python 3.2.3 $ lddtree -l /bin/bash Traceback (most recent call last): File "/usr/bin/lddtree", line 450, in sys.exit(main(sys.argv)) File "/usr/bin/lddtree", line 437, in main elf = ParseELF(path, options.root, ldpaths) File "/usr/bin/lddtree", line 235, in ParseELF elf = ELFFile(f) File "/usr/lib64/python3.2/site-packages/elftools/elf/elffile.py", line 47, in __init__ self._identify_file() File "/usr/lib64/python3.2/site-packages/elftools/elf/elffile.py", line 177, in _identify_file magic = self.stream.read(4) File "/usr/lib64/python3.2/codecs.py", line 300, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0x83 in position 25: invalid start byte $ locale LANG=en_US.UTF-8 LC_CTYPE=fi_FI.UTF-8 LC_NUMERIC="en_US.UTF-8" LC_TIME=en_GB.UTF-8 LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL= - Samuli