[Pythonmac-SIG] py2app testing modulegraph

engelbert gruber grubert at users.sourceforge.net
Wed Jul 21 10:24:38 CEST 2010


hi

modulegraph.py os_listdir hangs on none existing dirs (strange) ::

  def os_listdir(path):
    """
    os.listdir with support for zipfiles
    """
    try:
        return os.listdir(path)
    except os.error:
        info = sys.exc_info()

        rest = ''
        while not os.path.exists(path):
            path, r = os.path.split(path)
            rest = os.path.join(r, rest)

workaround ::

        rest = ''
        prev_rest = None
        while not os.path.exists(path) and prev_rest != rest:
            prev_rest = rest
            path, r = os.path.split(path)
            rest = os.path.join(r, rest)

is there a unittest function to verify endless loops ?

cheers


REPEATED message from correct list account:

i am trying to setup a modulegraph test that triggers missing import
for ifilter, imap

some hurdles

* i am not at a mac currently.

 a good thing, this results in cross platform tests

* altgraph must be installed because pkg_resource require does not
find it otherwise

 this is not so good, as i prefer not to install things but just
copy/symlink especially
 while developing

* modulegraph.util uses ::

   if sys.version_info[0] != 2:
       import re
       cookie_re = re.compile(b"coding[:=]\s*([-\w.]+)")

 it is correct, that this wont be executed for python versions 2.*,
 but it will be compiled and the syntax ``b"something"`` works
 only from 2.6 up

cheers


More information about the Pythonmac-SIG mailing list