Skip to content

Creation of rayleigh lut directory fails when symlink is present in path #266

@mraspaud

Description

@mraspaud

When the rayleigh luts are already downloaded and provided in a path containing a symlink, pyspectral crashes.

For example, if rayleigh_dir in the configuration is "/.local/share/pyspectral/rayleigh_only" and "pyspectral" is a symlink, the following error ensues:

  File "/opt/conda/lib/python3.13/site-packages/pyspectral/config.py", line 73, in get_config
    os.makedirs(config['rayleigh_dir'], exist_ok=True)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen os>", line 228, in makedirs
FileExistsError: [Errno 17] File exists: '/.local/share/pyspectral/'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions