How to use the pathlib2.supports_symlinks function in pathlib2

To help you get started, we’ve selected a few pathlib2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mcmtroffaes / pathlib2 / tests / test_pathlib2.py View on Github external
def support_can_symlink():
        return pathlib.supports_symlinks
github mcmtroffaes / pathlib2 / tests / test_pathlib2.py View on Github external
support.rmtree = shutil.rmtree

try:
    import grp
    import pwd
except ImportError:
    grp = pwd = None

# support.can_symlink is missing prior to Python 3
if six.PY2:

    def support_can_symlink():
        return pathlib.supports_symlinks

    support_skip_unless_symlink = unittest.skipIf(
        not pathlib.supports_symlinks,
        "symlinks not supported on this platform")
else:
    support_can_symlink = support.can_symlink
    support_skip_unless_symlink = support.skip_unless_symlink


# Backported from 3.4
def fs_is_case_insensitive(directory):
    """Detects if the file system for the specified directory is
    case-insensitive.
    """
    base_fp, base_path = tempfile.mkstemp(dir=directory)
    case_path = base_path.upper()
    if case_path == base_path:
        case_path = base_path.lower()
    try: