#32 Crash if sys.path contains an empty string

open
nobody
None
5
2012-11-25
2012-07-19
Anonymous
No

If sys.path contains an empty string, the program will crash in cx_Freeze 4.3.
To fix this bug you should:
-add in file finder.py, method _FindModule() of class ModuleFinder() after 'for location in path:' (line 140)
if not location:
continue
And replace in file freezer.py, method _GetDependentFiles() of class Freeze():
os.pathsep.join(sys.path)
by
os.pathsep.join([p for p in sys.path if p is not None])

Here are the diffs:
-file finder.py:
140a141,142

           if not location:
               continue

-file freezer.py:
228c228
< os.pathsep.join(sys.path)


                   os.pathsep.join([p for p in sys.path if p is not None])

A. Daouzli

Discussion

  • How do you get a "None" in sys.path? I'd like an example I can use for testing purposes. Can you provide such? Thanks.

     
  • I also tried cx_Freeze with an empty string in the path -- no issues that I could see. I need a bit more information.

     


Anonymous


Cancel   Add attachments