Python projects face common issues running on different operating systems

An Empirical Analysis of Cross-OS Portability Issues in Python Projects

Software Engineering

Summary

Python is meant to work the same on any computer system, but many real programs still run into problems when moved between different operating systems like Windows and Linux. The authors studied over two thousand projects and found about 11% had test failures due to OS differences. They categorized the main types of problems and tested how well current tools and AI can detect and fix these issues. Their findings include useful patterns for developers and evidence that some fixes are accepted by the open-source community.

What this means in practice

  • For python developers: Identify and fix OS-dependent bugs in Python projects using categorized failure patterns and AI-assisted suggestions.
  • For tool designers: Improve static analysis tools to detect cross-OS portability issues informed by the taxonomy and diagnostic signatures in this study.

Authors

Denini Silva, MohamadAli Farahat, Marcelo d'Amorim

Abstract

While Python is designed as a cross-platform language, real-world applications encounter portability failures when deployed across different operating systems. We present the first large-scale empirical study of cross-OS portability issues in Python, analyzing 2,042 open-source repositories using two complementary approaches: systematic cross-OS test reexecution and manual analysis of GitHub issues. Our cross-platform testing of 500 projects reveals that 11.2% exhibit OS-dependent test failures. Through systematic analysis of 240 GitHub issues, we confirm 102 genuine portability problems spanning 95 additional projects. We develop a comprehensive taxonomy identifying 7 primary failure categories - with file/directory operations, process management, and library dependencies being most prevalent - along with 24 distinct sub-categories, 15 diagnostic signatures, and 4 systematic repair patterns. Our evaluation reveals that existing static analysis tools provide minimal support for portability detection, while large language models achieve 40-79% accuracy in identifying issues and 50-77% success in generating fixes when provided with structured guidance. Through 33 contributed pull requests, we demonstrate practical applicability and developer acceptance (17 merged, zero rejected) of our findings. This work establishes the first comprehensive baseline for understanding and addressing cross-OS portability issues in Python, providing actionable insights for developers, tool designers, and the broader research community.