diff --git a/LbPlatformUtils/inspect.py b/LbPlatformUtils/inspect.py index 5f2cf08c1f8bc23aee70ec16cf02fc3cfc251c87..e26b9217f9ecc479b857c49e08a8a696a3bc97c9 100644 --- a/LbPlatformUtils/inspect.py +++ b/LbPlatformUtils/inspect.py @@ -121,8 +121,10 @@ def _Linux_os(): version = '' try: - if os.path.exists('/etc/os-release'): - name, version = parse_os_release(open('/etc/os-release')) + os_release_fn = '/etc/os-release' + # Some systems have an empty /etc/os-release that we should ignore + if os.path.exists(os_release_fn) and os.path.getsize(os_release_fn) > 0: + name, version = parse_os_release(open(os_release_fn)) elif os.path.exists('/etc/redhat-release'): name, version = parse_system_release(