Hartmut,

Thanks for taking the time to step through and debug this. I appreciate the
time and effort you and others put into making Pyinstaller great!

Per a blame of hookutils.py, the get_module_file_attribute() function was
written my Martin, last modified
in 74f897b4e3cef291e3b3be5390167ce1754c4c5e. I don't particularly like that
approach, but used the code as-is, given some ominous comments: "In
PyInstaller process we cannot import directly analyzed modules." I'm
therefore happy with a rewrite. You might want to check with Martin also,
since this was his originally.

Bryan


On Sat, Feb 22, 2014 at 9:04 AM, Hartmut Goebel
<[email protected]>wrote:

>  Hi Bryan,
>
> I just stepped over a curious problem: While `import pygments.lexers`
> works fine, `hookutils.collect_submodules()` fails with an AtrributeError
> in /usr/lib/python2.7/site-packages/pygments/lexers/__init__.py.
>
> I tracked this down to hookutils.get_module_file_attribute() using
> `__import__('pygments.lexers', fromlist=_fromlist)` which fails (the real
> code is a bit different, but this does not matter).
>
> Why did you choose __import__ instead of using code like this (or even use
> the imptracker)?
>
> import sys, imp
> parts = package.split('.')
> path = sys.path
> for i, name in enumerate(parts):
>     print
>     print name, path
>     try:
>         m = imp.find_module(name, path)
>     except ImportError:
>         raise ImportError('xNo module named %s' % '.'.join(parts[:i+1]))
>     if m[-1][-1] == imp.PKG_DIRECTORY:
>         path = [m[1]]
>     else:
>         print 'result:', m[1]
>
>
> get_package_paths() then could be adopted, too.
>
>
> What do you think? Bryan: Are you willed implementing this? (Or should we
> wait until we switched to modulegraph?)
>
> --
>  Schönen Gruß
> Hartmut Goebel
>  Dipl.-Informatiker (univ), CISSP, CSSLP
> Information Security Management, Security Governance, Secure Software
> Development
>
> Goebel Consult, Landshut
> http://www.goebel-consult.de
>
> Blog:
> http://www.goebel-consult.de/blog/alternative-zu-small-business-server-in-der-ct
> Kolumne:
> http://www.cissp-gefluester.de/2012-04-compliance-bringt-keine-sicherheit
>
> Goebel Consult ist Mitglied bei http://www.7-it.de/
>



-- 
Bryan A. Jones, Ph.D.
Associate Professor
Department of Electrical and Computer Engineering
231 Simrall / PO Box 9571
Mississippi State University
Mississippi state, MS 39762
http://www.ece.msstate.edu/~bjones
bjones AT ece DOT msstate DOT edu
voice 662-325-3149
fax 662-325-2298

Our Master, Jesus Christ, is on his way. He'll show up right on
time, his arrival guaranteed by the Blessed and Undisputed Ruler,
High King, High God.
- 1 Tim. 6:14b-15 (The Message)

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to