Issues

Issue #97 open

copying file /.dbfseventsd when set 'qt_plugins' to 'imageformats'

Anonymous created an issue

Comments (7)

  1. ax003d

    Change code py2app/recipes/pyside.py:21

            if '*' in item:
                for path in glob.glob(os.path.join(plugin_dir, item)):
                    resources.append((os.path.dirname('qt_plugins' + path[len(plugin_dir):]), [path]))
                else:
                    resources.append((os.path.dirname(os.path.join('qt_plugins', item)), os.path.join(plugin_dir, item)))
    

    to

            if '*' in item:
                for path in glob.glob(os.path.join(plugin_dir, item)):
                    resources.append((os.path.dirname('qt_plugins' + path[len(plugin_dir):]), [path]))
            else:
                resources.append((os.path.dirname(os.path.join('qt_plugins', item)), os.path.join(plugin_dir, item)))
    

    can resolve this problem.

    The code indent problem will cause py2app add a resource:

    ('qt_plugins/imageformats', u'/Developer/Applications/Qt/plugins/imageformats/*') # note that the second item of the tuple should be a list, but it's a string here
    

    And then in py2app/build_app.py:598

        def iter_data_files(self):
            dist = self.distribution
            allres = chain(getattr(dist, 'data_files', ()) or (), self.resources)
            for (path, files) in (normalize_data_file(fn) for fn in allres):
                path = fsencoding(path)
                for fn in files:                      # <-- this line
                    fn = fsencoding(fn)
                    yield fn, os.path.join(path, os.path.basename(fn))
    

    files should be a list, but now, it's a string: u'/Developer/Applications/Qt/plugins/imageformats/*' This will cause py2app to copy files in path: '/', 'D', 'e', 'v', ... So py2app begin to iterate root path '/', when it encouter /.dbfseventsd, it crashed.

  2. Tobias Röttger

    Hello,

    please note that this issue is not fixed yet: The applied fix did not include the change of indentation for the else-part, as shown in the code-snippet above, which leads to an error while executing py2app. Having corrected its indentation, py2app succeeds.

    Kind regards, Tobias

  3. Simon Wiles

    what is the status of this issue? i seem to be having issues including the qsvg plugin using py2app because of a problem with this piece of code, but simply fixing the indentation issue hasn't solved my problem. in the section of code from py2app/build_app.py (which is at line 711 in py2app 0.8), files is a list of filepaths for my resources (as strings) and tuples of my qt_plugins, so setup.py fails calling os.path.basename on the tuples ("AttributeError: 'tuple' object has no attribute 'rfind'").

  4. Log in to comment