{5} Assigned, Active Tickets by Owner (Full Description) (1 matches)

List tickets assigned, group by ticket owner. This report demonstrates the use of full-row display.

giovannibajo (1 match)

Ticket Summary Component Milestone Type Severity Created
Description
#9 Nameclashes in module information gathering PyInstaller PyInstaller 1.5 defect normal 03/12/07

All pyinstaller specific module attributes should be prefixed, to avoid nameclashes.

For instance, if you try to run pyinstaller on a module which has a 'imports' attribute, or on a package with an 'imports' module, you will get errors :

advene/pyinstaller> make python /home/aubert/src/pyinstaller-svn/Build.py advene.pyspec checking Analysis building Analysis because out0.toc non existent running Analysis out0.toc Analyzing: /home/aubert/src/pyinstaller-svn/support/_mountzlib.py Analyzing: /home/aubert/src/pyinstaller-svn/support/useUnicode.py Analyzing: /home/aubert/advene/advene/bin/advene Traceback (most recent call last):

    File "/home/aubert/src/pyinstaller-svn/Build.py", line 816, in ?

        build(sys.argv[1])

    File "/home/aubert/src/pyinstaller-svn/Build.py", line 62, in build

        exec open(spec, 'r').read()+'\n'

    File "<string>", line 13, in ? File "/home/aubert/src/pyinstaller-svn/Build.py", line 98, in init

        self.postinit()

    File "/home/aubert/src/pyinstaller-svn/Build.py", line 80, in postinit

        self.assemble()

    File "/home/aubert/src/pyinstaller-svn/Build.py", line 168, in assemble

        analyzer.analyze_script(script)

    File "/home/aubert/src/pyinstaller-svn/mf.py", line 379, in analyze_script

        return self.analyze_r('main')

    File "/home/aubert/src/pyinstaller-svn/mf.py", line 297, in analyze_r

        for name, isdelayed, isconditional in mod.imports: TypeError?: iteration over non-sequence make: *** [all] Error 1

The best way to avoid this would be to add a pysinstaller-specific prefix to attributes added to modules, for instance :

mod._pyinstaller_imports

Below is a patch against rec. 307 of the svn repository.

------------------------------------
Index: hooks/hook-PIL.SpiderImagePlugin.py
===================================================================
--- hooks/hook-PIL.SpiderImagePlugin.py	(revision 307)
+++ hooks/hook-PIL.SpiderImagePlugin.py	(working copy)
@@ -21,8 +21,8 @@
 # are really using ImageTk in their application, they will also import it
 # directly.
 def hook(mod):
-    for i in range(len(mod.imports)):
-        if mod.imports[i][0] == "ImageTk":
-            del mod.imports[i]
+    for i in range(len(mod._pyinstaller_imports)):
+        if mod._pyinstaller_imports[i][0] == "ImageTk":
+            del mod._pyinstaller_imports[i]
             break
     return mod
Index: hooks/hook-iu.py
===================================================================
--- hooks/hook-iu.py	(revision 307)
+++ hooks/hook-iu.py	(working copy)
@@ -28,12 +28,12 @@
         removes = ['nt', 'os2', 'mac', 'win32api']
     elif 'mac' in names:
         removes = ['nt', 'dos', 'os2', 'win32api']
-    for i in range(len(mod.imports)-1, -1, -1):
-        nm = mod.imports[i][0]
+    for i in range(len(mod._pyinstaller_imports)-1, -1, -1):
+        nm = mod._pyinstaller_imports[i][0]
         pos = string.find(nm, '.')
         if pos > -1:
             nm = nm[:pos]
         if nm in removes:
-            del mod.imports[i]
+            del mod._pyinstaller_imports[i]
     return mod
 
Index: hooks/hook-os.py
===================================================================
--- hooks/hook-os.py	(revision 307)
+++ hooks/hook-os.py	(working copy)
@@ -33,12 +33,12 @@
     elif 'mac' in names:
         removes = ['nt', 'ntpath', 'dos', 'dospath', 'os2', 'win32api', 'ce',
                    'riscos', 'riscospath', 'riscosenviron',]
-    for i in range(len(mod.imports)-1, -1, -1):
-        nm = mod.imports[i][0]
+    for i in range(len(mod._pyinstaller_imports)-1, -1, -1):
+        nm = mod._pyinstaller_imports[i][0]
         pos = string.find(nm, '.')
         if pos > -1:
             nm = nm[:pos]
         if nm in removes :
-            del mod.imports[i]
+            del mod._pyinstaller_imports[i]
     return mod
 
Index: hooks/hook-carchive.py
===================================================================
--- hooks/hook-carchive.py	(revision 307)
+++ hooks/hook-carchive.py	(working copy)
@@ -18,8 +18,8 @@
 
 def hook(mod):
     if sys.version[0] > '1':
-        for i in range(len(mod.imports)-1, -1, -1):
-            if mod.imports[i][0] == 'strop':
-                del mod.imports[i]
+        for i in range(len(mod._pyinstaller_imports)-1, -1, -1):
+            if mod._pyinstaller_imports[i][0] == 'strop':
+                del mod._pyinstaller_imports[i]
     return mod
 
Index: mf.py
===================================================================
--- mf.py	(revision 307)
+++ mf.py	(working copy)
@@ -258,7 +258,7 @@
     # really the equivalent of builtin import
     def __init__(self, xpath=None, hookspath=None, excludes=None):
         self.path = []
-        self.warnings = {}
+        self._pyinstaller_warnings = {}
         if xpath:
             self.path = xpath
         self.path.extend(sys.path)
@@ -296,7 +296,7 @@
                 mod = self.modules[nm]
                 if mod:
                     mod.xref(importer)
-                    for name, isdelayed, isconditional in mod.imports:
+                    for name, isdelayed, isconditional in mod._pyinstaller_imports:
                         imptyp = isdelayed * 2 + isconditional
                         newnms = self.analyze_one(name, nm, imptyp)
                         newnms = map(None, newnms, [nm]*len(newnms))
@@ -345,14 +345,14 @@
                 break
         # now nms is the list of modules that went into sys.modules
         # just as result of the structure of the name being imported
-        # however, each mod has been scanned and that list is in mod.imports
+        # however, each mod has been scanned and that list is in mod._pyinstaller_imports
         if i<len(nmparts):
             if ctx:
                 if hasattr(self.modules[ctx], nmparts[i]):
                     return nms
                 if not self.ispackage(ctx):
                     return nms
-            self.warnings["W: no module named %s (%s import by %s)" % (fqname, imptyps[imptyp], importernm or "__main__")] = 1
+            self._pyinstaller_warnings["W: no module named %s (%s import by %s)" % (fqname, imptyps[imptyp], importernm or "__main__")] = 1
             if self.modules.has_key(fqname):
                 del self.modules[fqname]
             return nms
@@ -366,7 +366,7 @@
                     if mod:
                         nms.append(mod.__name__)
                     else:
-                        bottommod.warnings.append("W: name %s not found" % nm)
+                        bottommod._pyinstaller_warnings.append("W: name %s not found" % nm)
         return nms
 
     def analyze_script(self, fnm):
@@ -421,7 +421,7 @@
                     mod = hook.hook(mod)
                 if hasattr(hook, 'hiddenimports'):
                     for impnm in hook.hiddenimports:
-                        mod.imports.append((impnm, 0, 0))
+                        mod._pyinstaller_imports.append((impnm, 0, 0))
                 if hasattr(hook, 'attrs'):
                     for attr, val in hook.attrs:
                         setattr(mod, attr, val)
@@ -433,10 +433,10 @@
             self.modules[fqname] = None
         return mod
     def getwarnings(self):
-        warnings = self.warnings.keys()
+        warnings = self._pyinstaller_warnings.keys()
         for nm,mod in self.modules.items():
             if mod:
-                for w in mod.warnings:
+                for w in mod._pyinstaller_warnings:
                     warnings.append(w+' - %s (%s)' % (mod.__name__, mod.__file__))
         return warnings
     def getxref(self):
@@ -460,8 +460,8 @@
     def __init__(self, nm):
         self.__name__ = nm
         self._all = []
-        self.imports = []
-        self.warnings = []
+        self._pyinstaller_imports = []
+        self._pyinstaller_warnings = []
         self._xref = {}
     def ispackage(self):
         return self._ispkg
@@ -494,7 +494,7 @@
                 self.__file__ = self.__file__ + 'o'
         self.scancode()
     def scancode(self):
-        self.imports, self.warnings, allnms = scan_code(self.co)
+        self._pyinstaller_imports, self._pyinstaller_warnings, allnms = scan_code(self.co)
         if allnms:
             self._all = allnms
 

Note: See TracReports for help on using and creating reports.