Skip to content

fix: normalize temp paths for cross-platform support#62

Open
AlwinXue wants to merge 1 commit intoOSIPI:mainfrom
AlwinXue:alwin/fix-issue-37
Open

fix: normalize temp paths for cross-platform support#62
AlwinXue wants to merge 1 commit intoOSIPI:mainfrom
AlwinXue:alwin/fix-issue-37

Conversation

@AlwinXue
Copy link
Copy Markdown

@AlwinXue AlwinXue commented Mar 31, 2026

Hi mentors! 👋

This PR addresses the hardcoded /tmp path issue reported in Issue #37.

The Problem:
The package configuration and DICOM converter assumed Unix-style /tmp/... paths, which breaks on Windows and makes temp file handling less portable in general.

The Solution:
Runtime Path Normalization: Added a small normalization step in the config loader that rewrites legacy /tmp/... entries to the current platform temp directory via tempfile.gettempdir().
Portable Converter Default: Updated DICOM2NiFTIConverter.convert() so its default output location is resolved at runtime from the platform temp directory instead of being hardcoded to /tmp/upload.
Regression Coverage: Added targeted tests for both config path normalization and the converter default behavior.

Validation:
Ran python -m pytest package/src/pyaslreport/tests/test_temp_path_normalization.py -q and both temp-path tests passed.

Fixes #37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hardcoded /tmp/ paths in config break Windows compatibility (Need your help)

1 participant