public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Samuli Suominen <ssuominen@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] [fyi] lddtree magic
Date: Tue, 09 Apr 2013 23:45:36 +0300	[thread overview]
Message-ID: <51647DF0.206@gentoo.org> (raw)
In-Reply-To: <51647CF7.10907@gentoo.org>

On 09/04/13 23:41, Samuli Suominen wrote:
> 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 <module>
>      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=

$ LC_ALL=C lddtree -l /bin/bash
Traceback (most recent call last):
   File "/usr/bin/lddtree", line 450, in <module>
     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/encodings/ascii.py", line 26, in decode
     return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0x83 in position 25: 
ordinal not in range(128)



  reply	other threads:[~2013-04-09 20:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-09 19:31 [gentoo-dev] [fyi] lddtree magic Mike Frysinger
2013-04-09 20:30 ` Diego Elio Pettenò
2013-04-10  3:10   ` Mike Frysinger
2013-04-10 10:04     ` Fabio Erculiani
2013-04-10 16:33       ` Mike Frysinger
2013-04-10 16:42         ` Fabio Erculiani
2013-04-10 17:32           ` Mike Frysinger
2013-04-10 17:40             ` Fabio Erculiani
2013-04-10 17:56               ` Mike Frysinger
2013-04-09 20:41 ` Samuli Suominen
2013-04-09 20:45   ` Samuli Suominen [this message]
2013-04-10  2:30     ` Mike Frysinger
2013-04-09 22:22 ` Samuli Suominen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51647DF0.206@gentoo.org \
    --to=ssuominen@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox