FreeCAD crash with empty PATH on windows

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
lorenznl
Posts: 6
Joined: Wed Feb 19, 2014 9:00 am

FreeCAD crash with empty PATH on windows

Post by lorenznl »

Hi,

is FreeCAD supposed to run properly with an empty PATH variable?
  • OS: Windows 7
    Platform: 64-bit
    Version: 0.14.2778 (Git)
    Branch: master
    Hash: 0506a918b24e015ac6277a7cf613ce151e1dee44
    Python version: 2.6.4
    Qt version: 4.5.3
    Coin version: 2.4.5a
    SoQt version: 1.4.1
    OCC version: 6.3.0
running FreeCAD from a command prompt and clearing the path with "path ;" or "set PATH=" nets me the following error dialog
  • ---------------------------
    Initialization of FreeCAD failed
    ---------------------------
    While initializing FreeCAD the following exception occurred: '('PATH',)'

    Python is searching for its files in the following directories:
    c:\Program Files\FreeCAD_0.14.2778_x64\bin\python26.zip;.\DLLs;.\lib;.\lib\plat-win;.\lib\lib-tk;c:\Program Files\FreeCAD_0.14.2778_x64\bin

    Python version information:
    2.6.4 (r264:75706, Mar 10 2010, 13:07:26) [MSC v.1500 64 bit (AMD64)]

    Please contact the application's support team for more information.
while any one character - not neccessaryly representing a regular or existing path - results in FreeCAD starting without problems
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: FreeCAD crash with empty PATH on windows

Post by wmayer »

is FreeCAD supposed to run properly with an empty PATH variable?
Apparently not. But setting

Code: Select all

set PATH=.
works. I think the reason for the failure is not that the DLLs are not find but a malfunction of Python.
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: FreeCAD crash with empty PATH on windows

Post by wmayer »

OK, Python failed inside out init script which tried to access the 'PATH' environment from Python. If you empty the PATH before this key doesn't exist and raises a KeyError. This is now handled properly in git show c565cf0
Post Reply