You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ComponentBuilder.make_for_file() raises FileExistsError instead of FileNotFoundError when file does not exist #1076
bugSomething isn't workingcontribContributed features not part of the core library.good first issueGood for newcomershelp wantedExtra attention is needed
ComponentBuilder.make_for_file() raises FileExistsError instead of FileNotFoundError when the supplied file path does not exist, so callers catching FileNotFoundError for a missing file get an uncaught FileExistsError.
Environment:
cyclonedx-python-lib: 11.12.0 (v11.12.0) and main (3d62bf6723)
OS / Python: Linux, Python 3
Steps to reproduce:
Install cyclonedx-python-lib 11.12.0.
With /tmp/requests-2.32.3-py3-none-any.whl absent, run:
FileExistsError("Supplied file path '/tmp/requests-2.32.3-py3-none-any.whl' does not exist")
Expected output: FileNotFoundError("Supplied file path '/tmp/requests-2.32.3-py3-none-any.whl' does not exist"), matching Python's standard missing-file exception and open() in _file_sha1sum().
In cyclonedx/contrib/component/builders.py lines 48-49, if not exists(absolute_file_path): raises FileExistsError instead of FileNotFoundError.
changed the title [-]ComponentBuilder.make_for_file() raises FileExistsError instead of FileNotFoundError when file does not exist[/-][+]`ComponentBuilder.make_for_file()` raises `FileExistsError` instead of `FileNotFoundError` when file does not exist[/+]on Nov 26, 2026
bugSomething isn't workingcontribContributed features not part of the core library.good first issueGood for newcomershelp wantedExtra attention is needed
Activity
jkowalleck commentedon Nov 25, 2026
caused by
cyclonedx-python-lib/cyclonedx/contrib/component/builders.py
Line 49 in 76f51d0
a fix would not be a breaking change, as it is in the "contrib" area of the library.
this one is ready to be worked on.
CycloneDX Python library is a community effort - feel free to contribute to fix.
[-]ComponentBuilder.make_for_file() raises FileExistsError instead of FileNotFoundError when file does not exist[/-][+]`ComponentBuilder.make_for_file()` raises `FileExistsError` instead of `FileNotFoundError` when file does not exist[/+]jkowalleck commentedon Nov 30, 2026
fix released per https://github.com/CycloneDX/cyclonedx-python-lib/releases/tag/v11.14.0