[issue31380] test_undecodable_filename() in Lib/test/test_httpservers.py broken on APFS

Ronald Oussoren report at bugs.python.org
Tue Nov 28 05:25:37 EST 2017


Ronald Oussoren <ronaldoussoren at mac.com> added the comment:

Another option is to skip this test unconditionally on macOS when using APFS, the test is already skipped on win32 and tests a generic codepath where only testing on Linux should be fine.

BTW. It is fairly easy to detect if a path is on APFS:

```
import subprocess
  
def is_apfs(path):
    lines = subprocess.check_output(['df', path]).decode('utf-8').splitlines()
    mountpoint = lines[1].split(None, 1)[0]

    lines = subprocess.check_output(['mount']).decode('utf-8').splitlines()
    for ln in lines:
        path = ln.split(None, 1)[0]
        if path == mountpoint:
            return '(apfs' in ln

    return False
```

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31380>
_______________________________________


More information about the Python-bugs-list mailing list