Octolapse icon indicating copy to clipboard operation
Octolapse copied to clipboard

Use os.path instead of ntpath to improve cross-platform compatibility

Open jacopotediosi opened this issue 6 months ago • 0 comments

This project currently uses the ntpath module for path manipulations. While this works in many cases, ntpath is specific to Windows and may result in incorrect behavior on non-Windows platforms such as Linux or macOS.

The os.path module automatically selects the appropriate path implementation for the current operating system (ntpath on Windows, posixpath on Unix-like systems), making it the preferred choice for cross-platform compatibility.

Unless there is a specific need for Windows-style path handling, I recommend replacing all occurrences of ntpath in utility.py with os.path, especially considering that OctoPrint is most commonly used on Linux-based systems like Raspberry Pi (OctoPi).

jacopotediosi avatar May 03 '25 11:05 jacopotediosi