eric ide

Message1133

Author: Qb
Recipients: Qb
Date: 2019-09-08.22:18:34
Content
Hi:

When I try to upgrade Eric 6 from 19.8 to 19.9 on my macos, this exception is raised:


Traceback (most recent call last):
  File "./install.py", line 2135, in <module>
    main(sys.argv)
  File "./install.py", line 2105, in main
    res = installEric()
  File "./install.py", line 1010, in installEric
    createMacAppBundle(cfg['ericDir'])
  File "./install.py", line 1226, in createMacAppBundle
    os.symlink(macPythonExe, starter)
FileNotFoundError: [Errno 2] No such file or directory: '/opt/local/Library/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python' -> '/Applications/eric6.app/Contents/MacOS/eric'


After debugging install.py, I have found a bug in line 1212 to 1214:


    for directory in directories:
        if not os.path.exists(directory):
            os.makedirs(directory)

This loop is checking the existence of the keys in dictionary `directories` instead of checking the paths (values) in this dictionary. 

I think that it should be:

    for directory in directories.values():
        if not os.path.exists(directory):
            os.makedirs(directory)

or: 

    for directory in directories:
        if not os.path.exists(directories[directory]):
            os.makedirs(directories[directory])

I have checked the first alternative (with `directories.values()`) and works on my system.

I hope this will be useful for you. Thanks.
History
Date User Action Args
2019-09-08 22:18:34Qbsetrecipients: + Qb
2019-09-08 22:18:34Qbsetmessageid: <1567981114.26.0.525161283508.issue304@eric-ide.python-projects.org>
2019-09-08 22:18:34Qblinkissue304 messages
2019-09-08 22:18:34Qbcreate