Skip to content

[Bug]: ET.parse(orbit_path) FileNotFoundError #42

@yunjunz

Description

@yunjunz

Checked for duplicates

Yes - I've already checked. Found by Ozzy Tirmizi.

Describe the bug

>>> bursts = s1reader.load_bursts(zip_path, orbit_path, swath_num=2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/yunjunz/tools/s1-reader/src/s1reader/s1_reader.py", line 476, in load_bursts
    bursts = _burst_from_zip(path, id_str, orbit_path)
  File "/Users/yunjunz/tools/s1-reader/src/s1reader/s1_reader.py", line 536, in _burst_from_zip
    bursts = burst_from_xml(f_annotation, orbit_path, f_tiff, iw2_f_annotation, z_file.open)
  File "/Users/yunjunz/tools/s1-reader/src/s1reader/s1_reader.py", line 339, in burst_from_xml
    orbit_tree = ET.parse(orbit_path)
  File "/Users/yunjunz/tools/miniconda3/envs/opera/lib/python3.10/xml/etree/ElementTree.py", line 1229, in parse
    tree.parse(source, parser)
  File "/Users/yunjunz/tools/miniconda3/envs/opera/lib/python3.10/xml/etree/ElementTree.py", line 569, in parse
    source = open(source, "rb")
FileNotFoundError: [Errno 2] No such file or directory: ''
>>> 

What did you expect?

I expected [...]

Reproducible steps

import s1reader
zip_file = './SLC/S1A_IW_SLC__1SSV_20160829T230628_20160829T230655_012821_014394_A1F0.zip'
orbit_dir = './orbits'
orbit_path = s1reader.get_orbit_file_from_dir(zip_path, orbit_dir)
bursts = s1reader.load_bursts(zip_path, orbit_path, swath_num=2)

Environment

- Version of this software [e.g. vX.Y.Z]
- Operating System: [e.g. MacOSX with Docker Desktop vX.Y]
...

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