Skip to content

Pack with algorithm path that contains '..' fails to load #1866

@xoriath

Description

@xoriath

We (Microchip) have packs that contains paths that are relative and backing up, due to our structure;

<algorithm name="PIC32CK-SG00/../keil/Flash/PIC32CK_SG_BFM.FLM"
                       start="0x8000000"
                       size="0x20000"
                       RAMstart="0x20000000"
                       RAMsize="0x8000"
                       default="1"
                       style="Keil"/>

This fails to load in pyOCD as it tries to directly open PIC32CK-SG00/../keil/Flash/PIC32CK_SG_BFM.FLM with the zipfile module; and the zipfile module only resolves paths that are actually in the zip dictionary.

Fix is simple enough; normalize the path when reading out the loader.

Discovered when testing #1865 for @TeoMahnic

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